Skip to content

classifyTool: codex fileChange yields no file path (its input is the changes array) #166

Closed

Description

@xxchan

What happens

classifyTool("codex", "fileChange", input) returns { kind: "edit_file" } with no detail. codexItemInput (codex/item-detail.ts) makes a fileChange item's input JSON.stringify(item.changes), an array, and detailOf only reads a JSON object (asRecord(parseJson(...)) is null for an array), so no path comes out.

Every other runtime's edit tool yields its file path (claude Edit/Write → file_path, pi/opencode/cursor edit/write → path).

Why it matters to a host

Ferry now builds a short opening for a conversation started fresh after a long break (Ferry D072). It lists the files the agent read or wrote, from classifyTool on each call. Codex edits show up as actions but never as files, so a fresh codex conversation doesn't know which files it changed. Any host showing "edited " lines has the same gap for codex.

Suggestion

For codex fileChange, read the changed paths from the changes array (app-server v2 FileUpdateChange has path, plus kind and diff; please confirm against a recording, since tests/replay/fixtures has no fileChange item with changes today):

  • detail: the first changed path (or path (+N more)), consistent with other edit tools;
  • possibly a paths: string[] field on ToolAction for multi-file changes, if you think hosts need all of them.

Found while building Ferry D072 (Raft #proj-ferry, task #57).

Activity

  1. xxchan commented on Oct 7, 2026

    @xxchan
    MemberAuthor

    Shape decided by @cindy (Raft #proj-ferry thread b5bd1066, msg a4c67663):

    Record first. Commit a real codex fileChange as a replay fixture (codex-aimock script: have it apply_patch two files, one of them new; or a real run). The mapping and tests follow the recording. From codex source the shape is changes: [{ path, kind, diff }] with kind: { type: "add" | "delete" | "update", move_path? }; whether move_path is snake or camel case in JSON is whatever the recording says.

    ToolAction gains optional paths?: readonly string[]

    • Every file path the call involves, in the runtime's order, deduplicated. Set only on read_file and edit_file; absent when the input has no path.
    • Uniform across runtimes: claude Edit/Write/Read, and pi, opencode, cursor read/write tools also get paths (the one path detail extracts today), so hosts read paths without per-runtime logic.
    • codex fileChange: each change's path, plus the move target for renames.
    • detail keeps its meaning: the first of paths. No display text like "(+N more)" in detail; how to show it is the host's call.
    • kind is not split per change: one fileChange may add, update and delete; the call stays edit_file.

    Tests: assert codex paths and detail against the recording; for each runtime with read/write tools, one assertion that paths equals the old detail; absent when there's no path. Docs: tool-activity.ts comments and the observe docs. Additive only → minor.

  2. added a commit that references this issue on Oct 7, 2026
    f1a2b88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions