fix(client-tools): freeze resolved ask cards + demo day_card steering#657
Merged
Conversation
Sharpen the add_stop/move_stop/day_card catalog descriptions so the model follows writes with the day_card recap view (verified live: add_stop → day_card → continuation). Descriptions-only — still no system-prompt coaching. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…all on resolve
After a client `ask`/`view` tool resolves, only the backend ToolMessage
carried the outcome — the LOCAL ToolCall stayed result-less, so the
transcript card never froze. resolve() now writes the emitted value onto
the local ToolCall: ok → result=value/status stays complete; error →
result={error}, error set, status='error'. chat-tool-views' toToolViewSpec
already spreads result into the mounted component's props, so the card can
branch to a resolved state on the next render.
ag-ui writes its WritableSignal directly; langgraph layers an override map
over the read-only toolCalls projection (the SDK stream only ever carries
backend results) via a new store.applyClientResult hook.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The clear_day and confirm_booking ask components now receive their own
emitted value back as props once resolved (the adapters write the result
onto the local tool call). Each branches on an optional input — cleared /
confirmed undefined → interactive card; defined → a frozen line with no
buttons ("Day N cleared — M removed" / "Kept day N" and "Booking
confirmed" / "Booking cancelled").
e2e: both ask tests now assert the frozen text appears AND the action
buttons are gone after resolving.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Two follow-ups from the client-tools demo launch (PR #655):
1. Resolved
askcards freeze (framework-level)Previously a client ask confirm card stayed fully interactive after resolution (buttons clickable, live recomputed count). Now both adapters write the emitted outcome onto the local tool call in
resolve()— semantically correct (the tool did produce a result client-side) — andchat-tool-views' existing props spread delivers it back to the mounted component, which branches to a frozen state.@threadplane/ag-ui: writes result/error/status onto the reducer store's tool call.@threadplane/langgraph: the store'stoolCallsis a read-only projection of the SDK stream, so the capability gainsapplyClientResultand the agent layers aclientResultOverridessignal over the projection (later stream emissions can't clobber the frozen result).clear-day-confirm, cockpit ag-ui + langgraphconfirm-booking) render frozen "✓ / cancelled" states with the buttons removed.toHaveCount(0)on the buttons.2. Demo
day_cardsteering (descriptions-only)Sharpened the
add_stop/move_stop/day_cardcatalog descriptions so the model follows itinerary writes with theday_cardrecap view. Verified live (real OpenAI):add_stop→day_cardrendered → "Done — I added Pompidou to Day 1 and showed the updated day card." Still zero system-prompt coaching.Verification
🤖 Generated with Claude Code