Repository navigation
feat(observe): ToolAction.paths names every file a read or edit call involves - #167
Merged
Merged
Conversation
…involves A codex fileChange classified as edit_file with no detail: its input is the item's `changes` array, and the detail extractor reads only JSON objects. A host listing the files an agent read or wrote (Ferry's fresh conversation opening) saw codex edits but never their files. ToolAction gains an optional `paths`, set only on read_file and edit_file: every file path the call involves, in the runtime's order, each once, absent when the input names none. - codex fileChange: each change's `path`, a rename's `kind.move_path` right after its source. The shape comes from a new recording of real codex 0.160.1 against the scripted provider: `move_path` is snake case, `null` on an update that does not rename; paths are absolute and come sorted by path, not in the patch's order. - claude Read/Edit/Write and the pi, opencode and cursor read and write tools: the one path `detail` already read. - `detail` stays the first of `paths`, with no "(+N more)" text, and `kind` stays edit_file for a fileChange that adds, updates and deletes. The fixture comes from `pnpm sea-trial:record codex-aimock file-change`, a new recorder mode: real codex against aimock in a scratch directory (no login, no tokens), the model sending apply_patch as an exec_command heredoc, which codex runs as a fileChange item. The scratch path reads `<cwd>` in the fixture. Additive: a new optional field. Refs #166 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review on #167: `paths` is every file a call involves, and NotebookEdit edits the file at `notebook_path`. Its old `detail` never read that key, a historical omission rather than a reason to leave the notebook out, so a host listing edited files would miss notebooks. NotebookEdit now gives `notebook_path` as `paths` and so as `detail`. The `paths` doc comment also says that for the pi and cursor `ls` tools the path is the listed directory, which hosts may list or not. Refs #166 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
xxchan
added a commit
that referenced
this pull request
Oct 7, 2026
Release OAR and CLI 0.29.0. This PR changes only the two package version fields. **New** - `ToolAction.paths` (#167, closes #166): on `read_file` and `edit_file`, every file path the call involves, in the runtime's order, each once; absent when the input names none. `detail` is its first entry. - codex `fileChange`: each change's `path`, and a rename's target right after its source. Codex fileChange calls previously had no `detail`; now `detail` is the first changed path, so `oar run` prints `[Editing file] <path>` for them. - claude `Read` / `Edit` / `Write` / `NotebookEdit` and the pi, opencode and cursor read and write tools: the one path the call names (`NotebookEdit` now has `notebook_path` as its `detail` too). - The `ls` tools (pi, cursor) give the listed directory. - `kind` stays `edit_file` for a `fileChange` that adds, updates and deletes at once. Validation: all 13 checks passed on #167's final head (`ab273f5`), with a new real codex 0.160.1 `fileChange` replay fixture. After this PR passes CI and merges, tag its exact squash commit as `v0.29.0` to trigger npm trusted publishing. 🤖 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 5, 2026
<!-- stamp:review:v1 --> <sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_1f7d3e4ef77d7080a181b5021947afd2"><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 request Codex sends the client during a turn (approval, user input, MCP elicitation, dynamic tool call) was recorded and never answered, so Codex waited and the turn hung. `Session` has no way for a host to answer, so nothing could ever settle it. Raft needs this to move Codex onto OAR (task #167, #oar-raft:3a629875 item 2). OAR now records each request verbatim, answers at once and records the answer as its `answered` response, so `events()` reads `app_request` then `app_answered`. - Decisions get their own native refusal from the app-server schema: `decline`, `denied`, an empty grant or answer set, or `success: false`. - Anything else, including a method from a later version, gets JSON-RPC `-32601`. - `serverRequest/resolved` now follows OAR's answer, so it no longer produces `app_request_cancelled`. There is no option: no host can answer today, so none could want the old behaviour. When one needs to answer, that is a separate interface. **Host-visible change:** on Codex, `app_answered` now follows `app_request`, and `app_request_cancelled` no longer appears. Through OAR these requests should be rare: with `approvalPolicy: never`, Codex declines MCP elicitations itself. Validation: - A native vendor case on Codex 0.163.0 drives the app-server under `approvalPolicy: "untrusted"`: the declined command does not run and the turn completes. This is the only reply with native evidence; the others come from the 0.163.0 schema and unit tests. - Unit cases cover each reply, an unknown method, codex's numeric id being returned with its own type, and the record order. - `CI=1 pnpm run check` passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Cindy <[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
classifyTool("codex", "fileChange", input)returned{ kind: "edit_file" }with no file. AfileChangeitem's input is itschangesarray, and the detail extractor only reads JSON objects. So a host listing the files an agent read or wrote (Ferry D072's fresh-conversation opening) saw codex edits but never their files.Closes #166.
Shape (as decided in #166)
ToolActiongainspaths?: readonly string[]:read_fileandedit_file. Absent when the input names none.fileChange: each change'spath. A rename's target (kind.move_path) comes right after its source.Read/Edit/Write, and the pi, opencode and cursor read/write tools: the one pathdetailalready read, so hosts readpathswith no per-runtime logic.NotebookEdit(review): itsnotebook_path. The olddetailnever read that key, sodetailis now that path too.lsareread_file, so theirpathsentry is the listed directory. Whether to list it is up to the host (said in the doc comment).detailis the first ofpaths. No "(+N more)" text.kindstaysedit_filefor the whole call, even when onefileChangeadds, updates and deletes.The recording
tests/replay/fixtures/codex-file-change.raw.jsonl: real codex 0.160.1 against the scripted provider (codex-aimock, no login, no tokens). Recorded with a new recorder mode:It runs in a scratch directory seeded with
notes.txt,gone.txtandold-name.txt. The model sends one patch: updatenotes.txt, addadded.txt, deletegone.txt, updateold-name.txtand move it tonew-name.txt. The scratch path is replaced with<cwd>in the fixture. The recordedchanges:[ {"path":"<cwd>/added.txt","kind":{"type":"add"},"diff":"fresh line\n"}, {"path":"<cwd>/gone.txt","kind":{"type":"delete"},"diff":"deleted\n"}, {"path":"<cwd>/notes.txt","kind":{"type":"update","move_path":null},"diff":"@@ -1 +1 @@\n-old note\n+new note\n"}, {"path":"<cwd>/old-name.txt","kind":{"type":"update","move_path":"<cwd>/new-name.txt"},"diff":"@@ -1 +1 @@\n-moved before\n+moved after\n\n\nMoved to: <cwd>/new-name.txt"} ]What the recording shows:
move_pathis snake case. It isnullon an update that doesn't rename, and add/delete don't have the key.pathskeeps codex's order.item/startedanditem/completedcarry the samechanges.So
classifyToolgives{ kind: "edit_file", detail: "<cwd>/added.txt", paths: [added, gone, notes, old-name, new-name] }.How the mock got a
fileChangeout of codex: aimock'sgpt-5.1has no model metadata in codex, so codex offers noapply_patchtool. A direct function call is answeredunsupported call: apply_patch, and aimock can't send the freeform custom tool call codex's ownapply_patchuses. Instead the model sendsapply_patch <<'EOF' … EOFthroughexec_command. codex intercepts that, applies it, and reports it as afileChangeitem (nocommandExecution). The files on disk ended up changed as the patch says.Tests
tests/replay/tool-activity.test.ts: the recorded call'skind/detail/paths(inline snapshot), and the codex file-change activity snapshot.toolCallsFromCodexnow takes its input fromcodexItemInput, as the projection does. opencode's recordedread/write/editnow showpathsequal to theirdetail.tests/replay/codex-projection.test.ts: the new fixture folds (codex-file-change.projected.txt).tests/tool-activity.test.ts: for each runtime with read/write tools (claude, pi, cursor, opencode),pathsis[detail]withdetailunchanged, using each vendor's input shape. claudeNotebookEditgives itsnotebook_pathaspathsanddetail.pathsis absent with no input,{}, an emptychangesarray, aNotebookEditinput withoutnotebook_path, and on non-file kinds. A rename onto a path the same patch deletes is listed once.pnpm run checkandCI=1 pnpm run checkare green (712 passed / 32 skipped, mock sea-trial 19/19).pnpm run buildpasses.Docs
tool-activity.ts: thepathsanddetaildoc comments, plus the recordedfileChangeshape next to its reader.docs/runtimes/codex.md: the recordedfileChangeshape (and that a heredocapply_patcharrives as one) and howclassifyToolreads it.docs/runtimes/opencode.md: one line onpaths.sea-trial/record.ts: thecodex-aimockmode.Compatibility
Additive: one new optional field. A codex
fileChangeand a claudeNotebookEditnow have adetail(their first path), sooar runprints[Editing file] <path>for them. No version bump.🤖 Generated with Claude Code