Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

docs(codex): the shim half is shared, the record half is desktop-only

Howard Youngdahl9d1de3ee8c97
diff --git a/CLAUDE.md b/CLAUDE.md
index 61602262e..b8e220ce3 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -1088,7 +1088,14 @@ else, and its context links must keep classifying across restarts).
carry no record root or prelude, and `remote-hooks.ts` cannot even NAME a parameterised
builder), because the failure is silent and one-sided: a remote shim carrying the prelude keeps
working, and the only symptom is this machine's userData layout sitting in a file on someone
- else's server.
+ else's server. **The prelude is shared; the RECORD it reads is desktop-only.** Those writers are
+ the two hook-server handlers `src/main/index.ts` registers, and
+ `src/server/handlers/index.ts` deliberately registers neither — so on the Server Edition the
+ file is byte-identical, the signing secret is armed, and the resolver still finds nothing and
+ takes its fallback. Coherent rather than missing: that shell answers `shared: false`
+ (`UNKNOWN_CODEX_IDENTITY_CAPS`), so its Codex nodes run their own app-server and no tool shell
+ needs recovering. It turns into a real gap only when that edition grows the shared app-server,
+ and the fix is the two registrations.
- **That prelude EXPORTS WHAT THE RECORD SAYS — it never decides.** `NODETERM_AGENT_ID` and
`NODETERM_CANVAS_CONTROL` were once constants there (`codex`, granted); both are
`buildPtyEnv`'s answers about the PANE, which labels a node with its OWN agent id
diff --git a/docs/shared-codex-node-identity.md b/docs/shared-codex-node-identity.md
index cc100b042..89d1f4348 100644
--- a/docs/shared-codex-node-identity.md
+++ b/docs/shared-codex-node-identity.md
@@ -66,7 +66,9 @@ Every ownership record is HMAC-signed by the **one** restart-stable 32-byte node
It is **confidential and fail-closed**: a malformed/wrong-length persisted state **throws** rather
than minting a fresh secret — rotating the key would orphan every bound thread on the machine — and
the single-flight cache clears on rejection so a healed machine retries. It is wired at boot in both
-`src/main/index.ts` and `src/server/index.ts` via `setCodexThreadIdentityAuthSecret(...)`.
+`src/main/index.ts` and `src/server/index.ts` via `setCodexThreadIdentityAuthSecret(...)`. Arming
+the secret is not the same as writing records: only the desktop registers the handlers that write
+any — see the resolver section below.
> No `safeStorage`-only secret module is introduced. @Corvin's `codex-node-auth-secret.ts` in
> PR #112 is `safeStorage`-ciphertext-only and throws on a headless server; the merged both-shells
@@ -161,6 +163,20 @@ same first-class node as being outside nodeterm. The machine-neutral shim consta
hosts deliberately omit the local record path; each local installer builds its own copy with its
own `codexThreadIdentityRoot()`.
+**The shim half is shared; the RECORD half is desktop-only until the Server Edition registers the
+handlers.** Both statements matter, and reading only the first overstates what that edition has.
+The prelude reaches it byte-for-byte — `context-link.ts`'s `writeCliFiles` is core, and both shells
+arm the signing secret (above) — but `src/server/handlers/index.ts` deliberately registers no
+`setCodexThreadStartHandler` / `setCodexThreadBindHandler`, and `src/main/index.ts` is the only
+non-test caller of `writeCodexThreadIdentity` / `bindCodexThreadIdentity`. **No ownership record is
+ever written on that shell**, so the resolver always finds none and takes its fallback: it exports
+nothing, and the shims stay gated exactly as they were before this prelude existed. That is
+coherent rather than merely missing — the same file answers `UNKNOWN_CODEX_IDENTITY_CAPS`
+(`shared: false`), so a Codex node there launches the bare `codex` with its own app-server, and a
+tool shell whose identity would need recovering does not exist. It becomes a real gap the day the
+Server Edition grows the shared app-server, and what closes it is those two registrations — not a
+second copy of the prelude.
+
The resolver:
- reads `NODETERM_CODEX_ACCOUNT_ID` from the daemon env to pick the scope;