Repository navigation
fix: close tool-stream lifecycle and contract audit gaps - #58
Merged
austinchennn merged 4 commits intoOct 19, 2026
Merged
austinchennn merged 4 commits into
austinchennn merged 4 commits into
Conversation
5 of 7 tasks
4 of 6 tasks
Keep main's public call ID mapping in the tool.call.delta guard, adapt the tombstone-eviction test to public call IDs, and update the contract audit's note on cross-session identifiers now that global-tool-ids-v1 has landed.
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
Audits the existing draft tool-stream contract and closes two concrete lifecycle gaps without replacing its architecture. A synchronous client stream listener can interrupt/close before its derived legacy preview; that preview is now suppressed. A late model argument fragment can reopen a settled core stream after its 256-entry tombstone is evicted; the session now consults its already-retained issued-call record.
Issue association
Refs #49, Refs #22. Related coverage: #17/#50. Independent branch from current upstream main
f5e0825; #29/#30/#34/#41 and #35–#48 are already merged. Existing negotiation, lifecycle tracking, local cancellation and server black-box coverage are credited, not reimplemented.Normative discrepancy is separately recorded in #57: §3.3 still says no capabilities exist despite the registry/§7.5. Spec, schema, shared vectors and draft status remain unchanged. The newer cross-session identifier proposal #56 is not folded into this audit.
Behaviours Completed
Files Changed
packages/client/src/session.ts,packages/client/test/tool-streams.test.ts: two-line guard and four public API regression cases.packages/core/src/session.ts,packages/core/test/tool-stream.test.ts: reuse existing issued-call records and one public session/model regression across tombstone eviction.docs/TOOL_STREAM_CONTRACT.md,docs/ARCHITECTURE.md: 94-line contract/evidence index plus navigation.packages/server/src/capabilities.ts: correct explanatory comment only; runtime capability rules unchanged.Brief Explanation
Core ToolStreams still owns server lifecycle transitions; AgentSession owns invocation/response records; server only maps negotiated/legacy traffic; client owns local display cancellation and derives previews. Both repairs use existing state at the point where it can change or remain authoritative, rather than adding another tracker, unbounded cache or abstraction.
Separate reviewable commits:
4a3ec78client fix,46518f6core fix,879846acoverage/docs. No dependencies, manifests, lockfiles, schemas, normative prose, registry state, wire/API shapes, conformance profile or application-specific feature changed.Testing
macOS 26.6.2 arm64; Node 22.23.3. All final runs below were in
/Users/wangyeyu/Desktop/vRealTime, with native installed build tools; no temporary source copy or binary override.start, arguments-complete, settled, start, arguments-delta. No private state injection or sleep was used. Both regressions then passed (25 tool-stream tests across two files).npm test: 470 passed, 26 files (465 baseline + five regression cases).npm run test:conformance: 168 passed, including existing five-case server-tool-stream positive/fault/replay/cleanup tests and all merged profiles; build and conformance typecheck included. No test(conformance): 客户端工具流预览、取消与重放观察一致性 #50 profile is claimed.npm run test:e2e: 7 passed.npm run typecheck: passed.npm run check:spec: passed, 23 schemas/1 capability/156 control vectors/9 audio vectors.npm run check:budgets: passed, dependency/Node boundaries intact. Protocol 2.16 KB gzip/5 KB; core 5.11/15; client 5.26/20 (rounded; not a claim of byte-identical bundles).npm run test:conformance:consumer: actual tarball outside the checkout, embedded official SDK drivers and all profiles/inventory checks passed; fullSuite remains incomplete.npm run build --prefix website: passed, 38 pages, all internal links valid. Initial attempt lacked Astro;npm ci --prefix website --ignore-scripts --no-audit --no-fundinstalled the existing lockfile dependencies, then build passed. No manifest/lock change.git diff --checkpassed. No separate lint/format script is configured.Unsure About
Implementation Order and Acceptance
All five #49 audit items are locally satisfied: evidence map, reproduced/repaired implementation gaps plus linked normative question, existing lifecycle regression preservation, honest draft status, and required checks. Checked implementation items mean local completion with this PR pending merge; they do not mean the changes are already on main. #49's author-owned checklist is minimally updated with this PR and explicit local-complete/pending-merge status; #22/#17 parent checklists are unchanged.
After merge, #49 can be closed as an audit/targeted-repair task if maintainers accept the explicitly linked normative follow-up and documented limits. It must not be interpreted as completing #50, #22, #17 or all tool-stream/identity/resource guarantees. No issue is automatically closed by this PR.