Repository navigation
Conversation
Treat empty write provenance as no displayed lines so anchored edits reveal content before applying. Updated the write-to-edit contract test and kept unanchored appends working. Fixes #15666
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Repro
A write of
alpha\nbeta\ngammareturns[seen-probe.txt#B6C1]; without reading,PUT 2.=2:with+BETAagainst that tag used to apply and changebetatoBETAinstead of revealing line 2. Runcd packages/coding-agent && bun test test/write-hashline-header.test.ts: the new contract case fails against the unfixed addon.Cause
maybeWriteSnapshotHeaderinpackages/coding-agent/src/tools/write-content.tsrecords the write tag with an empty seen-line set;assert_seen_linesincrates/pi-edit/src/modes/hashline/patcher.rsreturned early for that set, conflating no lines seen with no provenance known.Fix
Some(empty)as nothing seen inassert_seen_lines, preserving theNoneearly return and the inline reveal/retry path.packages/coding-agent/test/write-hashline-header.test.tsto assert rejection, unchanged file, and success after the reveal; retain an unanchored append through alocal://write tag.Verification
bun test test/sdk-file-write-fallback-extension.test.ts test/write-hashline-header.test.tspassed (13/13) with the rebuilt native addon; the four affected edit suites passed (20/20), and a manual write-tag edit returnednever displayedwith2:betarevealed and the file unchanged. The contract test failed against the old addon (1 failure). Skipped pre-publish gates (bun run fix,bun check,bun run test) because the same check and full-suite commands fail on a cleanorigin/mainarchive:bun checkfails compilingzstd-sysin the shared Rust cache withOperation not permitted;bun run testfails atpackages/utils/test/dirs-xdg.test.ts:82withEACCEScreating/srv/agent-home/.omp-dirs-xdg-*. The worktree exhibits the same failures; the diff-related write-to-edit test failure from the first gate run was corrected and its focused suite passed.Fixes #15666