Repository navigation
Conversation
codiff -w --walkthrough-file exited 0 even when the app could not apply the walkthrough, and the app silently dropped any stop with an unresolved hunk id. The app now checks a CLI launch's walkthrough file against the diff before opening a window, opens nothing when it cannot be applied, and reports the outcome through a result file that both launchers wait on. --share runs the same check, and the skill and guide describe the new behavior.
The packaged launcher read the JSON result with plutil, which only exists on macOS, so the reason was lost on Linux CI. A status line followed by the reason needs only head and tail.
The app checks the walkthrough file at launch whether or not -w is set, so the launchers wait whenever a walkthrough file is given.
matchai
force-pushed
the
walkthrough-file-single-read
branch
from
October 26, 2026 03:16
d3deb73 to
ff8d947
Compare
codiff-app runs with set -e, so reading the result file before the app wrote it ended the launcher with exit 1 and no message. Check that the file has content first, as the plan loop does, and test a result that arrives after the launcher starts waiting.
The window's first walkthrough load reuses the repository state the launch check read instead of reading the diff again, and window identity resolves while that read runs. createWindow now returns its window so the launch can record it.
It saved about 20 ms at the cost of an extra focusOrCreateWindow parameter; this PR is only about reusing the checked state.
matchai
force-pushed
the
walkthrough-file-single-read
branch
from
October 26, 2026 04:39
ff8d947 to
f3a9ad8
Compare
…le-read # Conflicts: # electron/main.cjs
matchai
marked this pull request as ready for review
October 26, 2026 05:12
The map only holds state from a launch check that passed, so it stores the resolved state. The first walkthrough load never forces and always asks for the source the window was opened with, so the force and source guards are dropped.
Member
|
Your other PR fixed this, too. |
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 walkthrough-file launch reads the repository diff twice: once for the launch check (#187) and again when the window loads the walkthrough. The window's first walkthrough load now reuses the state the check already read, so the diff is read once.
The state is dropped after one use and when the window closes, so later loads, including forced reloads, read the diff as before. The first load needs no force or source check: the renderer never forces it and always asks for the source the window opened with.
createWindownow returns its window so the launch can record it.Timings
5 cold launches of
codiff -w --walkthrough-file <valid file>per version, alternating betweenmain(da35d91) and this PR (442e51f) so both ran under the same load. The later simplification (c899c9b) only removes guards that never fired, so the read pattern is unchanged. Times are medians from the command's start, traced in Electron's main process on dev builds.mainThe walkthrough now loads about 0.4 s sooner, about 35% faster. The rest of startup is unchanged within run-to-run noise. The first
mainrun was a 5.7 s cold-cache outlier, which the median absorbs.Merge danger: two-way door, walkthrough-file launches only. The first walkthrough load trusts that it asks for the launch's source; a future caller that first loads a different source would get the launch's diff.
This PR was written primarily with fx, a coding agent. I reviewed the change; the agent traced the launch, wrote the change, and measured it against
main.banana banana banana