Skip to content

fix(native-chat): identify the owner when resume creation is refused - #29119

Merged
brennanb2025 merged 13 commits into
mainfrom
brennanb2025/rcc-a-owner-refusal
Oct 16, 2026
Merged

brennanb2025 merged 13 commits into
mainfrom
brennanb2025/rcc-a-owner-refusal

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​138 $\color{#cf222e}{\Huge{\mathbf{−}}}$​58 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​80
Prod 16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​150 $\color{#cf222e}{\Huge{\mathbf{−}}}$​61 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​89

ELI5

“Resume in New Native Chat” still waits for Session History to find a conversation. This draft is the first part of removing that delay: the execution host now identifies a chat that already owns the conversation and proves when a new chat was refused before creation. It does not yet remove the History wait.

The first version of this draft also opened a failed chat tab when the host could not support a resume, and it called some unreadable saved history “empty.” This revision leaves the source tab selected for that support refusal and gives distinct, truthful feedback for empty and unreadable history.

What Changed

The host derives an optional existing-chat pointer from its own records before account and transcript work. Its final create transaction refuses a competing owner as well. Only a refusal proved to precede this attempt's commit settles as a failed start; a prior unanswered attempt remains uncertain.

The renderer again checks host support before opening a History resume. A declined resume creates no destination. During import, zero bytes or no raw OpenCode message rows prove an empty source; nonempty history that cannot be decoded remains unreadable. The existing History action says the conversation has not been saved only for a proven missing or empty source; a read, parse, or size failure retains its load-error message.

The follow-up renderer change will remove History as the action's gate, use the owner pointer to open the existing chat from the pane header, and defer visible destination publication for ordinary refusals. Until then, admitted History resumes retain the existing provisional-tab behavior. These are temporary stack boundaries, not completed user-facing claims for this draft.

Why

The host already owns the decision about conversation identity, and the create transaction is the place that prevents two chats from claiming it. Reusing that decision avoids a second discovery authority. The existing missing-transcript reason also lets older clients understand a proved empty refusal; a new reason made those clients treat it as an unknown create outcome. No saved field or new request or wire operation was added.

Linked Issue

This is part of the approved Resume action redesign following the October 15 report that Session History can delay the action for minutes. Earlier attempt-proof work is tracked in #28261.

Visual Proof

Remote Electron comparison and screenshots are pending. This draft is still under review.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

The tests cover a declined resume leaving no destination, a successful supported launch, zero-byte and malformed nonempty imports, OpenCode raw-row evidence, and the History action's distinct refusal messages. The required pre-commit checks passed. PR workflow run 38735767027 completed successfully on 876c72ce9ab1c563a21cbd2b1b4b6daae8215002: static analysis and typecheck, all five test shards, cross-version wire compatibility, relay integration, and the package jobs passed. Its PR checks passed aggregate job was skipped; the coordinator is checking that gate. Separate transcript-reader jobs passed on macOS, Ubuntu, and Windows, and Mobile verification passed. No local test, typecheck, build, or app launch was run.

Review

Round-one source findings were corrected. Independent follow-up review and remote Electron QA are in progress; this PR remains a draft.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer material copied or translated.

Notes

Authored for @BrennanKB5. The owner pointer belongs to the initiating execution host. Lost contact is never treated as process exit. Folder workspace identity and SSH/WSL route limits are unchanged. An intended difference from the common pattern is that Orca must import an external provider transcript into its own chat journal before founding a new chat.

Checklist

  • This PR is small and focused
  • I explained the user-facing result, mechanism, and choice of approach
  • Before/after screenshots or videos attached
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path impact considered
  • Full aggregate PR gate and real Electron QA completed

@brennanb2025

brennanb2025 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Resuming a saved conversation could report an unknown connection even when the host had refused before creating anything. This foundation returns the owning chat's identifiers from host records and lets a proved first-attempt refusal settle as a failed start. An earlier lost create reply stays uncertain.

Two source-review rounds completed at 876c72ce9ab; all four findings were fixed. The narrow final-head refresh is complete at 370d6b785c772aa6d79f6fcec5844792d6802f16, with no new proven P0/P1/P2. The merged streaming importer retains empty-source evidence from bytes actually read and OpenCode's raw-row evidence; malformed or unreadable content remains a load error. The launch-admission file matches merged main, and the repaired refusal-error import resolves to the existing class. Unsupported resumed launches still stop before opening a destination. The coordinator reports CI fully green and a CLEAN merge state on this head; no new CI watch was started for the refresh.

Integrated A+B+C Electron QA is complete on the Mac, under the coordinator's explicit machine authorization. The main comparison used main 69ff84db234 versus C 6634a1119dc, which contains A and B; some unchanged C rows ran at a6c158. It covered busy History, correct imported conversation/provider ID/account home, existing-owner header/menu outcomes, unsaved and unreadable feedback without a tab flash, shared pending, and source closure before the create reply. The symlinked-account unsaved failure found during QA was fixed in B and verified on refreshed C. A focused merged CLI/native tab-menu and spinner re-check also passed on C 5bdfe33331d; these are integrated stack runs, not a separate runtime run on A's final head. Narrow source review qualified the later merge resolutions.

The owned-conversation History guard was rendered. The stale-row race, where History shows the action before another chat claims the conversation, is covered by refusal-contract tests, not rendered QA, as accepted by the coordinator. Twenty-two focused source-admission/direct-resume contract tests passed on C 6634a1119dc; Codex legacy/per-account homes and older-host behavior are fixture/contract evidence. No real Codex, phone, SSH/WSL or older paired-host runtime pass is claimed. Provider continuation is not affected by this stack; unchanged provider resume path.

A preserves the existing successful launch path; History-independent dispatch and deferred destination publication belong to C (#29150, stacked on #29124 on this PR). All observed integrated differences were intended. Test copies and recorded processes, checkouts and throwaway homes were cleaned; real settings/hooks hashes matched. Nothing was merged. Final stack readiness remains the coordinator's responsibility.

For Brennan's review: main-versus-branch whole-window proof from the integrated run follows. Timestamped DOM/request observations, rather than screenshots alone, establish overlap during pending History/create requests. Earlier mismatched-settings and late-close attempts were excluded.

Flow Main Branch
Busy History Main: Busy History Branch: Busy History
Imported history Main: Imported history Branch: Imported history
Existing owner, header Main: Existing owner, header Branch: Existing owner, header
Existing owner, menu Main: Existing owner, menu Branch: Existing owner, menu
Nothing saved yet Main: Nothing saved yet Branch: Nothing saved yet
Unreadable history Main: Unreadable history Branch: Unreadable history
Shared pending Main: Shared pending Branch: Shared pending
Source closes during create Main: Source closes during create Branch: Source closes during create

…ner-refusal

# Conflicts:
#	src/main/native-chat/agent-session-journal/journal-legacy-import.ts
@brennanb2025
brennanb2025 marked this pull request as ready for review October 16, 2026 06:29
…ner-refusal

# Conflicts:
#	src/renderer/src/lib/structured-agent-session-launch-admission.ts
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5a531aa6-34f8-4f48-a9ed-9b3b91800089
📥 Commits

Reviewing files that changed from the base of the PR and between 0aef11d and 370d6b7.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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: 75f83c47-f4f1-404b-8e4e-9b5829237f6f
📥 Commits

Reviewing files that changed from the base of the PR and between 7005af3 and 0aef11d.

📒 Files selected for processing: 27
  • src/main/native-chat/agent-session-journal/journal-legacy-import.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-adopted-import.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-create-adoption.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-create.ts
  • src/main/native-chat/structured-agent-cli-conversation-adoption.test.ts
  • src/main/native-chat/structured-agent-session-history-adoption.test.ts
  • src/main/native-chat/structured-agent-session-history-adoption.ts
  • src/main/native-chat/transcript-opencode.test.ts
  • src/main/native-chat/transcript-opencode.ts
  • src/main/native-chat/transcript-reader.ts
  • src/main/runtime/agent-session-founding-admission.ts
  • src/main/runtime/agent-session-reservation-admission.ts
  • src/main/runtime/orca-runtime-structured-agent-session-create-intent.test.ts
  • src/main/runtime/rpc/methods/structured-agent-session-precommit-refusal.test.ts
  • src/main/runtime/rpc/methods/structured-agent-session-precommit-refusal.ts
  • src/main/runtime/session-tabs/structured-session-create-support.ts
  • src/main/runtime/structured-agent-session-create-adoption.ts
  • src/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-launch.test.ts
  • src/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-launch.ts
  • src/renderer/src/lib/structured-agent-session-launch-admission.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-create-call.ts
  • src/renderer/src/lib/structured-agent-session-launch-exited-owner.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-resume-identity.test.ts
  • src/shared/agent-session-definitive-refusal.ts
  • src/shared/agent-session-refusal-details.ts
  • src/shared/agent-session-refusal-notice.test.ts
  • src/shared/agent-session-refusal-reason-words.ts
💤 Files with no reviewable changes: 1
  • src/main/native-chat/structured-agent-cli-conversation-adoption.test.ts

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

📝 Walkthrough

Transcript imports now report whether the source is empty, so adopted imports can distinguish an empty transcript from unreadable history. Session creation checks whether a provider conversation belongs to another session and includes owner IDs in conflict refusals. Runtime and renderer launch handling use a shared admission-refusal classification and pre-commit status when settling create attempts. Resume failure notifications distinguish an unsaved transcript from other history failures.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 0aef1

No actionable issue is established for this change; it is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 26 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: native-chat resume creation now identifies the owning chat when creation is refused.
Description check Passed The description follows the required template and explains the user impact, implementation, motivation, issue context, testing, review status, and compatibility considerations. It explicitly notes tha…
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.
✨ 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
  • Autofix · 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.

@brennanb2025
brennanb2025 merged commit 6dd7ab5 into main Oct 16, 2026
36 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/rcc-a-owner-refusal branch October 16, 2026 23:02
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