Skip to content

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

Draft
Astro-Han wants to merge 19 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 19 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 or 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; unrelated terminal events never infer ownership.
  • Buffer pre-admission events until Host resolves the exact ticket, including events arriving while Stop outcome is unknown.
  • Preserve unresolved admission across recoverable subscription failure and Host replacement; replacement events follow the current validated Host target epoch.
  • Scope admission projection, retry, unknown-outcome, and Stop fencing to canonically labelled Side Conversation Sessions. Ordinary Desktop/CLI streams keep their previous 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 using the actually submitted ticket;
  • recoverable subscription failure and Host replacement preserving the original ticket;
  • admission-scoped Stop for direct, queued, in-flight, and successor ownership, including an admitted event arriving while Stop outcome remains unknown;
  • busy retry identity, fork/copy cleanup, disposal, and observation-seed failure;
  • ordinary sends and shared CLI/main-conversation streams remaining unchanged.

Verification

  • npm run build
  • 77 focused Desktop tests passed across Quote Companion, Runtime Host execution IPC/observer, 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: passed for 364dd1a96adaac3ba1bbaecbdb4da453cbcf11f6 (run 32772641137).

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
Derive admission observation from the Host-owned Session mode and keep ordinary Session streams unchanged. Remove the duplicate renderer send intent and tighten continuity decoding.

Generated-by: Codex
Keep Session event listeners bound to the current validated Host target epoch instead of filtering replacement events through the original host identity.

Generated-by: Codex
Reconcile buffered Host admission events when Stop outcome is unknown and bind successor/retraction fixtures to the actual submitted ticket.

Generated-by: Codex
Follow replacement target epochs within the owning profile while rejecting same-named Session channels from other Hosts.

Generated-by: Codex
Assert that replaying admission and text after an unknown Stop restores the real Host Turn streaming projection.

Generated-by: Codex
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