Repository navigation
fix(daemon): bump the terminal daemon protocol to v40 - #25291
Conversation
Daemon-side changes landed under v39 after v1.4.220 shipped v39: the #25130 and #24636 shell-wrapper changes and a wider agent list (jcode, qoder-cn, dsb; resume claims for qoder-cn, qwen-code, cursor and jcode). Without a bump, an update keeps new tabs on the running v39 daemon, which misses the wrapper fixes and rejects those resume claims with agent_session_identity_required.
There was a problem hiding this comment.
Important
The PROTOCOL_VERSION bump leaves the packaged local-build compatibility contract at 39. local-build-compatibility-contract.test.ts now fails, and every macOS local build advertises the wrong set of attachable daemon protocols.
Reviewed changes
- Protocol bump —
PROTOCOL_VERSION39 → 40 and39appended toPREVIOUS_DAEMON_PROTOCOL_VERSIONSinsrc/main/daemon/daemon-protocol-version.ts, with the header comment rewritten to describe what v40 rolls up. - Daemon protocol tests — the two version-pinning assertions updated to expect 40 / a 39-element history.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe current daemon protocol version changes from 39 to 40. The previous-version list adds version 39. The compatibility contracts add protocol 40 to their attachable versions. The protocol version tests and foreground confirmation protocol test now expect version 40. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to Existing v39 terminals remain attachable, while new terminals use v40. No actionable merge risk was identified in the reviewed change. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The declarations consistently advance to protocol 40 while preserving existing version 39 terminals. No introduced authentication bypass was identified. Risk remains low rather than minimal because live upgrade, overlapping startup, and resume recovery behavior were not fully verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 4 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 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 |
…atibility contract
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This incremental re-review covers the delta since the prior pullfrog review: the packaged local-build compatibility contract catch-up to v40. The prior blocker is resolved.
- Daemon protocol bumped to v40 —
PROTOCOL_VERSION39 → 40 and39appended toPREVIOUS_DAEMON_PROTOCOL_VERSIONS, so an updated app starts a fresh daemon for new terminals while v39 daemons stay attachable. - Local-build contract bumped to v40 —
daemonProtocolVersion39 → 40 and40appended toattachableDaemonProtocolVersionsin bothsrc/shared/local-build-compatibility-contract.tsand.json, matching the runtime constants. Verifiedpnpm test src/main/local-builds/local-build-compatibility-contract.test.tspasses.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…rompt-on-command-line Main landed its own daemon protocol v40 (#25291), so staging moves to v41 with 40 attachable (the version file, the local build contract and the pinned tests). Main's #23672 submits startup commands with CR and drops the submit option: the daemon and relay keep the staged line under the new signature, and the staging tests expect the sourcing line to end in CR. The renderer SSH startup delivery file stays deleted; main's only change there removed the submit option.
* fix(daemon): bump the terminal daemon protocol to v40 Daemon-side changes landed under v39 after v1.4.220 shipped v39: the stablyai#25130 and stablyai#24636 shell-wrapper changes and a wider agent list (jcode, qoder-cn, dsb; resume claims for qoder-cn, qwen-code, cursor and jcode). Without a bump, an update keeps new tabs on the running v39 daemon, which misses the wrapper fixes and rejects those resume claims with agent_session_identity_required. * fix(local-builds): record daemon protocol v40 in the local build compatibility contract (cherry picked from commit 1787585)

ELI5
Orca's terminal background service (the daemon) keeps running across app updates. The app reuses a running daemon only if its protocol number matches. Several daemon-side fixes landed after v1.4.220 shipped protocol 39, without changing the number. So after an update, new terminals would keep running on the old v39 daemon and miss those fixes, and one resume path would fail. Bumping to 40 makes an updated app start a fresh daemon for new terminals. Existing terminals stay on their old daemon, as with every bump.
What Changed
PROTOCOL_VERSIONgoes from 39 to 40, and 39 joinsPREVIOUS_DAEMON_PROTOCOL_VERSIONS, so v39 daemons stay attachable. The tests that pin the version are updated. No other change.What a v39 daemon from v1.4.220 lacks (from the daemon bundle's import closure,
src/main/daemon/daemon-entry.ts, compared betweenv1.4.220and today's dailya5b8b7e2bb7):PATH. In zsh configs that clear the prompt-hook list, Orca's deferred startup never runs.XDG_DATA_HOME/XDG_STATE_HOME/OPENCODE_DBrestored after the user's startup files run.launchAgent. Those panes lose the git credential guard, child-process cleanup on kill, and agent detection.agent-session-resume.ts)agent_session_identity_required(daemon-terminal-admission.ts:71-76), which isn't the error that triggers the fallback, so the resume fails.ORCA_AGENT_HOOK_NODE. Still works through the fallback path.Why
Linked Issue
N/A (maintainer; v1.4.221 release prerequisite)
Visual Proof
N/A: protocol version only.
Testing
repro-13767failures also fail on the unmodified daily, as known.*_DAEMON_PROTOCOL_VERSIONgate is unchanged, and the only gate at 39 (the fish codex function) is present in the v1.4.220 daemon.Review
Agent skill upstream boundary
Notes
agent-resume-host-authority-capability.ts), so this doesn't change them.Checklist
N/Afor visuals, with reason