fix: restore coarse running busy signal (#2023)

This commit is contained in:
Carlos Florêncio
2026-07-29 08:11:51 +01:00
committed by GitHub
parent 5fb7575e60
commit e8d4b7d69e
43 changed files with 1426 additions and 942 deletions
+14 -8
View File
@@ -702,14 +702,20 @@ system.job.update
Current lifecycle code broadcasts `session.turn.started` and `session.turn.completed` globally even though their payloads identify a session. `task.subscribe` does not change this global routing.
`session.activity_changed` carries `task_id`, `session_id`, `foreground_activity`,
and `active_subagent_count`. The activity is `generating`, `background`, or
`null`; the count is always an integer and is zero when no adapter-attested
subagent is live for that session. Task lifecycle notifications expose the same count
aggregated across
the task's sessions as `active_subagent_count`. Count-only changes may emit
`session.activity_changed` and `task.updated` even when the foreground activity
and coarse lifecycle state do not change.
`session.activity_changed` carries `task_id`, `session_id`,
`foreground_activity`, and `active_subagent_count`. The activity is
`generating` while the session is `RUNNING` and otherwise clears with the
coarse lifecycle by default; background-work accounting does not expose a
separate activity tier. When
`KANDEV_FEATURES_CLAUDE_BACKGROUND_PROMPT_HANDOFF=true`, a persisted Claude
Code session may instead expose `background` while its foreground has yielded
and adapter-attested async subagent, background shell, or Monitor work remains
active. Other providers remain coarse. The count is always an integer and is
zero when no adapter-attested subagent is live for that session. Task lifecycle
notifications expose the same count aggregated across the task's sessions as
`active_subagent_count`. Count-only changes may emit
`session.activity_changed` and `task.updated` even when the coarse lifecycle
state does not change.
Office workspace notifications are also global; clients filter on `workspace_id`: