Repository navigation
fix(sdk-go): sync a directory to a router its stamp was not written for - #2210
Merged
Merged
Conversation
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.
martinmitrevski
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Agent.Syncskips a directory whose.agent_syncstamp matches the folder's hash, but the stamp doesn't record which router it was written for. Syncingexamples/voice_agents/swift_assistantto a local router and then to the hosted one (go run ./configurewith a differentSTREAM_ACCELERATION_URL) printed success and sent nothing. The hosted config kepttools: [], so every sample-app session there failed with400 tool_not_configureduntil.agent_syncwas deleted by hand. The JS SDK already guards against this: it trusts a matching stamp only when the stored config'ssync_hashmatches too.Changes
sdks/go/agents/config.go: when the stamp matches, the stored config must also carry the samesync_hash. Otherwise the folder is synced.agent_test.go: the fake router now recordssync_hashon sync, as the real one does (acceleration/internal/api/sync.go).CHANGELOG.mdbug-fix entry..claude/skills/sdk/SKILL.md: a note for Python, .NET, Ruby, Rust and PHP to check their stamp logic.Validation
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 ./...andgo vet ./...insdks/gopass.