fix(native-chat): preserve initial chat mode on paired-host launches - #8567
Conversation
📝 WalkthroughWalkthroughAdds optional 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 24984297-c8c2-418a-9b42-a3390d3dc5b4
📒 Files selected for processing (13)
src/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/session-tabs-schemas.tssrc/main/runtime/rpc/methods/session-tabs.test.tssrc/main/runtime/rpc/methods/session-tabs.tssrc/renderer/src/hooks/useIpcEvents.test.tssrc/renderer/src/hooks/useIpcEvents.tssrc/renderer/src/lib/launch-agent-in-new-tab.test.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/runtime/web-runtime-session.test.tssrc/renderer/src/runtime/web-runtime-session.tssrc/shared/runtime-types.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Related issue: #8401. Canonical first-flush PR: #8418. This PR changes only paired-launch mode propagation, not transcript polling, reading, or caching.
Paired runtime/web-host launches could ignore the user's initial native-chat choice because the web-owned branch returned before renderer-only tab defaults were applied. This change carries an optional
viewModethrough the existing typed session-creation path and keeps that mode authoritative across:sessionTabs.createTerminalschema/RPC handling;Explicit
terminalmode is preserved just as carefully aschat, so host-provided intent is never replaced by a local preference.Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm test(29,165 passed, 42 skipped during the implementation pass)pnpm buildwas not rerun for this focused typed-routing changeAI Review Report
Two separate
gpt-5.6-solxhigh agents implemented and then adversarially reviewed the exactorigin/main..HEADdiff. The second pass found and fixed three omissions: explicit terminal-mode propagation, mode loss during stale renderer/PTY rescue, and headless initial-mode persistence.The review checked macOS, Linux, and Windows behavior; local versus runtime-owned/paired/SSH ownership; schema and type coverage; stale events; local/web divergence; persistence; performance; and overlap with #8418, #8157, and #8288. There are no hardcoded shortcuts, labels, paths, shell commands, or platform-only Electron branches, and those open PRs have no changed-file overlap with this branch.
Security Audit
No command execution, filesystem access, dependency, secret, auth, or credential behavior changes.
viewModeis additive, enum-constrained data on an existing schema-validated session-creation path. The review verified that stale renderer events cannot replace explicit host intent and that persistence remains inside the existing runtime session boundary.Notes