Repository navigation
feat(dsh): add the Codex Desktop handoff adapter - #2652
Conversation
305ba71 to
54d0151
Compare
| } | ||
|
|
||
| /** Qualification is supplied by the integrator; local probing alone is never qualification. */ | ||
| export function createCodexDesktopAdapter(options: CodexDesktopAdapterOptions): TargetAdapter { |
There was a problem hiding this comment.
[P2] Wire the adapter into the shipped Host
Neither new adapter module has a production import: apply() still calls registerHandoffBridge(ctx, runtime) with its empty adapter default, so the release bundle omits the implementation and Codex remains unavailable even for detection. Register the adapter in Host composition and include it in the distributed package while preserving the qualification gate.
hidb4ai
left a comment
There was a problem hiding this comment.
Reviewed 5011a4b against 413acc3. The default Host wiring issue is fixed. Two reproduced failures remain: an app-server pipe closure can terminate the calling Host process, and catalog reads now require the macOS-only delivery writer lease. Details inline. Native macOS Desktop acceptance was not independently rerun in this Linux review environment.
| child.once('error', fail) | ||
| child.once('exit', fail) |
There was a problem hiding this comment.
[P2] Handle errors from the app-server stdin pipe
The child-process error listener does not handle errors emitted by child.stdin. If the app-server closes its input after replying to initialize, the following initialized write emits an unhandled EPIPE; the surrounding async catch never receives it. I reproduced this by calling createCodexDesktopRuntime(...).checkIntegration(...) with a subprocess that replies to initialization and closes fd 0: the calling Node process exits with code 1 instead of returning unknown. In a qualified Host this can terminate DSH during preflight. Route stdin stream errors through the probe failure/cleanup path so an app-server disconnect remains a recoverable check failure.
| } | ||
| const handler = createHandoffHandler({ | ||
| facts, requireLocal, catalog, signal: lifetime.signal, | ||
| facts, requireLocal, get catalog() { ensureServices(); return catalog! }, signal: lifetime.signal, |
There was a problem hiding this comment.
[P2] Keep target catalog reads independent of the delivery writer lease
The new catalog getter calls ensureServices(), which invokes the macOS-only lockWriter() even for GET /powercontext/targets. With an authenticated loopback owner-local Web Host (ownerLocal: true, no SSH), the same HTTP probe on Linux returns 200 with 16 targets using the base Host composition, but 403 deployment_unsupported at this head. This removes the existing manual/setup/export catalog on platforms where native launch is unavailable; it also makes listing targets contend for the global delivery writer lock. Keep catalog/detection initialization separate from mutable delivery services so read-only discovery does not require a native-launch lease.
* feat(dsh): verify and recover exact handoff receipts * test(desktop): qualify the receipt API contract * fix(dsh): declare handoff connection identity tools * feat(dsh): add the Codex Desktop handoff adapter (#2652) * feat(dsh): add the Codex Desktop handoff adapter * fix(dsh): ship Codex Desktop diagnostics in the default Host * fix(dsh): recover Codex probes and isolate target discovery
Which issue or RFC does this PR close?
Refs #2514 and RFC #2528. This PR builds on #2651 (shared short draft and receipt verification).
Rationale for this change
A detected Codex installation does not establish which PowerContext plugin, Server, Scope, or permission profile a new Desktop chat will use. Launch needs to check those facts for the selected workspace and package.
What changes are included in this PR?
Are there any user-facing changes?
Codex can be detected without being eligible to launch. The normal registry only offers launch for a qualified version and environment;
openedonly means the operating system accepted the request.How was this change tested?
pnpm exec vitest run --maxWorkers=1 tests/codex-desktop-adapter.spec.ts tests/codex-desktop-runtime.spec.ts tests/handoff.spec.ts— 36 tests passed, including changed configuration, missing tools, untrusted hooks, and package access failures.pnpm buildpassed.5cd2opened a new native Codex chat with an unsent draft. The operator added a read-only README requirement; Codex returned the heading andCODEX-814, called Continue and ACK, and DSH verified that exact receipt.AI usage statement
OpenAI Codex assisted with implementation, tests, local validation, and preparing this PR.