Skip to content

feat(dashboard): Codex CLI update tab over the existing plan/apply/jobs API - #8540

Merged
lidge-jun merged 3 commits into
devfrom
feat/codex-cli-update-dashboard
Nov 11, 2026
Merged

lidge-jun merged 3 commits into
devfrom
feat/codex-cli-update-dashboard

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds the dashboard surface #2811 asked for over the Codex CLI update engine that already ships (GET /api/codex/cli-update/plan, POST …/apply, GET …/jobs/<id>). No server change.

New tab Codex → Codex CLI (#codex-set/cli), separate from OpenCodex's own updates:

  • Check for update is read-only and runs only on request. It shows who installed the CLI (npm global / Codex desktop app / version manager / unverified standalone), whether OpenCodex manages it, installed → available version, running Codex sessions, the redacted location, the indicative install command, and every plan refusal in plain words (all 10, including the two Windows ones).
  • Update Codex CLI appears only for an applicable plan with a bound planId and stays disabled until the operator ticks "I understand this changes only this Codex CLI installation. OpenCodex and the desktop app are not updated or restarted."
  • Apply posts exactly the shown planId with confirmed: true and one requestId. That id is reused only for job_store_busy, admission_failed or a network failure; idempotency_conflict and store refusals (store_full, unsupported_store, unsafe_store) are final for that attempt.
  • The job is polled every 1.5 s until its status is final and no owner is still writing it; a terminal 202 is shown without polling. job_not_found stops with "result unknown, check the installation"; five consecutive unreadable reads stop with the ocx system codex-cli-update status <job> --json command. An ambiguous result is never retried or rolled back; owner_state_unknown is explained.
  • 403 local_dashboard_confirmation_required (the normal automatic local session) shows the existing local pairing form and the equivalent ocx system codex-cli-update apply --plan-id <id> --yes.
  • A new Check or another server discards the plan, the confirmation and the request id; a session change (for example pairing) clears the confirmation; stale responses are dropped. A poll that stops (record gone, or five unreadable reads) re-enables Check. Resending the same request id is idempotent: the job ledger returns any job already admitted and never admits a second.
  • The tab reads through the shared management base like the other management calls; on a standalone dashboard that is the same server as the machine base, and connected dashboards never reach the request code.
  • A connected Child / Remote Link dashboard shows a notice and makes no request: its machine listener refuses /api/codex/* and its shared base is the Home, i.e. the wrong machine.

Copy lives in one table (gui/src/i18n/codex-cli-update-copy.ts, 11 locales). Docs: guides/web-dashboard.md (the section that said "no dashboard job UI" now describes the tab) and reference/cli.md; structure/codex-cli-update.md records the dashboard consumer contract.

Closes #2811

Screenshots

Real server started from source (no trusted published-launcher candidate, so the engine fails closed with not_managed, as documented):

refused plan

Applicable plan, rendered from the same tab with only the plan response substituted in the browser (an npm-global managed install with a published launcher was not available here); confirmation ticked, Apply not clicked:

applicable plan

Verification

  • Failing first: on a pristine origin/dev export, codex-cli-update-api.test.ts and codex-cli-update-panel.test.tsx fail (module absent) and codex-set-shell.test.tsx fails its new #codex-set/cli case.
  • At head: those four files (with fr-localization) 38 pass / 0 fail. Coverage includes the exact apply body, the retry classes (8 codes + network), canApply / isTerminalJob truth tables, Apply gating, re-Check resetting the confirmation, polling to a final state, terminal 202 without polling, 404 stop, 403 copy with the CLI command, 409 finality, same requestId on a busy-store retry, and connected mode making no request.
  • cd gui && bun run lint ✅ · bun run lint:i18n ✅ · bun run build ✅ · bun test tests = only the same pre-existing cross-file failures a pristine dev export shows on this host (models-visibility-queue, kiro-device-login, …; each passes alone).
  • Root: bun run typecheck ✅ · bun run privacy:scan ✅ · bun run structure:check ✅ · test-layout + file-size ratchet ✅ · docs-site build ✅ (665 pages, 96,054 internal links).
  • Browser: tab, Check and refusal against a real local server.

NOT RUN: a real end-to-end apply (needs a published-launcher npm-global Codex install and a paired session; the engine's own apply suites already cover it); Windows dashboard run.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

…bs API

Adds Codex -> Codex CLI (#2811): a read-only Check shows who installed the
Codex CLI, whether OpenCodex manages it, installed and available versions,
running sessions and the refusal reason; Update stays disabled until the
plan is applicable and the operator confirms that only this installation
changes. The tab posts exactly the planId on screen with one requestId,
reused only for job_store_busy, admission_failed or a network failure, and
follows the job until its status is final with no active owner. A 403 shows
the local pairing form and the CLI apply command; an ambiguous result is
never retried. A connected Child shows a notice and makes no request.

No server change; docs and structure/codex-cli-update.md describe the
dashboard consumer.

Closes #2811
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 11, 2026 10:23
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T10:26:01.385637Z 48b31c3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Nov 11, 2026
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

… apply refusals

Review follow-ups on the Codex CLI update tab: a poll stopped by job_not_found
or repeated unreadable reads no longer leaves Check disabled; a refusal the tab
has no words for says the update could not start instead of claiming a request
conflict; drop the unused retryAfterMs; align structure/codex-cli-update.md with
when the requestId is resent and what a session change clears.
…nd wording

Final-review follow-ups on the Codex CLI update tab: mint the apply request id
through getRandomValues when crypto.randomUUID is unavailable (plain-http LAN),
refuse to send without one; describe resends as idempotent rather than as
admitting nothing; owner_state_unknown copy no longer claims a restart.
@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer judgment

Value: #2811 asked for a dashboard surface over the Codex CLI update engine that already ships (plan / confirmed apply / durable job). Operators can now check provenance, managed status, versions, session blockers and the refusal reason, and apply one reviewed plan without leaving the dashboard, separately from OpenCodex's own updates.

UX change scope: a new fourth tab on the Codex page (#codex-set/cli), lazy-mounted like the others; nothing is read until Check for update. No existing page changes behaviour.

Security review (update path): PASS at 13f6626. The UI adds no authority: apply still requires the server's paired human session on trusted loopback, Origin/CSRF and confirmed: true; the client posts only the displayed planId after the tick; stale responses are dropped; resending a request id is idempotent in the job ledger; connected dashboards send nothing. Its one low doc note (resends "admit nothing" → "cannot admit a second job") is fixed at dc4d71f.

Regression evidence for existing users: no server change; routing adds one hash (codex-set/cli); locale files only gain spread keys from one copy table. Full GUI suite on this host shows only the pre-existing cross-file failures that a pristine dev export shows.

Windows impact: the tab renders the two Windows refusals (windows_inspection_deferred, windows_apply_disabled) in plain words; apply authority on Windows is unchanged and server-decided. Not run on Windows.

Verification: failing-first (new test files fail on dev; shell test's #codex-set/cli case fails), 38 focused GUI tests green, gui lint / lint:i18n / build, root typecheck, privacy:scan, structure:check, docs-site build; real local server Check → not_managed. Reviews: independent round 1 FAIL (stranded Check after a stopped poll + 3 lows) → fixed with regression tests → round 2 PASS; fresh final review PASS at 13f6626 and again at dc4d71f.

NOT RUN: a real end-to-end apply against a published-launcher npm-global install with a paired session (engine apply suites cover the install); Windows dashboard run.

@lidge-jun
lidge-jun merged commit aa829d5 into dev Nov 11, 2026
28 of 31 checks passed
@lidge-jun
lidge-jun deleted the feat/codex-cli-update-dashboard branch November 11, 2026 10:40
lidge-jun added a commit that referenced this pull request Nov 11, 2026
…8544)

The CLI parity sweep scans GUI source for /api/ literals; a comment in the Codex CLI update tab named /api/codex/* and read as an uncovered endpoint, turning tests/cli/cli-headless-parity.test.ts red on dev since #8540.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: provenance-aware Codex CLI update manager

1 participant