Repository navigation
fix(daemon): roll Codex no-daemon shell launch into a fresh v37 daemon - #23907
Conversation
Terminal daemons survive app updates, so new tabs keep spawning from the old v36 daemon and never get #23900's Codex shell function. Bump to v37 so new tabs move to a fresh daemon; v36 owners stay attachable.
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Daemon protocol version bump —
PROTOCOL_VERSIONgoes 36 → 37, adds theCODEX_NO_DAEMON_SHELL_LAUNCH_DAEMON_PROTOCOL_VERSION = 37marker, appends36toPREVIOUS_DAEMON_PROTOCOL_VERSIONS, and updates the file's top comment to describe v37. - Compatibility contract — both
local-build-compatibility-contract.jsonand.tsmovedaemonProtocolVersionto 37 and extendattachableDaemonProtocolVersionsthrough 37. - Version tests —
daemon-protocol-version.test.tsanddaemon-foreground-confirmation-protocol.test.tsassert 37 and the extended previous-version list.
I traced the load-bearing claim end to end and it holds. Because the endpoint is version-namespaced (getDaemonSocketPath → daemon-v37.sock / orca-terminal-host-v37-… on Windows), the v37 app never sees a preserved v36 daemon in prepareDaemonReplacement, so it spawns a fresh v37 daemon; createLegacyDaemonAdapters keeps v36 listable/attachable via the extended PREVIOUS_DAEMON_PROTOCOL_VERSIONS; and DaemonPtyRouter.spawn sends new panes (no sessionId) to this.current, i.e. v37, while legacy adapters serve only known session ids. cleanupDaemonForProtocol is scoped to a single version, so the v36 daemon is left running. This matches the precedent in #14326 (v33→v34), which changed the same five files with the same daemon-protocol-version.ts shape, and #23900 is already merged on main.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
Orca keeps a background terminal service running so your terminals survive an app update. That service also writes the small startup scripts every new terminal runs. #23900 changed those scripts so
codextyped in an Orca terminal runs without its shared background server, but it didn't bump the service's version, so after updating, the old service kept writing the old scripts. This PR bumps the version so updated apps start a new service for new tabs.What Changed
codexshell function from fix(terminal): run Codex in Orca terminals without the shared background server #23900, so the fix didn't reach users who had terminals open during the update. We confirmed this on a real machine: Orca 1.4.217, which includes fix(terminal): run Codex in Orca terminals without the shared background server #23900, opened a new tab whose shell parent was the 1.4.213 v36 service.How it works:
PROTOCOL_VERSIONinsrc/main/daemon/daemon-protocol-version.tsgoes from 36 to 37. It also gets a one-line reason and a namedCODEX_NO_DAEMON_SHELL_LAUNCH_DAEMON_PROTOCOL_VERSIONmarker. 36 is added toPREVIOUS_DAEMON_PROTOCOL_VERSIONS, socreateLegacyDaemonAdapterskeeps a legacy adapter for a running v36 service. The local-build compatibility contract (JSON + TS) and the two version tests are updated to match. There are no other code changes.Why
The terminal service survives app updates on purpose. The app decides which service owns new tabs only by protocol version: the socket is
daemon-v<N>.sock. An app with the same version keeps using the running service. It won't replace a service that still has live terminals, because replacing it would kill them. So a change to what the service generates only reaches users after they update if the version goes up. The comment at the top of the version file says exactly this.We follow the precedent of #14326 ("Fix Codex hook trust before manual shell launches"), which bumped v33 to v34 for a similar Codex shell-launch change and touched the same files. We considered two alternatives and rejected both:
This must be cherry-picked together with #23900. Without #23900, the version bump rolls terminals onto a new service for nothing. Without this PR, #23900 doesn't reach users who update with terminals open.
Linked Issue
Follow-up to #23900 (fixes #22873 for users who update with terminals open).
Visual Proof
N/A. This changes which background service starts new terminals; there is no UI change. The live upgrade evidence is under Testing.
Testing
vitest --config config/vitest.config.tsoversrc/main/daemon,src/main/providers,src/main/pty,src/main/ipc/pty,src/main/orcad, and the local-build contract: 4838 passed. The only 2 failures are inrepro-13767-shell-ready-marker-lost-to-exec, which already fails on macOS without this change.pnpm tc, oxlint, oxfmt, and the changed-code quality gate all pass.Live upgrade check (macOS, headless dev runtimes, one isolated profile with a sandboxed HOME):
3c1af16e8b9, v36) and ran it on the profile. We opened terminal A. Its shell (pid 98281) is a child of a daemon started with--socket …/daemon-v36.sock. In that shell,functions codexshows the older preflight-only function, with no--no-daemon. We used the pre-fix(terminal): run Codex in Orca terminals without the shared background server #23900 build so the old service is really "old", like the 1.4.213 service on the affected machine.--socket …/daemon-v37.sockand--entry-path …/orca-main/out/main/daemon-entry.js. Its ancestry:type codexprintscodex is a shell function, and the function body carries the fix(terminal): run Codex in Orca terminals without the shared background server #23900--no-daemonlogic (functions codex | grep -c -- --no-daemon→ 2).connected: true. Text sent to A through the v37 app ran in the same shell (A-ALIVE-UNDER-V37 pid=98281), which is still a child of the v36 service. So old tabs keep working on the old service.--app-versionwas1.4.214for both services, because both dev trees share one package version. What separates them is the protocol socket and the entry path. On a real update, the app version would also differ.Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
orca-terminal-host-v37-…), so Windows follows the same path.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)