Commit d3aa695
fix(chat): never leave a client tool call unanswered on the server (#807)
* 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>1 parent 0c66d1c commit d3aa695
25 files changed
Lines changed: 3079 additions & 83 deletions
File tree
- apps/website/content/docs
- chat/api
- middleware/api
- docs/superpowers
- plans
- specs
- examples/chat
- angular/src/app
- python/src
- libs
- ag-ui/src/lib
- chat/src
- lib
- client-tools
- compositions/chat
- langgraph/src/lib
- middleware/src
- langgraph
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6952 | 6952 | | |
6953 | 6953 | | |
6954 | 6954 | | |
| 6955 | + | |
| 6956 | + | |
| 6957 | + | |
| 6958 | + | |
| 6959 | + | |
| 6960 | + | |
6955 | 6961 | | |
6956 | 6962 | | |
6957 | 6963 | | |
| |||
7024 | 7030 | | |
7025 | 7031 | | |
7026 | 7032 | | |
| 7033 | + | |
| 7034 | + | |
| 7035 | + | |
| 7036 | + | |
| 7037 | + | |
| 7038 | + | |
7027 | 7039 | | |
7028 | 7040 | | |
7029 | 7041 | | |
| |||
8698 | 8710 | | |
8699 | 8711 | | |
8700 | 8712 | | |
| 8713 | + | |
| 8714 | + | |
| 8715 | + | |
| 8716 | + | |
| 8717 | + | |
| 8718 | + | |
| 8719 | + | |
| 8720 | + | |
| 8721 | + | |
| 8722 | + | |
| 8723 | + | |
| 8724 | + | |
| 8725 | + | |
| 8726 | + | |
| 8727 | + | |
| 8728 | + | |
| 8729 | + | |
| 8730 | + | |
| 8731 | + | |
8701 | 8732 | | |
8702 | 8733 | | |
8703 | 8734 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
| 384 | + | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
| 475 | + | |
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| |||
0 commit comments