Skip to content

Background-command completion notifications are recognized as user input in the Chat pane #201

Description

@judell

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions