Skip to content

Isolate stale failed-agent state between CodeWhale sessions in the same workspace #4416

Description

@Hmbown

Observed behavior

Opening a second CodeWhale instance in the same workspace shows Active 0 · Tasks 0 · Runs 0 · Workers 0, but the work surface immediately renders several red failed-agent rows from a different, earlier session. The visible rows are stale task prompts rather than live work owned by the new instance.

This makes an idle fresh session look broken and makes it unclear whether the rows are actionable, historical, or shared with another running process.

Acceptance criteria

  • Give each task/run/worker a durable session/instance ownership identity in addition to workspace identity.
  • Default a new TUI session to its own live work; do not render terminal failures from another session as active workspace work.
  • Preserve shared-history visibility behind an explicit historical/other-session filter, with source session, terminal status, and timestamp.
  • Reconcile stale persisted non-terminal records on startup without turning an empty work surface into a red error list.
  • If same-workspace sharing is intentional, label it clearly and make open/retry/dismiss actions safe for the owning session only.
  • Add multi-process/same-workspace tests for a new session after a failed child run, an active sibling session, and restart recovery.
  • Cross-link with Fix orphaned model-wait subagents so Stop unblocks the awaiting parent #4408 and Detect and break non-progressing turn loops with an explicit recovery path #4414, but keep cross-session visibility/ownership separate from child terminal reconciliation and no-progress detection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreliabilityReliability, flaky behavior, retries, fallbacks, and robustnesstuiTerminal UI behavior, rendering, or interactionuxUser experience, interaction, or presentation polishv0.9.4Targeting v0.9.4

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions