Repository navigation
Expose typed Go methods for Loom operations - #1750
Conversation
Give Go callers typed requests and responses for every registered operation. Check the generated package in lint and CI so changes to the HTTP contract require regeneration. Signed-off-by: zhangxiaoyu.york <zhangxiaoyu.york@bytedance.com>
Signed-off-by: zhangxiaoyu.york <zhangxiaoyu.york@bytedance.com>
Generate the client methods and root package types from the operation registry. Keep authentication, request handling and the existing memory methods in the shared client. Signed-off-by: zhangxiaoyu.york <zhangxiaoyu.york@bytedance.com>
Signed-off-by: zhangxiaoyu.york <zhangxiaoyu.york@bytedance.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
left a comment
There was a problem hiding this comment.
The generated methods can supply an omitted write target and cannot represent the full conflict cursor range. Both cases reproduced in Go tests against the generated SDK.
zlareb1
left a comment
There was a problem hiding this comment.
The format job reports the same docs/pages/adoption.astro assignment on this merge and clean main. The pinned formatter passes on that file with the tracked repair. Failed job · Repair #1706
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 715e073. Configure here.
…ed-types Signed-off-by: zhangxiaoyu.york <zhangxiaoyu.york@bytedance.com>
…ed-types Signed-off-by: zhangxiaoyu.york <zhangxiaoyu.york@bytedance.com>
Require a named collection or namespace for management calls and keep a key update unfiltered unless the caller names an agent. Omit blank required scope fields while preserving HTTP org resolution. Use uint64 for conflict versions so the next-page cursor can round-trip. Signed-off-by: zhangxiaoyu.york <zhangxiaoyu.york@bytedance.com>
…ed-types Signed-off-by: zhangxiaoyu.york <zhangxiaoyu.york@bytedance.com>
HTTP validates required identity strings before it fills the optional scope. Keep those keys for calls such as context.pack that need to distinguish an empty agent from a missing one. Require namespace management and extraction policy calls to name the object they manage. Signed-off-by: zhangxiaoyu.york <zhangxiaoyu.york@bytedance.com>
A user- or session-scoped history call has no single-user agent default. Omit an unspecified agent so the required-field check runs instead of querying rows with an empty writer. Signed-off-by: zhangxiaoyu.york <zhangxiaoyu.york@bytedance.com>
zlareb1
left a comment
There was a problem hiding this comment.
The prior collection-delete, memory-update and conflict-cursor findings are fixed. The focused Go request test still sends an agent selector that the caller omitted from memory.clear. The generated SDK also needs an explicit namespace for rollback writes and a typed snapshot-to-restore path.
Keep omitted memory clear selectors unset, require a named namespace for rollback writes, and share the snapshot payload with restore. Signed-off-by: zhangxiaoyu.york <zhangxiaoyu.york@bytedance.com>
…ed-types Signed-off-by: zhangxiaoyu.york <zhangxiaoyu.york@bytedance.com>
zlareb1
left a comment
There was a problem hiding this comment.
The SDK preserves an omitted clear selector, requires a named namespace to apply a rollback, and passes the typed snapshot payload directly to restore. The Go tests, generator checks, and six code-generation tests pass.
zlareb1
left a comment
There was a problem hiding this comment.
The sender census reports the same stale plugin client fingerprints on this CI merge and on clean main. The test passes locally with both fingerprint repairs. PR job · Main job · Plugin repair #1773 · SDK repair #1706
The extraction classification test also fails on main because changed_files has no content classification. PR job · Repair #1747
zlareb1
left a comment
There was a problem hiding this comment.
The tunable-constant gate flags the same duplicate coverage limit on this head and on clean main. The coverage repair keeps the store's existing bounds. PR job · Main job · Coverage repair #1722
The adoption directory test fails on this head and on clean main because ClickHouse expires its fixed snapshot rows. The repair derives fixture dates from UTC. PR job · Main job · Adoption repair #1740

Related: #51
Changelog category
Changelog entry
The Go SDK provides typed methods for every registered operation. Callers can use methods such as
client.Context.Pack,client.WorkingMemory.Get, andclient.Knowledge.Addfrom theloompackage.Why
Go callers need a typed way to call Loom operations without assembling HTTP requests. The operation registry generates the methods and their request and response types.
make lintchecks both generated files for drift.Scope and risk
The grouped methods share the existing HTTP transport, authentication, and error handling. The generated memory methods accept
if_match_sha256. Client-wide user and session defaults, automatic idempotency keys, and retries that honorRetry-Afterremain follow-up work. The SDK does not add client-side session protection.Collection and namespace management calls and namespace-scoped extraction policies require an explicit target namespace. Key updates search across agents unless the caller sets an agent filter. Grouped methods omit unconfigured optional identity fields and preserve required identity fields for server validation. History omits an unspecified agent so Loom can reject a scoped request that needs one. Conflict rows and pagination use unsigned 64-bit versions.
Compatibility, rollout and rollback
Set,Get,Search, andDeletesignatures stay the same.Tests
go build ./...,go vet ./..., andgo test -race ./...insdk/goon Go 1.22.12 and 1.27.4.make lint typecheckand focused generator, documentation, and repository instruction tests. Request tests cover explicit namespace targets, omitted agent filters, required and optional identity fields, and conflict pagination above2^63.make format-checkreports the same Biome difference indocs/pages/adoption.astroonmain. Hosted CI is pending.AI assistance in the code
AI-generated with TRAE. Local verification is listed above.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
--checkpasses.Note
Medium Risk
Large generated client surface with nuanced identity, namespace, and nullable-field semantics; no server wire changes, but incorrect defaults could cause wrong-scope writes if misused.
Overview
Adds
sdk_go_genso the operation registry generatessdk/go/wire/models.gen.goandsdk/go/client.gen.go, withmake lintand CI enforcing--checkvia Go 1.27.4 /gofmt. Contributor docs, devcontainer, and wire-op checklists now list this generator beside the other SDK codegen steps.The Go
Clientis refactored around sharedclientTransportand grouped services (for exampleclient.Context.Pack,client.Knowledge.Add,client.Code.Repos). Handwritten pieces addOption/WithInput/Ptr/Some/Null, namespace guardrails for management calls, HTTP response metadata on outputs, and examples plus broad unit tests. Existing memory convenience APIs inmemory.goare unchanged on the wire.Reviewed by Cursor Bugbot for commit fd07bb8. Bugbot is set up for automated code reviews on this repo. Configure here.