Skip to content

fix(app + tui): clear stale running session indicators#17593

Open
nexxeln wants to merge 5 commits intodevfrom
fix/stale-running-session-ui
Open

fix(app + tui): clear stale running session indicators#17593
nexxeln wants to merge 5 commits intodevfrom
fix/stale-running-session-ui

Conversation

@nexxeln
Copy link
Copy Markdown
Member

@nexxeln nexxeln commented Mar 15, 2026

problem

  • desktop could stay active from two paths: stale bootstrap session status entries and old incomplete assistant messages in history
  • tui could also keep later messages queued from an old incomplete assistant

fix

  • bootstrap now reconciles session status so stale busy entries are cleared
  • desktop now uses live session status for running state and only uses the trailing assistant to pick the active turn
  • backend now finalizes assistant messages when prompt setup fails

tui and desktop

testing

  • bun test src/context/global-sync/session-cache.test.ts src/context/global-sync/event-reducer.test.ts
  • bun typecheck

Use live session status for the running UI and finalize assistant messages when prompt setup fails so crashed runs do not leave sessions stuck as active.
@nexxeln nexxeln requested a review from adamdotdevin as a code owner March 15, 2026 12:10
Inline the app-side running checks and make the tui only treat the trailing assistant as pending so old crashed messages do not keep sessions active or queued.
@nexxeln nexxeln changed the title fix(app): clear stale running session indicators fix(app + tui): clear stale running session indicators Mar 15, 2026
Comment on lines 141 to +144
const pending = createMemo(() => {
return messages().findLast((x) => x.role === "assistant" && !x.time.completed)?.id
const last = messages().findLast((x) => x.role === "assistant")
if (!last || last.time.completed) return
return last.id
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can u explain this?

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.

3 participants