Repository navigation
feat(observe): tool_call_input carries arguments ACP runtimes send after a call starts - #148
Merged
Merged
Conversation
…arted
Some ACP runtimes put a tool call's real arguments only on a later
tool_call_update: opencode opens a shell call with rawInput {cwd} and a
file call with {}, kimi opens with no rawInput at all. The projection
read tool_call_started.input from the opening frame only, so hosts
never saw the command or the file path (#147).
The shared ACP projection now remembers the input it last reported for
each call. A tool_call_update whose rawInput differs from it adds a
tool_call_input event holding the whole input, in the same form as
tool_call_started.input, replacing the earlier one. An unchanged repeat
adds nothing. On the frame that ends the call it comes before
tool_call_ended, and nothing is read after the end. The rule names no
runtime; the opening tool_call_started is unchanged.
The consumers handle the new kind: the session view's tool part takes
the latest input (an input without a start renders like an end without
one), the status fold treats it as activity in the tool phase, and
`oar run` prints the detail the new input adds.
This adds a member to RuntimeEventBody, so a host with an exhaustive
switch over event kinds stops compiling until it handles
tool_call_input.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…shell commands
With tool_call_input in place, the latest input of a kimi `Bash` or an
opencode `bash` call holds its command, so both now get a `command`
field. The keys come from the recordings: kimi's late rawInput is
{command}; opencode's is {command, cwd} or {command, workdir}. No
recorded opencode input carries a `description`, so none is read.
opencode's file tools had no recording. `experiments/acp-vendor-snapshot.ts`
gains a `files` scenario (write, read, edit, grep, glob, then a shell
`cat`, in a scratch directory scrubbed from the titles), recorded from
opencode 1.18.30 as opencode-acp-v1-files.vendor.json. Each tool opens
with an empty rawInput and gets its arguments on the next update, so
classifyTool now maps read → read_file, write and edit → edit_file, and
grep and glob → search. The detail comes from filePath or path.
The replay test now runs the snapshot frames through the projection and
the session view, so a call's input is the latest one the view holds.
The kimi and opencode activity lines now show the command.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
xxchan
added a commit
that referenced
this pull request
Oct 6, 2026
Minor release: #148 (Ferryman) adds the `tool_call_input` event, the arguments an ACP runtime reports after a call starts (opencode, kimi, grok), folded into the session view's tool part and read by `classifyTool` (opencode bash, read, write, edit, grep, glob; kimi Bash command). New member of `RuntimeEventBody`: exhaustive switches over event kinds must handle it. Version bump only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
stamp-build Bot
added a commit
that referenced
this pull request
Nov 1, 2026
<!-- stamp:review:v1 --> <sup><img src="https://cdn.slock.ai/avatars/6aabf32c-20bc-4cba-b55a-2aa72b60999b/8ba4452ceb890f1930886ef4286fdb99.webp" width="16" height="16" align="absmiddle" alt=""> <b>Otter</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_6729fcef36ba34b6a3aa44fda20ef78b"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup> --- <!-- /stamp:review:v1 --> A cancellation can spend its one-second observation budget waiting behind Windows process-table preparation. Previously, its queued read still started after the caller had timed out. A later cancellation then waited behind that unwanted read and needed another fresh query, which could consume its own budget too. Pass each caller's existing deadline on the `performance.now()` clock into the internal batcher. At query start, discard expired callers and skip an empty batch. Choose foreground/background handles from the remaining callers. Requests without a deadline remain live; an already-started query continues under its existing limit. The caller still rejects results delivered at or after its deadline, even when its timer callback has not run. No public API, observation budget, retry, PID identity check or signalling rule changes. This also applies the existing five-second preparation budget before a queued preparation begins. A background request without a deadline still runs. Skipped batches are removed before their result settles, so a later request receives a new observation rather than the skipped result. The spec documents these boundaries. This removes avoidable queue work; it does not promise success when an active query or the next OS read itself is slow. Validation: - Fifteen deadline regressions cover all-expired and mixed callers, late arrivals, unbounded background requests, foreground handle ownership, skipped-batch settlement, real preparation's existing budget, exact deadline boundaries, wall-clock changes and rejection of late identity evidence. The original implementation failed the new expiry/ownership controls. - The real ACP/process-table regression no longer waits for the expired read between turns. Its first observation still times out and leaves its tool unverified; its second observation succeeds and disposal reclaims that turn's tool. An unwanted read is deliberately delayed so a regression cannot hide behind a fast local query. - Removing expiry filtering, the post-read deadline guard or serial ordering each caused the relevant tests to fail. Mutations were restored. - `CI=1 pnpm run check`: type checking, lint, 2,964 tests and 18 mock behavior cases passed. Build and all fourteen behavior backends passed locally, using explicit CI-version binary paths and required availability. The new controls also passed on Windows and macOS in PR CI. - All 35 PR checks passed. Windows check required one rerun after the installer smoke test's temporary-directory cleanup threw `ENOTEMPTY` and hid the installation result; the unchanged retry installed CodeBuddy 2.179.1 successfully. Preserving the primary result during cleanup is tracked as a separate follow-up. Task #148; follows the fixture-only fix in [#595](#595). Co-authored-by: Otter <[email protected]>
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.
What
Some ACP runtimes send a tool call's real arguments only in a later
tool_call_update. opencode opens a shell call withrawInput {cwd}and a file call with{}. kimi opens with norawInputat all.tool_call_started.inputwas read only from the opening frame, so hosts never saw the command or the file path. Ferry showedbash {"cwd":"/tmp/x"}andread {}.Closes #147.
Evidence (opencode 1.18.30 through Ferry, oar 0.23.0):
Shape (as agreed in #147)
{ kind: "tool_call_input"; callId: string; input: string }inRuntimeEventBody. It holds arguments the runtime reported after the call started. It is the WHOLE input, in the same form astool_call_started.input(a string, JSON for ACP), and replaces the previous input. It is never a delta.tool_call_updatewhoserawInputdiffers from it emitstool_call_input. An identical input is not emitted again. If the ending frame carries a newrawInput,tool_call_inputcomes beforetool_call_ended. Nothing is read after the end. A running update with both a new input andrawOutputgives the input, then the progress.tool_call_startedis unchanged. It is not delayed and not rewritten.inputtakes the latest input. An input whose start was never seen renders as a?part, like an end without a start.classifyToolgets the latest input through the view (andgroupToolActivity, which reads the view).rawInput({command}) arrives in one later frame. The partial-JSONcontentchunks before it are still not read.tool_call_progress: the phase stays, the clock moves;oar runprints the detail the new input adds, once, e.g.[Running command], then[Running command] echo hi > a.txt && cat a.txt.classifyTool
Every entry comes from a recording.
<key>placeholders are used as in #139.bashrun_command(unchanged)command(new)opencode-acp-v1.vendor.json, tools[1]:{command, cwd};opencode-acp-v1-files.vendor.json:{command, workdir}readread_filefilePathopencode-acp-v1-files.vendor.json:{filePath}writeedit_filefilePath{content, filePath}editedit_filefilePath{filePath, newString, oldString}grepsearchpath{path, pattern}globsearchpath{path, pattern}Bashrun_command(unchanged)command(new)kimi-acp-v1.vendor.json, tools[2]:{command}New recording. opencode's file tools had none.
experiments/acp-vendor-snapshot.tsgains afilesscenario: write, read, edit, grep, glob, then a shellcat, run in a scratch directory whose path is replaced by<cwd>in titles. It was recorded from opencode 1.18.30 (freeopencode/big-pickle, no login) intotests/replay/fixtures/opencode-acp-v1-files.vendor.json.Not added:
descriptionfor opencodebash. ACP view drops tool input that arrives in tool_call_update (opencode, kimi) #147 suggested it "if present", but no recording carries it (Ferry{command, cwd}, the shell fixture{command, cwd}, the files fixture{command, workdir}). It can follow once one does.grep/glob, the detail is the directory, not the pattern. This comes from the existing shared key order indetailOf(pathbeforepattern, same as pi's and claude's grep). I left it alone.Compatibility
RuntimeEventBody(and soEventBody/Event) gains a member. A host that switches exhaustively over event kinds (switch (event.kind)with anevercheck orswitch-exhaustiveness-check) stops compiling until it handlestool_call_input. For release notes: ignoring it is safe, but then the host only shows the first input. A host that renders fromviewOf/reduceSessionViewgets the latest input with no change.In this repo, the exhaustive switches over event kinds are all updated:
observe/agent-status.ts,observe/session-view-events.ts,cli/src/progress.ts, and the test describers intests/fixtures/acp-session-support.ts,tests/replay/claude-projection.test.ts,tests/replay/codex-projection.test.ts. Lint'sswitch-exhaustiveness-checkfound them.Records written before this have no
tool_call_input, so a replayed old log shows what it showed before.Tests
tests/acp/acp-tool-input.test.ts(projection):rawInputshape);tool_call_input, thentool_call_ended, and nothing after the end;tests/acp/acp-kimi-wire-shapes.test.ts: kimi's laterawInput(0.42.0 frames) is now atool_call_input. The started record is unchanged.tests/tool-call-input.test.ts: the view's tool part takes the latest input and keeps its state, and an input without a start renders. The status fold keeps the tool phase and moves the clock.tests/cli-progress.test.ts:oar runprints the detail a later input adds, once.tests/replay/tool-activity.test.ts: the kimi and opencode fixtures now run through the projection ANDviewOf. The activity snapshots changed as expected:kimi-acp-v1.activity.txt:Bash │ Running command→Bash │ Running command: <command>opencode-acp-v1.activity.txt:bash │ Running command→bash │ Running command: <command>opencode-acp-v1-files.activity.txt:Editing file: <filePath>,Reading file: <filePath>,Searching: <path>,Running command: <command>is_backgroundandvariant, which now arrive as atool_call_input; the classification stays the same.ToolAction.Verification:
CI=1 pnpm run checkis green: typecheck, lint, 669 passed / 31 skipped, mock sea-trial 19/19.pnpm run buildpasses.pnpm tsx sea-trial/all.ts: mock, claude-aimock, codex-aimock and pi-aimock all clean.OAR_TEST=opencode pnpm sea-trial: 19/19 on real opencode 1.18.30.oar run opencodewith bash, read, edit and grep: each call got atool_call_inputon its first in-progress update and none on repeats, and the CLI printed the command and the file paths.Docs
docs/spec/record-stream.md: a rule for the latest input,tool_call_inputin the event list, and which runtimes emit it.docs/design/chat-ui.md: the events → view mapping row.docs/runtimes/kimi.md,docs/runtimes/opencode.md: the "no command" paragraphs now describe the new behaviour, with opencode's recorded input keys per tool.docs/runtimes/grok.md: a note on its laterrawInput.experiments/README.md: the snapshot recorder row (opencode,files).🤖 Generated with Claude Code