Skip to content

Remove orchestration forwarding after in-place clear - #26610

Open
brennanb2025 wants to merge 5 commits into
mainfrom
brennanb2025/nc-clear-orchestration
Open

brennanb2025 wants to merge 5 commits into
mainfrom
brennanb2025/nc-clear-orchestration

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​612 $\color{#cf222e}{\Huge{\mathbf{−}}}$​478 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​134
Prod 37 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​280 $\color{#cf222e}{\Huge{\mathbf{−}}}$​447 $\color{#cf222e}{\Huge{\mathbf{−}}}$​167

ELI5

/clear now keeps one conversation, but orchestration still follows the older replacement-conversation graph. That gives worker ownership, mail and output two competing ways to identify the same chat. This follow-up removes the graph so clearing context keeps the worker address, inbox, task and transcript.

Follows #26579 (merged), which made /clear keep the same conversation.

What Changed

  • Resolve the actual conversation record for worker authority, caller and recipient addresses, dispatch ownership, sender navigation and mail. Delete forward clear walks and reverse record scans.
  • Read and archive the conversation's one retained journal. Delete merged tails, parallel session-ID arrays and reads of other conversations. Preserve output limits, unreadable-output refusals and cursor checks when messages change.
  • Stop the worker’s retained conversation once even when clear finishes first, settle only its dispatches when closed, and forget only its parked mail. Preserve custody, exit proof and cleanup ordering.
  • Update replacement tests to prove repeated same-conversation clears, independent older conversations, restart authority, mail, read cursors, archives and host-boundary refusals.

No database schema, RPC parameter, stream operation, provider launch or UI change. Older-host replacement decoders and client readers stay (from #26579) for independently updated hosts and clients. Ordinary read cursors retain their fingerprints. A cursor previously made from several conversations can return the existing source_changed refusal and must be restarted.

Why

Keeping forwarding beside stable identity preserves the bug class. The actual record and existing worker identity already answer ownership; one journal already contains both sides of clear. Removing the graph follows the common pattern of separating durable conversation identity from the provider's lifecycle.

Differences from the common pattern

  • Intended: previously created replacement conversations keep independent addresses and custody. Historical pointers do not transfer authority. Native chat has no users yet, so no migration or forwarding is needed.
  • Temporary, inherited: merged Keep native chat /clear in the same conversation #26579 keeps older-host replacement readers until the supported-host-floor cleanup. This deletion preserves that wire contract. SSH and WSL work remains unverifiable on a host that cannot execute it; loss of contact never proves exit.

Linked Issue

N/A — maintainer follow-up from a native chat audit.

Visual Proof

Reused the current parent rework's isolated hidden-app check, whose visible clear flow is unchanged by this orchestration deletion. A stand-in provider keeps the same chat tab, session and earlier messages above one divider, then answers in a fresh provider context. All four permitted configuration hashes match before launch, during activation and after teardown; all recorded app and driver processes exited and the isolated profiles were removed.

Before clear:

Same conversation before clear

After clear and the next reply:

Retained conversation after clear

This check did not exercise Run creation, address resolution, mail, worker reads or stops, custody or queues. Tests cover those behaviors; the screenshots do not establish live orchestration addressability.

Testing

  • Isolated hidden-app clear-flow check reused, with the limits above.
  • Automated tests added or updated.

macOS, on final head 42fcbed0795 (the same five commits rebased onto main bb44f74d009, which includes merged #26579): 674 tests passed in all 61 explicit files under the Node runner (one whole-repo scan test timed out at 30 s under machine load in the batch and passed alone, 9/9). Fresh tc:node and tc:cli passed; orca-ci-checks passed 22/22. Both lockfiles restored; worktree clean. No live orchestration, real-provider, SSH, paired-client, phone, Windows or Linux check is claimed.

Review

Rework round 1 found no P0–P2 issues and independently passed 624 tests in 58 files. Its P3 stale clear fixtures are corrected: both now release the old provider chain and proof pointer, with all existing assertions retained. The short final review of c669aee6037 found no P0–P2 and independently passed 625 tests in 58 files; its P3 stale session-ID descriptions are now corrected in the shared address contract and migration comment, with no runtime or assertion change. All five commits remain equivalent after the latest clean rebase onto 5f2c39efb62d, verified with the actual bounded range comparison. The coordinator’s first-hand short review of 28f66bb90cb was clean and confirmed the equivalent commits and comment-only correction. The final rebase onto main changed no commit (range comparison: all five identical), and nothing main added since the last tested parent touches this PR's files or conversation addressing.

Agent skill upstream boundary

  • Not applicable: no upstream skill source is copied or translated.

Notes

A cleared supervised worker retains its task and custody but its fresh provider context loses the old dispatch preamble, as in #26579; this cleanup does not add automatic reinjection. Terminal agents retain their CLI behavior. Folder workspaces use the same record authority without requiring Git.

Checklist

  • Focused on the planned orchestration deletion.
  • Explained the problem, user-facing change, mechanism and choice.
  • Accurate visual proof reused, with its limits disclosed.
  • Self-reviewed for correctness, security and performance.
  • Cross-platform, SSH, folder workspace and mixed-version impact considered.
  • Final-head review complete; CI result in the review-summary comment.

@brennanb2025
brennanb2025 force-pushed the brennanb2025/nc-clear-same-conversation branch from 5c6a2cd to bda2c6d Compare October 8, 2026 18:55
@brennanb2025
brennanb2025 force-pushed the brennanb2025/nc-clear-orchestration branch 4 times, most recently from 28f66bb to 5227dcb Compare October 8, 2026 22:38
@brennanb2025
brennanb2025 force-pushed the brennanb2025/nc-clear-orchestration branch from 5227dcb to 42fcbed Compare October 9, 2026 02:38
@brennanb2025
brennanb2025 changed the base branch from brennanb2025/nc-clear-same-conversation to main October 9, 2026 02:38
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review summary (final head 42fcbed0795).

Problem: after #26579, /clear keeps one conversation, but orchestration still followed the old "replacement conversation" chain. Worker ownership, mail and output reads therefore had two competing ways to find the same chat. This PR deletes that chain, so a cleared worker keeps its address, inbox, task and transcript through the one conversation record.

What changes for users: nothing visible in the chat. Orchestrated workers and coordinators that run /clear keep receiving mail and keep their task. A read cursor that was built across several old replacement conversations can get the existing "source changed" refusal once and must be restarted.

Reviews: rework round 1 and the final review found no blocking issues; their small comment and fixture findings are fixed. Each rebase since then (onto the reworked #26579, then onto its semantic main merge, then onto main after #26579 merged) left all five commits identical by range comparison, and nothing main added since the last tested base touches this PR's files.

Validation on this head: 674 tests in 61 explicit files pass under the Node runner (one whole-repo scan test hit its 30 s timeout under machine load in the batch and passed alone, 9/9); fresh tc:node and tc:cli pass; orca-ci-checks 22/22.

CI: all checks finished on 42fcbed0795: 29 passed, 10 skipped, none failed or pending (run). Skipped jobs (rendered end-to-end, real IME/WSL, persistence, Linux floor builds, desktop template, main-only mobile tests) are path-filtered or main-only and are not claimed as passes.

Not verified live: Run creation, mail, worker reads/stops and custody in a running app, SSH, phone, Windows and Linux. The screenshots in the body are the reused clear-flow check; they do not prove live orchestration addressing.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 9, 2026 03:04
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15d3f76a-b807-47a7-9c43-bbbc492d4003
📥 Commits

Reviewing files that changed from the base of the PR and between 820277c and 42fcbed.

📒 Files selected for processing (49)
  • config/scripts/vitest-sqlite-database-runtime-files.mjs
  • src/main/runtime/orca-runtime-subscribe-to-terminal-resize.ts
  • src/main/runtime/orchestration/canonical-orca-session-id.ts
  • src/main/runtime/orchestration/chat-assignee.test.ts
  • src/main/runtime/orchestration/chat-assignee.ts
  • src/main/runtime/orchestration/db/schema/create-core-tables-sql.ts
  • src/main/runtime/orchestration/db/schema/create-graph-tables-sql.ts
  • src/main/runtime/orchestration/db/schema/migrate-v42.ts
  • src/main/runtime/orchestration/dispatch-assignee-orca-session-id.ts
  • src/main/runtime/orchestration/orchestration-party-location.test.ts
  • src/main/runtime/orchestration/orchestration-party-location.ts
  • src/main/runtime/orchestration/orchestration-party.ts
  • src/main/runtime/orchestration/orchestration-sender-name.ts
  • src/main/runtime/orchestration/structured-session-lineage.ts
  • src/main/runtime/orchestration/structured-session-mail-address.ts
  • src/main/runtime/orchestration/structured-session-mail-target.test.ts
  • src/main/runtime/orchestration/structured-session-mail-target.ts
  • src/main/runtime/orchestration/structured-session-records.test.ts
  • src/main/runtime/orchestration/structured-session-records.ts
  • src/main/runtime/orchestration/structured-worker-group-addressing.test.ts
  • src/main/runtime/orchestration/structured-worker-group-addressing.ts
  • src/main/runtime/orchestration/structured-worker-journal-archive.ts
  • src/main/runtime/orchestration/structured-worker-journal-page.ts
  • src/main/runtime/orchestration/types.ts
  • src/main/runtime/rpc/methods/orchestration-chat-assignee-journal.ts
  • src/main/runtime/rpc/methods/orchestration-structured-worker-lifecycle.ts
  • src/main/runtime/rpc/methods/orchestration-structured-worker-session.ts
  • src/main/runtime/rpc/methods/orchestration-worker-mode-opacity.test.ts
  • src/main/runtime/rpc/methods/orchestration/caller-show.ts
  • src/main/runtime/rpc/methods/orchestration/chat-assignee-admission.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/recipient-routing.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/session-recipient.ts
  • src/main/runtime/rpc/methods/orchestration/worker/deliver-worker-dispatch-preamble.ts
  • src/main/runtime/rpc/methods/orchestration/worker/session-worker-observation.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-stop.ts
  • src/main/runtime/rpc/orchestration-caller-show.test.ts
  • src/main/runtime/rpc/orchestration-party-addressing.test.ts
  • src/main/runtime/rpc/orchestration-party-agreement.test.ts
  • src/main/runtime/rpc/orchestration-session-caller.test.ts
  • src/main/runtime/rpc/orchestration-session-caller.ts
  • src/main/runtime/runtime-orchestration-sender-names.ts
  • src/main/runtime/structured-worker-at-rest.test.ts
  • src/main/runtime/structured-worker-authority.ts
  • src/main/runtime/structured-worker-cleared-session.test.ts
  • src/main/runtime/structured-worker-custody.ts
  • src/main/runtime/structured-worker-identity.ts
  • src/main/runtime/structured-worker-orchestration-test-fixture.ts
  • src/main/runtime/structured-worker-terminal-read.ts
  • src/shared/orca-session-address.ts
💤 Files with no reviewable changes (5)
  • src/main/runtime/orchestration/canonical-orca-session-id.ts
  • src/main/runtime/rpc/methods/orchestration-worker-mode-opacity.test.ts
  • src/main/runtime/orchestration/structured-worker-journal-page.ts
  • src/main/runtime/orchestration/structured-session-lineage.ts
  • src/main/runtime/orchestration/structured-worker-journal-archive.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The change replaces /clear lineage-based session resolution with direct use of durable conversation records and session IDs. Worker authority, journal and stop operations, mail routing, Dispatch associations, and caller checks now target the specified conversation. Tests cover in-place clears, older replacement records, missing or unreadable records, and per-conversation addresses.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 42fcb

This change makes cleared workers keep their own address, inbox, and transcript instead of following replacement links. No concrete merge-blocking risk was identified; live orchestration paths were not exercised, and old read cursors spanning replacement conversations may need restarting.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 61.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 80 functions across 44 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the main change: removing orchestration forwarding after in-place clear.
Description check Passed The description is complete and focused. It covers the user impact, implementation changes, rationale, linked parent work, visual-proof limits, testing results, review status, compatibility considerat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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