Repository navigation
[AI-3663] Keep the last synced hash for connectors and routers #2302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5eebd10
WIP: store sync_hash on connector definitions and router configs
kanat 0fb170d
WIP: tests for connector and router config sync hashes
kanat a446711
Regenerate clients for sync_hash; SDK note
kanat da20427
Name sync_hash in the add-connector skill
kanat e09e839
Keep router config fields aligned; wrap long test lines
kanat a1f8a69
Merge remote-tracking branch 'origin/main' into connectors/sync-hash
kanat 2346939
Move the SDK note to notes/; regenerate schema/global.sql
kanat d8d0d7b
Merge remote-tracking branch 'origin/main' into HEAD
kanat 1a7db9f
AI-3663: move the sync_hash migration to slot 20270201001200
kanat c18817e
AI-3663: an import from a release before sync hashes stores none
kanat ade0624
AI-3663: other content under the stored hash clears it
kanat fd051bf
AI-3663: pin the sync_hash update to the caller's own revision
kanat 6d47d16
AI-3663: compare a synced router config with the stored row, not the …
kanat dfdb86c
Merge origin/main into connectors/sync-hash
kanat f33f7af
Merge branch 'main' into connectors/sync-hash
kanat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Connectors and router configs carry a `sync_hash`, as agent configs do: `createConnector` (`CustomConnectorRequest.sync_hash`) and `createRouterConfig`/`updateRouterConfig` (`RouterConfigRequest.sync_hash`) take the fingerprint of the file a sync sent, and `Connector.sync_hash` and `RouterConfig.sync_hash` return it. Any write without one clears it; a router config replace with the stored hash and the same content writes nothing, and a connector sent again with the same definition and another hash keeps its revision and records the hash. Every generated client is regenerated in this change; no SDK computes or sends the hash yet. Other SDKs need to update: once the CLI's hash for a connector or router file is settled (AI-3664), a server SDK that syncs those files sends it the same way. |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Should fix] R1.3 A replace that sends the stored hash with different content is written and keeps the hash, so the hash now describes content no sync wrote. This happens with a client that reads the config and sends it back edited.
RouterConfigRequestallows extra properties, so a GET body PUT back whole is accepted,sync_hashincluded. The CLI's next sync then sees its own hash and cannot see the edit. Probe: create withhash-one, GET as a map, setstt.target, PUT the map back. The storedsync_hashis stillhash-one.Fix: after the early return, add
if config.SyncHash == existing.SyncHash { config.SyncHash = "" }. Then assert the cleared hash inTestTheSameHashWithOtherContentIsStillWritten, add the echo row above, and update the PR body row "same hash, other content". After a stale hash, one more sync records it again.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in ade0624: other content under the stored hash now clears it. Tests:
TestRouterConfigsSuite/TestTheSameHashWithOtherContentIsStillWritten(now asserts no hash) andTestAReadSentBackEditedClearsTheHash(GET as a map, edit stt, PUT it back). Both fail with the newifturned off.