Repository navigation
fix(core): make turn and tool-call IDs unique across sessions - #59
Merged
Merged
Conversation
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.
Description
Opening a fresh agent session reused
turn-1, and model call IDs were exposed unchanged. Applications which retain edit history or deduplication keys across voice sessions could therefore confuse two unrelated turns/calls. Core now generates opaque UUID-based public turn and call identities, keeps one call identity across fragments/lifecycle/hooks/tool contexts/results, and translates settled results back to the provider's original ID. Reused raw IDs in later responses get new public identities; response-scoped lookup state is released with its response and cleared on close.Issue association
Refs #56 and Q-cell2/vdoc-server#13. This delivers the runtime/protocol repair for #56; package release remains a separate, explicitly unapproved step. Related normative prose correction: #57.
Based directly on current main
f5e0825, independent of open PR #58. Both touch the argument-fragment dispatch point, so that small overlap needs resolution when merging the second PR.Behaviours Completed
seq,callId,turnIdand envelope, rather than being re-identified during replay.global-tool-ids-v1andGLOBAL_TOOL_IDS_V1in protocol revision 1.3. This optional capability exposes the stronger guarantee without tightening the baseline rules forbidden by §3.1/§3.2. The reference SDK generates stronger IDs for baseline peers too; old servers may decline the capability.Files Changed
packages/core: public identity allocation, provider-result translation, response/close cleanup and regression coverage; existing tests echo observed IDs instead of assuming provider IDs.packages/protocol,packages/server,packages/client: exported capability and negotiation coverage.spec/: revision 1.3, draft registry entry and two shared negotiation vectors; message schemas/shapes unchanged.conformance: real WebSocket cross-session/replay/result-isolation regression and opaque-identity fixture adaptation.scripts/consumer-smoke.mjs, example assertions anddocs/GLOBAL_IDENTIFIERS.md: actual tarball checks and integration/guarantee documentation.Testing
npm test: 473 passed, including four new core identity cases, capability/resume coverage and the shared vectors.npm run typecheckandnpm run check:spec: passed (23 schemas, 2 draft capabilities, 158 control vectors, 9 audio vectors).npm run test:conformance: 169 passed, including all existing fault/timeout/cleanup checks and the new real WebSocket regression.npm run test:e2e: 7 passed.npm run test:workers: 2 passed in real workerd.npm run test:conformance:consumer: passed with the actual installed standalone CLI tarball and embedded reference drivers.PYTHONPATH=python/src python3 -m pytest python/tests: 467 passed on Python 3.14 against the source tree, including the shared spec vectors.npm run pack,npm run check:budgets,npm run test:consumer: passed, including clean installation of the 13 local tarballs outside the checkout and both TypeScript resolution modes. Core 5.22 KB gzip / 15 KB; protocol 2.18 / 5; client 5.27 / 20. No dependency or manifest/lockfile changes.Hosted PR checks also pass: core checks, conformance profile and actual CLI consumer, Node e2e, Workers, Python 3.10/3.14, docs build, and the CI release dry-run job. The docs deployment is skipped for this PR; no actual release workflow was dispatched.
Unsure About / Limits
Implementation Order and Acceptance