Skip to content

fix(app): stop using orphaned assistant messages for working state#23087

Open
richard-fairthorne wants to merge 1 commit intoanomalyco:devfrom
richard-fairthorne:fix/stale-session-animations
Open

fix(app): stop using orphaned assistant messages for working state#23087
richard-fairthorne wants to merge 1 commit intoanomalyco:devfrom
richard-fairthorne:fix/stale-session-animations

Conversation

@richard-fairthorne
Copy link
Copy Markdown

@richard-fairthorne richard-fairthorne commented Apr 17, 2026

Issue for this PR

Closes #17680, #18828, #21840, #21939

Type of change

  • Bug fix

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 though session_status was 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_status from the backend — which is always correct after a fresh start.

Changes:

  • message-timeline.tsxworking memo checks only sessionStatus().type !== "idle"
  • sidebar-items.tsxisWorking memo checks only session_status type
  • session.tsxbusy() helper simplified to only check session_status

How did you verify your code works?

  1. Started a session, asked for a long story
  2. Killed the server mid-response, restarted it
  3. Confirmed the assistant message in the DB has no time.completed
  4. Confirmed the progress bar and sidebar spinner now correctly show idle instead of permanently animating
  5. bun typecheck passes in packages/app

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Apr 17, 2026
@richard-fairthorne
Copy link
Copy Markdown
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.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web UI shows permanent Thinking spinner after stream interruption or server restart

1 participant