Skip to content

fix(desktop): bind Side Conversation events to Host admission - #3716

Draft
Astro-Han wants to merge 14 commits into
apache:mainfrom
Astro-Han:fix/side-conversation-event-ownership
Draft

fix(desktop): bind Side Conversation events to Host admission#3716
Astro-Han wants to merge 14 commits into
apache:mainfrom
Astro-Han:fix/side-conversation-event-ownership

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Give every Side Conversation send/steer one admission ticket; Runtime Host remains the sole authority that accepts or retracts it and names the exact owning Turn.
  • Bind direct starts from the Host command result. For queued/current-Turn and successor-Turn admission, consume only Host-owned queue/root projection facts; the renderer never lets an unrelated terminal event infer ownership.
  • Buffer pre-admission events until Host resolves the exact ticket. A late terminal event from the old Turn cannot claim the new send, while successor events that arrive before the command response are replayed.
  • Preserve unresolved admission across recoverable subscription failure and Host epoch replacement. outcome_unknown means “still unknown”, not rejection or permission to mint another ticket.
  • Scope retry, unknown-outcome, and Stop fencing to Side Conversation only. Ordinary Desktop sends retain their prior one-call, independent-message-id, and error-propagation contract.

No durable message schema, settlement/recovery policy, CLI projection, or Desktop primary-conversation projection is changed.

Behavior evidence

The production-shaped React hook + Workbar seam covers:

  • old Turn settled, new send waiting for Host admission, then a late old terminal event;
  • successor admission and text arriving before the command response and replaying onto only that Turn;
  • Host admission preceding the empty successor queue snapshot;
  • explicit queue retraction arriving before the command response;
  • recoverable subscription failure and cross-epoch outcome_unknown preserving the original ticket;
  • admission-scoped Stop for direct, queued, in-flight, and successor ownership, including unknown Stop outcome;
  • busy retry identity, fork/copy cleanup, disposal, and observation-seed failure;
  • ordinary sends not entering Side Conversation admission retry semantics;
  • shared CLI/main-conversation event streams remaining unchanged.

Verification

  • npm run build
  • npm --workspace @maka/desktop run typecheck
  • 41 focused Desktop tests passed across Quote Companion, Runtime Host execution IPC, boundary validation, disposal, and Workbar adapter
  • 156 focused Runtime Host protocol/projector/canonical/subscription tests passed
  • 36 Runtime event-mapper tests passed
  • 85 focused CLI Runtime Host adapter/driver tests passed
  • Biome changed-file formatting and git diff --check passed

Exact-head CI: pending for f51928a5bc7201870885e6c5a1bc6475e9cfc8e5.

AI use

Codex contributed the implementation, regression tests, verification, and adversarial/simplification review. No commit from Draft PR #3633 was cherry-picked or copied; its old branch/review was used only as failure evidence.

@Astro-Han
Astro-Han force-pushed the fix/side-conversation-event-ownership branch from f32cbb5 to b3194c4 Compare August 24, 2026 19:20
@Astro-Han
Astro-Han force-pushed the fix/side-conversation-event-ownership branch from 41aa14c to f51928a Compare August 24, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant