Repository navigation
fix: keep the panel in step with its pi when a connection closes - #28
Merged
Merged
Conversation
…ests in one place
…o ready still saves the session file
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.
An audit of the background, bridge and panel for implicit state turned up several places where what the panel shows could drift from what is really happening. The main one: when a bridge went away mid-run, the chat kept showing "Working…", with a ticking clock and dead queue buttons, until something replayed it. This fixes those, makes a few stages explicit in one place, and simplifies the code around them.
Fixes:
run_endand empties its queue on screen. "Interrupted" stays for the user's Stop, matching how pi's history rebuilds the run. The panel's ownbusyflag is gone: Esc asksChatViewwhether a run is showing.readystill saves the session file, and text handed back right then is held for the next panel instead of lost.schedule_joblist shows a paused job with no next run.Simplifications:
inOrder, so the per-exportawait readylines are gone, and a failed startup fails every request, not just the first.post, so "count everything but replies to pi's tools" holds by construction. Also removes a double stop inswitchTo.src/background/held.ts(hold,handOver,drop).PiClient's port is one connected-or-waiting state. The Scheduled screen has onemode(list, or a job's form), so the job being edited no longer outlives the form.PiInput's queue tracking replaces anull/undefined/images three-way marker with one value.ChatViewtracks only the live run's tool calls.readyupdates the chat before its storage write.src/background/AGENTS.mdnow states that closing a connection must end its run and empty its queue on screen.Left as is, on purpose:
Each behaviour fix has a test that failed first. The startup test was also checked against the unsafe
queue = readyvariant, which it catches. Lint, tests (316, also randomized) and build pass. The plan came from a committee review by Fable and GPT-6.2-Astra. Astra then reviewed the implementation over three rounds; the last found no blockers. Not yet tried in the loaded extension.