Repository navigation
#615 Show growing tool arguments in Session Chat - #767
Merged
Merged
Conversation
While a v2 server streams a tool's arguments, the pending Shell, Read,
Edit and Write cards now show the value read so far from the partial
input (command or file path), or the TUI v2 placeholder ("Writing
command…", "Preparing edit…") until one can be read.
- ToolArgumentsPreview (both platforms) reads top-level string fields
from partial JSON without throwing and caches the last parse.
- tool.input.started opens an empty preview; tool.input.ended replaces
it with the final text (settled arguments when it parses); a settled
input from tool.called drops the preview in the store merge.
- v2 history keeps a streaming tool's unparsed input as its preview.
- Tool cards carry isReceivingArguments; completed, error and v1 cards
keep today's chrome.
- Scenario harness: shell-command variant of tool-input-streaming-pending.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
OPE-185 Show growing tool arguments in Session Chat
While a tool’s arguments stream on a v2 server, Session Chat should show that growing input on the tool card — not only store it. Live ParentOPE-184 — Show remaining TUI v2 live events in Session Chat What to buildA pending or running tool card shows argument text as it streams, then the settled input after Acceptance criteria
Blocked byNone — can start immediately. |
3 tasks done
ivanfenenko
marked this pull request as ready for review
October 20, 2026 14:31
7 of 8 tasks
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
input.preview(the command or the file path). Until one can be read, they show the TUI v2 placeholder: "Writing command…", "Preparing read…", "Preparing edit…" or "Preparing write…". iOS and Android match.ToolArgumentsPreview(domain, both platforms) reads top-level string fields from partial JSON leniently. A string still being written counts as its prefix so far, an unfinished escape is dropped, and garbage ends the scan without throwing. The last parse is cached because each delta is read several times per frame.tool.input.startedopens an empty preview. Deltas append to it as before.tool.input.endedreplaces it with the final text, which becomes the settled arguments when it parses. A settled input fromtool.callednow drops the preview in the store merge instead of keeping it beside the arguments.streamingtool whose input string doesn't parse yet keeps it as the preview, so reconnecting mid-stream still shows it.isReceivingArgumentsflag; the growing value goes in the existing subtitle slot, so no design-system component change. Chip labels for Shell and Read follow the same value.key=valuefallback no longer shows a straypreview=….shell-commandvariant oftool-input-streaming-pendingstreams a long Shell command slowly. The scenario'sexpecttext no longer lists this issue as open.Server note
Only opencode
betapublishessession.tool.input.delta(since anomalyco/opencode f2323623c4, Oct 16).dev(bc5ebf00a4) and 2.1.0 (e9ac459) only sendinput.startedand theninput.endedwith the full text. On those servers the card shows the placeholder untilended, then the settled arguments.Evidence (real v2
betaserver, scenario harness,tool-input-streaming-pending/shell-command)tool.callediOS sequence:
Before this change the pending card had no subtitle until
tool.called, because no card readinput.preview. I didn't capture a before build. The Android frames are about 2-3s apart (adb screencapis slow while streaming), so they show one mid-stream state. The Android "before args" frame was taken before the card existed; the placeholder itself is covered by unit tests on both platforms.Checks
./gradlew :app:testDebugUnitTest(full JVM suite) passes.:app:assembleDebugbuilds.ktlintCheckreports no new findings on changed lines (existing findings elsewhere remain).xcodebuild teston a dedicated iPhone 17 (iOS 26.5) simulator:ToolArgumentsPreviewTests,V2LiveTurnTimelineTests,EventDomainAdapterTests,MessageDomainAdapterTests,SessionMessageEngineTests,SessionChatTimelineBlocksTestsandSessionChatViewModelTestsall pass: 522 tests in 7 suites. The full iOS test target was not run.input.started, growing command over deltas, chip label,.calledsettles it and drops the preview, completed card unchanged..endedreplaces the preview with parsed arguments.check.mjs --variants tool-input-streaming-pendingpasses all 3 plays on v2 beta.Issue
Risks / Follow-ups
betabatches deltas server-side (about 100-150 ms) and the parse is cached. Tool-input deltas still go through the non-streaming display path, which restarts its prepare on each update; both apps updated mid-stream on the harness, but a much denser stream could delay frames.dev/2.1 (placeholder untilended; covered by unit tests).🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need.