Skip to content

fix(macapp): clear stale interactive affordances when external run ownership changes #1122

Description

@dennisonbertram

Problem

Independent review of #1118 found a P1 state-ownership bug: after interactive run A is selected and exposes approval/plan/input UI, timestamp-newer external run B can become currentRunID while A pending UI remains rendered. Chat actions then target B through currentRunID, so a user response intended for A may POST to B.

Acceptance criteria

  • On external/local run ownership change, terminal retirement, and fallback selection, atomically clear or exact-run-own pending questions, approval, and plan state so no stale A affordance can act on B.
  • Add deterministic Swift regressions: A interactive -> B selected -> no A UI/action; attempting stale action causes no B endpoint request; terminal/fallback has no stale input/approval/plan.
  • Preserve fix(macapp): acknowledge run-control failures and preserve pending user input #994 single-flight/retry ownership, accounting, scheduled external-run visibility, conversation fences, and unrelated local streams.
  • Sol medium diagnosis, independent cheap re-review, strict/full Swift, repository regression, and hosted checks.

Scope

Native RunSession/Transcript/Chat UI state ownership only; no callback production changes. This blocks #1118 promotion.

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