Headless runs no longer look finished while background tasks or undelivered notifications remain.
What's wrong with this entry?
In print/headless mode, the check that decides a session has gone idle previously only looked for no active turn and nothing in flight. It now also requires no live background tasks, no active team context, and no pending task notification, so a headless run with background work or an undelivered task notification no longer looks finished.
- Idle is computed from the current task list plus outstanding waits and the current time, and reported under the existing
cli_idle_gate_report_idleevent. - Extra diagnostics on this path are only emitted when the environment variable
CLAUDE_CODE_BG_TASKS_REPORT_RUNNINGis set. - The plugin and agent registry refresh function now takes an options bag that it forwards to the agent-definition loader.
cli_idle_gate_report_idle
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
Related
Other releases about the same thing. Found by shared names or similar wording; neither means one caused the other.
-
v2.1.219
Headless text output recovers the last full assistant message on an incomplete run
Both mention headless mode
-
v2.1.227
Headless mode reports fatal errors instead of dying quietly
Both mention headless mode
-
v2.1.248
Headless loop guards against missing stream event fields
Both mention headless mode