Repository navigation
Empty the -o file when every preloaded annotation is deleted - #422
Merged
Merged
Conversation
compactApplicable returns false whenever --stdin is set, but README, docs.html and the plugin usage reference listed compact mode among the features of a piped multi-file diff. The backlog item is cut down to the remaining half, the codex usage.md resync.
loading notes with --annotations, deleting all of them and quitting with q left the -o file untouched, because finalize skipped every exit with no annotations. The next load from that file brought the deleted notes back. A graceful exit now writes the empty result when annotations were preloaded and none remain. A Q discard and a signal exit still leave the file as it was, and a review that never had notes writes nothing, as before. README, docs.html and both usage references describe it. the PTY test harness sends keys one at a time, since a burst arrives as a single multi-rune key, and takes an -o path so the round trip runs through the real TUI.
the finalize doc comment opened with "no annotations writes nothing" and then contradicted it, and implied the -o file is always the --annotations source. The signal-safe save entry in gotchas.md still said empty output writes nothing, which invites restoring the old skip.
umputun
added a commit
that referenced
this pull request
Nov 12, 2026
* fix: empty the -o file when every flushed annotation is deleted after an O flush wrote the -o file, deleting every annotation (or dropping them with R) and quitting with q left the flushed snapshot in place. The plugin launchers read that file on exit and handed the deleted notes to the agent. A graceful quit now writes the empty output when an O flush wrote the file in this session, the same rule #422 applies to preloaded notes. Q and signal exits still leave the file as it was. README, docs.html, both usage references and the gotchas entry describe it. * fix: clear a stale -o file when the reload before quit failed finalize returned the file-list load error before reaching the empty-output write, so an O flush (or --annotations preload), then an R reload that failed, then q left the old notes in the -o file. The launchers cat that file on any exit code, so the caller still got the deleted notes next to the error. The load-error path now clears the file first under the same rule, graceful exit with preloaded or flushed notes, and still returns the load error.
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.
loading notes with
--annotations, deleting all of them and quitting withqleft the-ofile untouched, becausefinalizeskipped every exit with no annotations. The next load from that file brought the deleted notes back.a graceful exit now writes the empty result when
--annotationsactually loaded at least one note and none remain. AQdiscard, a signal exit and a review that never had notes keep the old behavior and leave the file alone. README, docs.html, both usage references and the gotchas entry describe it.the PTY test harness sends keys one at a time, since a burst arrives as a single multi-rune key, and takes an
-opath so the round trip runs through the real TUI. The new e2e test fails without therun()wiring.also drops "compact mode" from the
--stdinmulti-file diff description:compactApplicablereturns false whenever--stdinis set. The backlog item that tracked it is cut down to the remaining codex usage.md resync.