Skip to content

fix(companion): ignore a trailing busy for a finished background job - #1472

Merged
alvinunreal merged 1 commit into
alvinunreal:masterfrom
drakeo338:claude/1470-fix
Oct 7, 2026
Merged

alvinunreal merged 1 commit into
alvinunreal:masterfrom
drakeo338:claude/1470-fix

Conversation

@drakeo338

Copy link
Copy Markdown
Contributor

Fixes #1470.

A child session can report busy after its background job already finished, with no idle event after it. The companion then kept the specialist on screen indefinitely. onSessionStatus now takes a jobFinished flag, set from the background job board, and skips registering busy in that case. Added a test that fails on the unfixed source and passes with the change (61 passed, 0 failed in the companion tests).

A child session can report busy after its background job already
completed, with no idle event to follow. The companion then kept the
specialist on screen indefinitely. Pass whether the job board has
settled the session's job and skip the busy registration in that case.

Fixes alvinunreal#1470
@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes how the companion manager handles background job status.

The PR appears safe to merge; no actionable issues were found.

What we checked:

  • Finished children clear from view: The v2 adapter sends an idle session.status for completed, failed, and interrupted runs. onSessionStatus removes that child from the active list.

Summary

Prevents a finished background child from reappearing in the companion after a trailing busy event.

  • src/index.ts passes the job’s current state to onSessionStatus.
  • CompanionManager ignores specialist busy updates when jobFinished is true.
  • The new test covers busy → idle → trailing busy for a finished child.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Session status event] --> B[Read background job state]
  B --> C[Companion receives status and jobFinished]
  C --> D{Specialist busy and job finished?}
  D -->|Yes| E[Keep current display]
  D -->|No| F[Apply normal status update]
Loading

Reviews (1) · Last reviewed commit: "fix(companion): ignore a trailing busy f..." · Reviewed by Greptile

@alvinunreal
alvinunreal merged commit 96afff2 into alvinunreal:master Oct 7, 2026
5 checks passed
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.

Companion keeps stale agent tiles after background agents finish (trailing busy after idle prevents clear)

2 participants