Repository navigation
Fix runs stuck on Starting that Stop could not end - #255
Merged
Merged
Conversation
A run whose end was announced while its chat changed computers kept showing as Starting in the app forever, and Stop did nothing because the server already counted it as cancelled. The desktop app now asks for runs that look busy for over two minutes but are not among the working ones, and both apps re-read a run after Stop and drop it when it is over.
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.
Problem
A chat on the second Mac showed a run as "Starting…" for over 12 hours, and pressing Stop only showed "Stopping the agent…" without anything happening.
Cause: on 10-27 21:24 the second Mac woke from sleep and started a follow-up in a chat the primary had just taken over. 30 s later it handed the chat back and cancelled the run, but its
run.finishedevent was dropped because the chat had changed computers in between. Both databases had the run ascancelled, while the app's live store still held it as running. Stop went to the runner, which saw an already-ended run and returnedoksilently, so the UI never heard of the end.Fix
GET /api/runs/:id); one that is over is dropped as ifrun.finishedhad arrived.api.runs.canceldoes the same, so every Stop button in the phone app clears such a run.No server change: re-emitting
run.finishedon the server would trigger follow-ups, heartbeats, tickets and notices a second time, and for runner chats the cancel is forwarded to the runner anyway.Checks
tscclean for desktop and mobile.run_cQuD9PYRN4o3Spcyiscancelledon both Macs, which this sweep would drop.