Summary
When the agent runs a background command (run_in_background), the completion notification — the system-injected <task-notification> for "Background command '…' completed (exit code N)" — is recognized as if the user had typed it. In the Worklist Chat pane it renders as a "You" turn and appears to drive the agent's next turn.
Evidence
The Chat pane shows, in the user position:
Background command "Run the two new List follow tests" completed (exit code 0)
immediately followed by the agent's tool use (Bash tail -25 …) and response — i.e. the system notification was treated as the user's input for that turn.
This also plausibly accounts for stray single-character "user" inputs (lone 1 / 2) observed mid-session while background commands were running.
Expected
Background-command completion notifications are system/automated events, not user input. They should not be attributed to the user ("You" block) or treated as a user turn.
Where to look
The notification reaches the agent via stdin and is recorded in the session JSONL; the conversation-state reader (/__conversation-state, build_conversation_cache_entry in src-tauri/src/lib.rs) appears to pick it up as a user-role turn. The fix likely filters these notification messages out of user-turn detection (and the Chat "You" rendering).
Intermittent / not urgent; filing for later.
Summary
When the agent runs a background command (
run_in_background), the completion notification — the system-injected<task-notification>for "Background command '…' completed (exit code N)" — is recognized as if the user had typed it. In the Worklist Chat pane it renders as a "You" turn and appears to drive the agent's next turn.Evidence
The Chat pane shows, in the user position:
immediately followed by the agent's tool use (
Bash tail -25 …) and response — i.e. the system notification was treated as the user's input for that turn.This also plausibly accounts for stray single-character "user" inputs (lone
1/2) observed mid-session while background commands were running.Expected
Background-command completion notifications are system/automated events, not user input. They should not be attributed to the user ("You" block) or treated as a user turn.
Where to look
The notification reaches the agent via stdin and is recorded in the session JSONL; the conversation-state reader (
/__conversation-state,build_conversation_cache_entryinsrc-tauri/src/lib.rs) appears to pick it up as a user-role turn. The fix likely filters these notification messages out of user-turn detection (and the Chat "You" rendering).Intermittent / not urgent; filing for later.