Repository navigation
Name an OpenCode or notebook read by its file in a handoff - #75
Merged
Merged
Conversation
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.
A handoff names what a tool call was for with
gist, from a list of input keys. That list hadfile_pathandpathbut notfilePathornotebook_path, whichfiles()in the same file already reads. So an OpenCoderead({"filePath": ...}) or a Claude CodeNotebookRead({"notebook_path": ...}) showed its input as JSON instead of its file:gistandfiles()now take their path keys from one list,PATHS, so they can't drift apart again.gisttries them where it triedfile_pathandpathbefore, so a call that has one of those is named as it was.Since
same()falls back togistfor a call that runs no commands, a failed OpenCodeeditorwrite, or Claude CodeNotebookEdit, now counts as run again once a later one of the same file passes, and no longer shows under "What failed". A failed Claude CodeEditalready 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_pathhands off a session ending in an OpenCodereadand one ending in aNotebookRead. On origin/main it fails:and with only the
NotebookReadcase, 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
readoredit, or aNotebookRead:#115 tool `read` · 11:19: "/work/app/src/db.rs"), and each failed OpenCodeeditunder "What failed" too (#71 tool `edit` (failed) · 10:19: "src/ingest.rs", where its input as JSON was cut at 120 characters).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 --lockedandRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --lockedall pass. Not run: the Swift tests, shellcheck, actionlint and cargo deny, since nothing they cover changed.