Centralize run lifecycle and enable strict templates - #805
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
blove
enabled auto-merge (squash)
July 13, 2026 18:44
Contributor
blove
added a commit
that referenced
this pull request
Aug 7, 2026
) * docs(specs): client-tool continuation correctness fixes Design for five defects found reviewing the shipped client-tool continuation stack (#782-#805). Four violate one unstated invariant: the server thread must never hold a client tool call without a result. Adds flush() to ClientToolsCapability so a settled result can be made durable without continuing the run, and maps all five fixes onto it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs(plans): client-tool continuation fixes implementation plan Ten tasks covering all five defects, TDD per task, with a live browser verification gate whose decisive step is reload-then-continue. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * feat(chat): add flush() to ClientToolsCapability * feat(langgraph): batched flush() with submit-drain fallback * fix(langgraph): take flush() batch ownership at snapshot and clear staging on thread switch * fix(chat): flush settled client-tool groups and stop discarding limited results * fix(chat): settle aborted client tools and wrap agent.stop once * fix(chat): flush blocked client-tool groups once on completion Flushing per blocked call stranded every batch after the first: adapter flush() implementations coalesce concurrent calls by returning the in-flight promise, so only the first batch was ever snapshotted. Gate the blocked-group flush on group completion, mirroring the terminal path. Drop the blockedIds guard: both shipped adapters mark a call resolved inside settle() so pending() drops it immediately, meaning a settled call can never be re-presented to the executor effect. The hazard it guarded was an artifact of a test double whose settle() left calls pending forever; the fakes now mirror adapter behavior instead. Warn rather than silently discard when a blocked call cannot be recorded because the capability implements no settle(). * fix(middleware): enforce tenant isolation in the client tool execution store * fix(chat): never continue the run when settling a cancelled client tool * feat(examples): add terminal client tool to the chat demo * docs: regenerate API docs for client-tool flush surface Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(langgraph): chain concurrent flushes and drop stale-thread client tool results --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
Summary
Root cause
Client-tool continuation bypassed the adapter lifecycle boundary by invoking the transport directly. That left continuation-generated assistant messages outside the active delivery generation and forced presentation code to infer ownership from global loading state.
Impact
Continuation runs now receive the same lifecycle ownership, telemetry, terminal handling, and tool catalog behavior as every other run. Angular templates compile under strict checking without project-level opt-outs.
Validation
NX_DAEMON=false npx nx run-many -t test,type-tests,build --projects=ag-ui,chat --skip-nx-cachegit diff --check