Skip to content

Name an OpenCode or notebook read by its file in a handoff - #75

Merged
joeychilson merged 3 commits into
mainfrom
handoff-read-path
Oct 19, 2026
Merged

joeychilson merged 3 commits into
mainfrom
handoff-read-path

Conversation

@joeychilson

Copy link
Copy Markdown
Owner

A handoff names what a tool call was for with gist, from a list of input keys. That list had file_path and path but not filePath or notebook_path, which files() in the same file already reads. So an OpenCode read ({"filePath": ...}) or a Claude Code NotebookRead ({"notebook_path": ...}) showed its input as JSON instead of its file:

#2 tool `read`: "{\"filePath\":\"src/csv.rs\"}"

gist and files() now take their path keys from one list, PATHS, so they can't drift apart again. gist tries them where it tried file_path and path before, so a call that has one of those is named as it was.

Since same() falls back to gist for a call that runs no commands, a failed OpenCode edit or write, or Claude Code NotebookEdit, now counts as run again once a later one of the same file passes, and no longer shows under "What failed". A failed Claude Code Edit already worked that way, and docs/handoff.md already says a call is run again when it's "for the same thing", its path. While it does show there, it's named by its file too.

The new test sessions::handoff::tests::a_read_is_named_by_its_path hands off a session ending in an OpenCode read and one ending in a NotebookRead. On origin/main it fails:

thread 'sessions::handoff::tests::a_read_is_named_by_its_path' panicked at src/sessions/handoff.rs:1142:13:
#2 tool `read`: "src/csv.rs" is missing:
...
#2 tool `read`: "{\"filePath\":\"src/csv.rs\"}"

and with only the NotebookRead case, the same with "{\"notebook_path\":\"src/csv.rs\"}". It passes with the fix.

Handoff cases: there are no real ones on this machine, and I didn't make any from real sessions. I handed off 76 made-up cases at budgets of 150, 500, 1,200, 3,000 and 16,000 tokens, with origin/main and with this branch: the six fixture sessions, 40 random Claude Code sessions, and 30 random sessions, ten each in Claude Code's, OpenCode's and Codex's own tool shapes. 26 of the 380 handoffs changed, all in sessions with an OpenCode read or edit, or a NotebookRead:

  • Each such read is named by its file (#115 tool `read` · 11:19: "/work/app/src/db.rs"), and each failed OpenCode edit under "What failed" too (#71 tool `edit` (failed) · 10:19: "src/ingest.rs", where its input as JSON was cut at 120 characters).
  • The shorter lines leave room for more in three handoffs: one now has room for a story, of one entry; one's story starts an entry earlier, with "Read more" moved to match; and one's "Where it stopped" now fits the session's last entry, a read, and says that Share the agent readers' repeated code, and simplify Claude Code and Pi #35 to Simplify sessions, the handoff and redaction tests #39 are left out for room.

No snapshot changed: no fixture session has such a read.

Checked: cargo fmt --check, cargo clippy --all-targets --locked -- -D warnings, cargo test --locked, TZ=America/Chicago cargo test --locked and RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --locked all pass. Not run: the Swift tests, shellcheck, actionlint and cargo deny, since nothing they cover changed.

@joeychilson
joeychilson merged commit 936144d into main Oct 19, 2026
3 checks passed
@joeychilson
joeychilson deleted the handoff-read-path branch October 19, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant