Skip to content

fix(sdk-go): sync a directory to a router its stamp was not written for - #2210

Merged
oliverlaz merged 2 commits into
mainfrom
oliver/go-sync-stamp-per-router
Nov 23, 2026
Merged

oliverlaz merged 2 commits into
mainfrom
oliver/go-sync-stamp-per-router

Conversation

@oliverlaz

Copy link
Copy Markdown
Member

Why

Agent.Sync skips a directory whose .agent_sync stamp matches the folder's hash, but the stamp doesn't record which router it was written for. Syncing examples/voice_agents/swift_assistant to a local router and then to the hosted one (go run ./configure with a different STREAM_ACCELERATION_URL) printed success and sent nothing. The hosted config kept tools: [], so every sample-app session there failed with 400 tool_not_configured until .agent_sync was deleted by hand. The JS SDK already guards against this: it trusts a matching stamp only when the stored config's sync_hash matches too.

Changes

  • sdks/go/agents/config.go: when the stamp matches, the stored config must also carry the same sync_hash. Otherwise the folder is synced.
  • agent_test.go: the fake router now records sync_hash on sync, as the real one does (acceleration/internal/api/sync.go).
  • CHANGELOG.md bug-fix entry.
  • .claude/skills/sdk/SKILL.md: a note for Python, .NET, Ruby, Rust and PHP to check their stamp logic.

Validation

  • New test TestAnUnchangedDirectoryIsSyncedToARouterItWasNeverSyncedTo: sync to router A, then the same folder to router B. B must get the sync, and must not get it again on a third run. It fails on main ("the router that never had the directory got 0 syncs") and passes with this change.
  • go test ./... and go vet ./... in sdks/go pass.
  • Found while verifying fix(sdk-js): merge a live UI patch onto the router's base; sample apps name their tools #2196 against the hosted router.

Agent.Sync trusted a matching .agent_sync stamp whichever router wrote it,
so a folder synced to a local router and then to the hosted one sent
nothing the second time. A matching stamp is now trusted only when the
stored config's sync_hash is the same hash, as the JavaScript SDK does.
@oliverlaz
oliverlaz merged commit 88c2ed7 into main Nov 23, 2026
7 checks passed
@oliverlaz
oliverlaz deleted the oliver/go-sync-stamp-per-router branch November 23, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants