fix(app): stop using orphaned assistant messages for working state#23087
Open
richard-fairthorne wants to merge 1 commit intoanomalyco:devfrom
Open
fix(app): stop using orphaned assistant messages for working state#23087richard-fairthorne wants to merge 1 commit intoanomalyco:devfrom
richard-fairthorne wants to merge 1 commit intoanomalyco:devfrom
Conversation
After a server restart or interrupted stream, assistant messages can be left without time.completed. The animation and session list icon were checking for these incomplete messages to determine if a session was still working, causing them to show a permanent spinner even when the session was idle. Now all three working-state checks rely solely on session_status from the backend, which is always correct after a fresh start. Fixes anomalyco#17680, anomalyco#18828, anomalyco#21840, anomalyco#21939
Author
|
Idle means idle. Orphans are something else. The user relies on these indicators to determine whether they need to interact with opencode. If they are orphan detectors, they are not doing what they appear to do. Orphan detection can be added separately, if useful. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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.
Issue for this PR
Closes #17680, #18828, #21840, #21939
Type of change
What does this PR do?
The chat progress bar animation, session sidebar spinner, and followup dock all treated incomplete assistant messages (no
time.completed) as evidence the session was still working. If the server restarted or a stream was interrupted mid-response, those orphaned messages caused permanent spinners even thoughsession_statuswas correctly"idle".The send button did not have this bug because it only checked
session_status. Now all three locations use the same source of truth —session_statusfrom the backend — which is always correct after a fresh start.Changes:
message-timeline.tsx—workingmemo checks onlysessionStatus().type !== "idle"sidebar-items.tsx—isWorkingmemo checks onlysession_statustypesession.tsx—busy()helper simplified to only checksession_statusHow did you verify your code works?
time.completedbun typecheckpasses inpackages/appChecklist