Keep Codex HTTP MCP registration noninteractive during activation #315

Closed
opened 2026-10-12 06:22:02 +01:00 by nimmo · 2 comments
Owner

Lyra's 2026-10-12 06:14 activation stalled in codexMcpConfig when codex mcp add cloudflare --url ... launched OAuth. Home Manager timed out after five minutes and the switch reported failure. The immediate 06:19 retry succeeded because the entry had already been written; Home Manager and Paseo are active. Vega and Lyra are headless, confirmed by the user.

Fix committed locally as 9844b56 on fix/noninteractive-codex-mcp. The shared HTTP activation function now writes TOML with the existing helper, without invoking Codex registration or OAuth discovery. It supports environment-backed bearer tokens and preserves OAuth/user settings. README documents separate manual headless OAuth through an SSH-forwarded callback.

Validation:

  • Full nix flake check passed, including all four host evaluations and formatting.
  • Five HTTP helper regressions passed: existing custom-header registration, invalid-config safety, URL changes, URL-only OAuth settings preservation/offline registration, bearer registration and no-op repeats.
  • Lyra activation package built successfully.
  • Exact generated HTTP function ran on Lyra against a disposable unauthenticated config: fresh Cloudflare and bearer registrations completed, followed by an unchanged-content/mtime no-op repeat. Home Manager and Paseo remained active. This was an isolated function canary, not a system deployment.
  • Reviewed warnings: pre-existing upstream stdenv Linux/Darwin deprecations.
  • Required pre-commit rebase against origin/main was a no-op. Worktree clean.

Remaining: user-requested publication/MR; required MR checks; canary system deployment and no-op follow-up before closure. Branch is not pushed and preventative change is not yet active in deployed generations. Related to #312; same Cloudflare Agent Tooling milestone.

Lyra's 2026-10-12 06:14 activation stalled in codexMcpConfig when `codex mcp add cloudflare --url ...` launched OAuth. Home Manager timed out after five minutes and the switch reported failure. The immediate 06:19 retry succeeded because the entry had already been written; Home Manager and Paseo are active. Vega and Lyra are headless, confirmed by the user. Fix committed locally as 9844b56 on fix/noninteractive-codex-mcp. The shared HTTP activation function now writes TOML with the existing helper, without invoking Codex registration or OAuth discovery. It supports environment-backed bearer tokens and preserves OAuth/user settings. README documents separate manual headless OAuth through an SSH-forwarded callback. Validation: - Full nix flake check passed, including all four host evaluations and formatting. - Five HTTP helper regressions passed: existing custom-header registration, invalid-config safety, URL changes, URL-only OAuth settings preservation/offline registration, bearer registration and no-op repeats. - Lyra activation package built successfully. - Exact generated HTTP function ran on Lyra against a disposable unauthenticated config: fresh Cloudflare and bearer registrations completed, followed by an unchanged-content/mtime no-op repeat. Home Manager and Paseo remained active. This was an isolated function canary, not a system deployment. - Reviewed warnings: pre-existing upstream stdenv Linux/Darwin deprecations. - Required pre-commit rebase against origin/main was a no-op. Worktree clean. Remaining: user-requested publication/MR; required MR checks; canary system deployment and no-op follow-up before closure. Branch is not pushed and preventative change is not yet active in deployed generations. Related to #312; same Cloudflare Agent Tooling milestone.
Author
Owner

MR #316 head 52c0440 has now been test-deployed by the user on Lyra. Live checks confirm exact configurationRevision 52c0440590, revised Home Manager generation, successful 07:36:22–07:36:24 BST activation (Result=success, ExecMainStatus=0), and active Home Manager/Paseo. Cloudflare registration did not wait for OAuth. A repeat of the deployed Cloudflare registration function on the real config preserved bytes and mtime, and Codex recognizes the HTTP endpoint. CI is green. This satisfies the affected-host test canary before merge; keep this issue open until persistent deployment and full deployment no-op follow-up are recorded.

MR #316 head 52c0440 has now been test-deployed by the user on Lyra. Live checks confirm exact configurationRevision 52c04405903c1506b023a36b9cecb1797c2bd7f5, revised Home Manager generation, successful 07:36:22–07:36:24 BST activation (Result=success, ExecMainStatus=0), and active Home Manager/Paseo. Cloudflare registration did not wait for OAuth. A repeat of the deployed Cloudflare registration function on the real config preserved bytes and mtime, and Codex recognizes the HTTP endpoint. CI is green. This satisfies the affected-host test canary before merge; keep this issue open until persistent deployment and full deployment no-op follow-up are recorded.
nimmo closed this issue 2026-10-12 07:54:17 +01:00
Author
Owner

MR #316 merged with explicit user authorization as 2d1f6f90ba. Remote fix/noninteractive-codex-mcp branch deleted; controller returned to clean updated main and its local branch removed. Lyra's test checkout is also being returned to main and its merged branch removed. The affected-host test activation was confirmed before merge. This issue remains open for persistent deployment and full deployment no-op follow-up evidence; test activation is not represented as a persistent switch.

MR #316 merged with explicit user authorization as 2d1f6f90ba45730d50aba2ad572ef5406c316ed6. Remote fix/noninteractive-codex-mcp branch deleted; controller returned to clean updated main and its local branch removed. Lyra's test checkout is also being returned to main and its merged branch removed. The affected-host test activation was confirmed before merge. This issue remains open for persistent deployment and full deployment no-op follow-up evidence; test activation is not represented as a persistent switch.
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config#315
No description provided.