Skip to content

v0.8.68: define parent-stop semantics for detached background agents #4359

Description

@Hmbown

Problem

Foreground child agents inherit parent cancellation, while detached background agents intentionally outlive the foreground turn. The user-facing contract for Esc/stop is therefore ambiguous: continue, cancel all, or ask. That ambiguity can make a successful detach look like a cancellation leak, or leave work running contrary to user intent.

Decision required

Define one explicit parent-stop policy for detached background agents:

  1. Continue detached work and clearly report that it remains active.
  2. Cascade cancellation to every child.
  3. Prompt when detached children exist, offering stop-parent-only versus stop-all.

Whichever policy is selected must be reflected consistently in the TUI, stream receipts, child status, and session restoration.

Likely files

  • crates/tui/src/tools/subagent/mod.rs
  • engine turn/cancellation handle modules
  • TUI stop-confirm and child-status presentation
  • exec-stream receipt/event modules

Acceptance criteria

  • The chosen policy is documented in user-facing help and runtime documentation.
  • Esc/stop reports which background agents continued or were canceled.
  • Canceled children have a typed canceled outcome, not a generic failure.
  • Races between natural completion and cancellation produce one terminal outcome.
  • Tests cover foreground children, detached children, multiple parallel children, and repeated stop requests.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyBody is self-sufficient per docs/AGENT_RUNNER.md; a remote agent may claim itbugSomething isn't workingdocumentationImprovements or additions to documentationenhancementNew feature or requestquestionFurther information is requestedreliabilityReliability, flaky behavior, retries, fallbacks, and robustnesssubagentsSub-agent orchestration, lifecycle, and completion handlingtuiTerminal UI behavior, rendering, or interactionv0.8.68Targeting v0.8.68

    Projects

    Status
    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions