Skip to content

Drop a stranded background-tasks chip after keepalive - #511

Open
Adam-Dalloul wants to merge 2 commits into
xintaofei:mainfrom
Adam-Dalloul:fix/stale-background-tasks-chip
Open

Drop a stranded background-tasks chip after keepalive#511
Adam-Dalloul wants to merge 2 commits into
xintaofei:mainfrom
Adam-Dalloul:fix/stale-background-tasks-chip

Conversation

@Adam-Dalloul

@Adam-Dalloul Adam-Dalloul commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

The sky bar should leave the moment the work is actually done. Same rule for every agent that can raise it.

What raises the bar today: Claude background shells / async sub-agents, and Grok background commands (task_backgrounded) plus background spawn_subagent kids. Codex, Cursor, Gemini, and OpenCode never raise it.

What now drops it immediately:

  • Claude: BashOutput with an exit code, TaskOutput terminal / success, TaskStop / KillShell, or a task-notification
  • Grok: task_completed (the process exited) or subagent_finished

The one-hour keepalive is only the last resort if a done signal never arrives. A snapshot will not bring a dead count back on reconnect.

The sky bar is driven by background_outstanding. Claude's watcher
expires un-settled tasks after an hour and emits 0; Grok never does,
and a snapshot can hydrate a count whose heartbeat is already dead.
The open tab then shows "N background tasks running" forever.

Honor the same keepalive window on the chip and the idle sweep, omit a
lapsed count from the snapshot, and treat TaskOutput status=success as
terminal.
Claude: a later BashOutput with exitCode/exit_code (or interrupted)
settles the shell immediately. Grok: honor task_backgrounded /
task_completed so run_terminal_command background leaves the bar
when the process exits. Same automatic count for every source that
can raise it. The one-hour keepalive stays only as a last resort.
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.

1 participant