codex-copilot-dx 1.2.32 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +65 -113
  2. package/bin/cli.mjs +61 -103
  3. package/docs/ARCHITECTURE.md +51 -3
  4. package/docs/README.md +9 -76
  5. package/docs/REFERENCE.md +137 -1827
  6. package/package.json +11 -4
  7. package/src/access-settings.mjs +2 -2
  8. package/src/adapter.mjs +1 -1
  9. package/src/auth-credentials.mjs +1 -1
  10. package/src/auto-review-model.mjs +2 -2
  11. package/src/cli-animation.mjs +2 -2
  12. package/src/cli-auth.mjs +3 -3
  13. package/src/cli-cache.mjs +2 -2
  14. package/src/cli-command-spec.mjs +325 -0
  15. package/src/cli-image.mjs +4 -4
  16. package/src/cli-limits.mjs +2 -2
  17. package/src/cli-m365.mjs +1 -1
  18. package/src/cli-management.mjs +344 -0
  19. package/src/cli-options.mjs +73 -443
  20. package/src/cli-status.mjs +7 -7
  21. package/src/cli-tools.mjs +3 -2
  22. package/src/client-integration.mjs +7 -3
  23. package/src/config.mjs +4 -3
  24. package/src/connection-runtime.mjs +1414 -350
  25. package/src/copilot-token-session.mjs +1 -1
  26. package/src/dashboard/connections.js +23 -4
  27. package/src/dashboard/ui.css +9 -2
  28. package/src/dashboard-api.mjs +5 -5
  29. package/src/doctor.mjs +4 -4
  30. package/src/image-mcp.mjs +2 -2
  31. package/src/native-prediction-fix.mjs +1 -1
  32. package/src/native-prediction-profile.mjs +1 -1
  33. package/src/native-prediction-windows.mjs +1 -1
  34. package/src/native-prediction.mjs +6 -6
  35. package/src/nightly-update.mjs +2 -2
  36. package/src/provider-runtime.mjs +1 -1
  37. package/src/providers/m365-accounts.mjs +1 -1
  38. package/src/release-install.mjs +11 -15
  39. package/src/service-control.mjs +1 -1
  40. package/src/settings-preferences.mjs +6 -4
  41. package/src/startup-ui.mjs +34 -2
  42. package/src/terminal-console.mjs +32 -30
  43. package/src/terminal-state.mjs +69 -0
  44. package/src/usage.mjs +5 -5
  45. package/src/windows-command.mjs +2 -2
  46. package/bin/codex-copilot-dx.mjs +0 -11
  47. package/src/cli-models.mjs +0 -94
  48. package/src/legacy-command-warning.mjs +0 -38
package/docs/REFERENCE.md CHANGED
@@ -1,183 +1,113 @@
1
- # CCDX command, configuration and compatibility reference
2
-
3
- Use Codex App with GPT models available to your **GitHub Copilot** account by default.
4
- The optional [Microsoft 365 provider](#microsoft-365-provider) supplies a protocol-isolated
5
- Claude gateway and an explicitly selected Codex backup.
6
-
7
- ## Manual APIs and client access
8
-
9
- `ccdx web` starts management without GitHub sign-in or automatic App launch.
10
- Use **Model sources → Add API**, enter the HTTPS API base address/key
11
- (including a required prefix such as `/v1`), then choose **Save & read models**.
12
- The saved source remains available and the editor stays open for model selection.
13
- A failed directory read keeps the source and draft; retry with **Read models**
14
- under the existing request-coalescing and cooldown policy.
15
- Select the models to use and their supported interfaces, save, then choose each
16
- client's visible models and default on **Codex** or **Claude**. Unselected catalog entries
17
- are not saved. A selected model needs at least one interface; choosing an
18
- interface also selects its model. Manual ID entry is an optional collapsed path
19
- for models absent from the catalog. Only Codex on GitHub needs the default
20
- GitHub sign-in path. To use Claude alone, disable Codex access. Stop the
21
- management-only process before normal `ccdx` startup for the live terminal.
22
-
23
- | Client | Local base path | Required upstream API |
24
- | --- | --- | --- |
25
- | Codex App / CLI | `/v1` | Responses |
26
- | Claude App / Claude Code | `/anthropic` | Messages |
27
-
28
- All paths share the main port, normally 2026. Manual Codex and explicitly managed
29
- Claude clients receive distinct private local credentials; never the upstream
30
- key. Display hints do not authorize requests. API addresses require HTTPS, no
31
- userinfo/query/fragment, and endpoint overrides on the base address's origin.
32
- Redirects are refused. Existing proxy/bypass/private-CA rules remain; unsupported
33
- dynamic macOS routing fails without a direct fallback. Windows delegates system
34
- routing to a target-pinned WinHTTP worker. Failed calls are not replayed. A
35
- transport failure before response headers marks that transport unhealthy; a
36
- later request creates a new transport and rereads the existing routing policy.
37
- Other responses already using the old transport finish before it is released.
38
- HTTP denials and deliberate cancellation do not trigger this recovery.
39
- Network failures retain `ccdx_api_network_unavailable` and include a bounded
40
- `error.diagnostic`: a recognized local error `code`, observed `phase`, and
41
- `reused_socket` (boolean or unknown). Unknown codes/phases remain `unknown`.
42
- Diagnostics omit raw error text, endpoints, headers, keys and request content.
43
-
44
- Up to 16 uniquely named manual APIs and 500 unique models per API are supported. Model IDs are limited to 160 characters; `codex-auto-review` remains an internal alias. Custom model
45
- IDs are not filtered by a GPT/Claude prefix. Each model declares Messages,
46
- Responses and/or Chat Completions; optional stored `context_window` and
47
- `reasoning_efforts` metadata remain explicit. Chat-only records are catalog
48
- information, not converted into another client protocol. Saving automatically
49
- reads the catalog; failure does not undo saved configuration. Startup and the
50
- existing periodic model-refresh cycle refresh enabled APIs serially, using a
51
- 30-minute success cache and a one-minute failure cooldown. **Read models** can
52
- refresh sooner, but shares a one-minute cache with recent reads. Directory GETs
53
- use a 20-second total deadline, 8 MiB total body bound, 500 models and at most 25
54
- pages. Native `has_more`/`last_id` pagination uses only a validated `after_id`
55
- cursor on the configured catalog URL; arbitrary next URLs are never followed.
56
- An ID-only result has unknown protocol support until reviewed. Ordinary page
57
- reads use saved data; no discovery sends inference. `ccdx models` labels manual
58
- models as configured, not live. New catalog entries are candidates, never
59
- automatically granted to a client. An absent entry does not delete a saved model.
60
-
61
- For manual Messages APIs, CCDX writes Claude App's model configuration
62
- automatically. Standard Claude IDs keep their existing identity; other IDs use
63
- a stable `ccdx/claude-compatible-<digits>` route with `labelOverride` set to the
64
- real model ID. Reordering or adding models does not renumber existing routes.
65
- The App's model catalog advertises the same routes and real display names.
66
- Users do not need to add aliases manually. Owned configuration migrates through
67
- the existing field journal; custom or managed settings remain protected.
68
-
69
- Only the authenticated Claude App binding enables this translation. The gateway
70
- resolves routes against that source's allowed Messages models, sends real IDs
71
- upstream for Messages and token counting, and returns the requested route in
72
- JSON messages or SSE `message_start.message.model`. Other SSE frames, tool data
73
- and signatures are retained. Alias SSE framing is bounded by the existing event
74
- limit and follows client backpressure. Usage and request diagnostics keep real
75
- model IDs. Explicit multi-source bindings use source-qualified routes for Codex and both Claude clients. Unqualified legacy IDs resolve only when exactly one authorized deployment matches. Source/key history boundaries and native protocol semantics remain enforced.
76
-
77
- Some App requests include `system` messages as well as a top-level `system`
78
- field, including system notes after user content. For manual App connections,
79
- CCDX appends their text blocks to the top-level field in system-message order,
80
- retaining system priority, block metadata and the order/content of conversation
81
- messages. Non-text system content fails locally. Other clients and providers
82
- keep their existing payload paths.
83
-
84
- Compatibility routes address Claude App's model-name filter. A saved connection,
85
- successful model-list read or connection check does not prove complete App
86
- conversation, tool or thinking support for every upstream model.
87
-
88
- `connections.json` beside user settings (respecting `XDG_CONFIG_HOME`) stores a
89
- strict version-two graph of provider switches, API metadata, source grants and per-client model deployments/defaults. Version one is read with its original single-source visibility; the first write preserves original bytes in `connections.json.v1-backup`. A null deployment list retains the legacy source catalog; an explicit array exposes only its selected deployments. Migration never expands an old `allowed` grant into model visibility. It stores only credential references or an environment
90
- variable name. Keys use macOS Keychain service `codex-copilot-dx.manual-api`,
91
- Windows CurrentUser DPAPI-protected bytes, or Linux Secret Service (`secret-tool`).
92
- Unavailable protection fails without plaintext fallback. Headless installations
93
- may use `key_env` under Addresses & authentication; set the variable before CCDX
94
- starts. Its value is never returned by management or copied into client config.
95
- Private helpers omit unrelated credentials and Node hooks. API error bodies are
96
- replaced with stable codes; valid Retry-After metadata is retained.
97
-
98
- An explicit empty Codex deployment array pauses CCDX access, including after a
99
- restart or disabling the last selected source. Models, Responses and compact
100
- requests return `503 ccdx_client_source_disabled` before checking a client key;
101
- no upstream call, automatic model selection or login repair is attempted. Enable
102
- the app/source and select at least one model to resume. GitHub-only selections
103
- retain native OpenAI mode; nonempty mixed/API deployments retain private-key
104
- authentication. With automatic sync enabled, pausing restores only owned Codex
105
- configuration; manual sync leaves native files unchanged. Neither changes login.
106
-
107
- `client-gateway-keys.json` holds local credentials separately. Disabled sources leave normal source lists. **Model sources** owns **Disabled sources**; application access cards own **Disabled clients**. App navigation remains available while access is closed, so its restoration control stays reachable. Each
108
- collapsed list appears only when it has entries and provides **Enable again**.
109
- Closing a client stops CCDX access, not the app. Disabling an in-use source
110
- requires explicit replacements or pauses. Pinned API streams finish on their
111
- original provider; retired transports/keys are released afterwards. Legacy M365
112
- work is guarded before its old gateway is removed. Recovery preserves grants,
113
- configuration and historical usage without choosing a current source. With a
114
- managed graph, `m365 off` pauses affected bindings; `m365 remove` preserves shared
115
- Claude ownership records still needed by APIs.
116
-
117
- Claude's existing field-owned journal protects custom/managed edits. Manual
118
- clients use the existing profile with generic name CCDX; M365's beta restriction
119
- is not imposed on APIs. Only an unchanged owned restriction is restored. Adding
120
- an API alone does not migrate existing M365 client credentials. First explicit
121
- Claude connection management installs private client keys; reopen affected apps.
122
- Codex reconciliation owns provider selection, the selected model, the private
123
- provider table and, in native mode, `openai_base_url`. GitHub-only selections use
124
- this base URL with the built-in `openai` provider; fresh native setups create no
125
- custom provider table. The App therefore keeps its native provider branch.
126
- An unchanged old `ccdx_gateway` table is retained inactive during migration so
127
- existing sessions can still resume their recorded provider. New sessions use
128
- `openai`; existing session files are never rewritten to disguise their provider.
129
-
130
- The versioned ownership journal records exact prior/owned declarations and
131
- supports native/private switching and restoration. Startup defers an owned base
132
- URL to this reconciliation instead of overwriting preserved user edits. Identical
133
- setup does not rewrite the file. A missing default keeps its identity and does
134
- not prevent a safe native route repair. User model/base edits remain protected.
135
- Reconciliation never writes `auth.json` or replaces native credentials.
136
-
137
- Non-GitHub deployments retain the private provider/local-key route. Existing
138
- native sign-in or credential-store policy keeps `requires_openai_auth = true`;
139
- a fresh API-only profile remains usable without ChatGPT login. Native account
140
- operations retain their own authentication. App custom-provider controls can
141
- differ from native OpenAI controls; CLI catalogs do not prove App UI parity.
142
- Reopen Codex after an owned provider/authentication configuration change.
143
-
144
- GitHub-only explicit bindings preserve the legacy native loopback access contract,
145
- including requests from a process that has not yet reloaded its configuration.
146
- Their catalog comes from the selected deployments, not a second live Copilot read.
147
- Adding any non-GitHub deployment requires the private Codex key for the entire
148
- catalog and all bound inference requests. Unselected models remain refused.
149
- A supplied non-Codex bearer receives a local 403, not a ChatGPT 401 refresh
150
- challenge. Missing credentials still receive 401; neither denial reaches upstream.
151
- Temporarily unavailable selected models remain visible in the application editor.
152
- Saving them fails without changing prior settings; refresh the catalog or explicitly
153
- clear the affected selection. A missing directory entry never means deselection.
154
-
155
- GitHub catalog reads in Model sources share the running model registry and endpoint cache with Codex. A successful read updates available candidates without selecting new models, changing defaults or rewriting client files. Concurrent reads join one refresh. An explicit failed refresh remains an error while the prior catalog is retained; an account change during the read prevents publication under the new identity.
156
-
157
- A manual Codex provider includes an authenticated `model_catalog_url` on the same
158
- listener. Native app-server catalogs list configured names; the App may still use
159
- its custom-provider UI for non-GitHub selections. Unknown names
160
- use conservative metadata without borrowed model instructions, invented context,
161
- vision, web search or Fast claims. API-specific Auto Review uses its configured
162
- model and advertised efforts; following the client does not synthesize low.
163
- See the official [provider configuration](https://learn.chatgpt.com/docs/config-file/config-advanced#custom-model-providers)
164
- and [gateway catalog requirements](https://learn.chatgpt.com/docs/enterprise/roll-out-a-gateway#use-a-model-catalog-for-custom-names).
165
-
166
- Responses namespaces include API configuration/key identity. Managed native
167
- histories retain at most 1,024 HMAC-only correlation/owner pairs in
168
- `conversation-sources.json`. No prompt, raw session ID or key is stored. A known
169
- session or first-message correlation that changes source/key returns 409 before
170
- forwarding history. This is bounded observation, not proof of the provenance of
171
- unseen external history. Start a new conversation after source/key changes; do
172
- not transfer opaque reasoning, compaction or signed history between services.
173
- There is no automatic load balancing, fallback or cross-source history replay.
174
-
175
- `/_ccdx/ui/connections` requires loopback, the dashboard header, same-origin JSON
176
- POSTs and a 256 KiB body bound. It returns redacted configuration and explicit
177
- action results. Invalid/conflicting files are retained. The ordinary two-second
178
- status returns compact source/client summaries, not all model records. Metrics
179
- allow the two built-ins plus 16 APIs (18 labels plus bounded `other`). Aggregate
180
- Claude observation covers all Messages sources; M365 counts keep their own scope.
1
+ # CCDX reference
2
+
3
+ For installation and first use, start with the [README](../README.md). This reference covers operations and the limits that affect them. Supported systems are macOS and Windows, x64 and ARM64.
4
+
5
+ ## Commands
6
+
7
+ `ccdx` is the only executable. Commands and help use one grammar. Use `ccdx help <path>` or append `--help`; old roots and flag aliases are not accepted. Existing saved settings remain readable.
8
+
9
+ | Group | Operations |
10
+ | --- | --- |
11
+ | `ccdx` / `ccdx start` | Start or reuse the foreground gateway |
12
+ | `ccdx web` | Open the Web UI, or start management without signing in |
13
+ | `ccdx status` | Show runtime and app configuration; `--details` expands diagnostics |
14
+ | `ccdx source list` / `source add` | List sources or add an API |
15
+ | `ccdx source <id> status` | Read saved account and catalog evidence |
16
+ | `ccdx source <id> models [--refresh]` | Read cached models, or explicitly refresh the source |
17
+ | `ccdx source <id> check` | Check source access without inference |
18
+ | `ccdx source <id> access --edit` | Choose allowed apps |
19
+ | `ccdx source <id> enable` / `disable` | Change source access; disabling reviews affected apps |
20
+ | `ccdx source <id> edit` / `remove` | Edit an API, or remove a disabled, unbound API |
21
+ | `ccdx source github login` / `reauth` / `logout` | Manage the saved GitHub account |
22
+ | `ccdx source m365 accounts` / `account` | List local company accounts or select one |
23
+ | `ccdx app list` | Show client setup and observed activity |
24
+ | `ccdx app <id> status [--details]` | Read client configuration and scoped features |
25
+ | `ccdx app <id> models --edit` | Choose visible models and a default |
26
+ | `ccdx app <id> sync --preview` | Preview the model/configuration plan |
27
+ | `ccdx app <id> sync` | Write client settings owned by CCDX |
28
+ | `ccdx app <id> enable` / `disable` | Change access without quitting the app |
29
+ | `ccdx app codex prediction …` | Native suggestion setup and diagnostics |
30
+ | `ccdx app codex image …` | Image setup and diagnostics |
31
+ | `ccdx app codex review status` / `select` | Read or choose the review model |
32
+ | `ccdx config show [--effective]` | Read saved preferences and effective state |
33
+ | `ccdx config set <key> <value>` | Save a validated preference |
34
+ | `ccdx config terminal` / `animation` | Choose terminal appearance |
35
+ | `ccdx config limits [--decoded MiB]` | Read or change the decoded request limit |
36
+ | `ccdx config reset --preview` / `restore` | Preview defaults or restore the pre-reset backup |
37
+ | `ccdx requests [--failed] [--active]` | Inspect retained requests |
38
+ | `ccdx requests show <request_id>` | Read one retained request |
39
+ | `ccdx usage [--scope all\|run] [--provider ID]` | Read recorded usage or current-run usage |
40
+ | `ccdx doctor [--online] [--compat] [--fix] [--json]` | Check local setup; optional access checks and repairs |
41
+ | `ccdx doctor config` / `network` / `report` | Read configuration, routing or a redacted local report |
42
+ | `ccdx doctor cache [--limit MiB\|default]` | Inspect runtime buffers or change their limit |
43
+ | `ccdx doctor cache --clean [--history] [--yes]` | Clear rebuildable data; history cleanup requires confirmation |
44
+ | `ccdx update check` / `update github` / `update npm` | Check or install an update |
45
+ | `ccdx version` | Show the installed package version |
46
+
47
+ Client IDs are `codex`, `claude-app` and `claude-code`. Source IDs are listed by `source list`. Read-only management commands support `--format table|plain|json`. They do not start an app or a gateway. Native image/suggestion status also reads local setup when the gateway is stopped; JSON includes the saved configuration flag and the same public details. Management operations need the running service; use `ccdx web` to start it without launching a client.
48
+
49
+ `start` supports `--no-browser`, `--verbose` and `--show-request-id`. The normal TUI has one source summary and one app table. It labels the Web UI address directly. `Unchanged` means existing client settings were kept; `Configured` means the configuration write/check succeeded. Neither is proof that a client process has loaded that configuration. Warnings and sign-in instructions remain visible during startup. The final activity row reflects observed model work. Ctrl+C stops the foreground service.
50
+
51
+ For scripts, source access accepts `--apps codex,claude-app` with `--edit`; edits use confirmation or `--yes`. API/model edits accept `--file`. An API key uses the private prompt, `--key-stdin`, or an environment reference, never a command argument or metadata file. Source removal requires a disabled API with no client binding. Disabling an in-use source requires explicit replacement choices in scripts; `--yes` alone does not choose them.
52
+
53
+ An app model file contains `deployments: [{"source":"github","model":"<model-id>"}]`, with optional `default_model` and `auto_sync`. An explicit empty array clears the default and pauses access. A file without `deployments` is rejected. Unavailable saved selections remain visible until the user changes them.
54
+
55
+ ## Sources and client access
56
+
57
+ Upgrades retain saved account bindings, source IDs, key references, model choices/defaults and capability overrides. Native account stores keep their existing owner; bookkeeping does not request another login. Unchanged client settings need no repeat save or synchronization. Explicit user changes and ordinary credential renewal keep their current behavior.
58
+
59
+ Sources own accounts, API addresses, keys and model capabilities. Apps own visible models and defaults. Allowing an app to use a source does not select all its models. Selecting no models pauses that app. Settings owns service preferences and appearance, not model routing. An unchanged graph save keeps the file bytes and modification time; explicit sync, refresh and credential actions still run. Existing v1 configuration is backed up byte-for-byte before its first v2 write; reads do not migrate files.
60
+
61
+ In the Web UI, **Model sources → Add API** saves the source and immediately reads its catalog. A failed read keeps the saved source and editor. Select supported models and their declared interfaces before assigning them to apps. Catalog details expand without shifting columns. API-editor capability details open below their model row; manual overrides are separate from reported metadata.
62
+
63
+ Manual APIs require HTTPS. Codex requires Responses; Claude requires Messages. CCDX does not invent an interface, token-count result, reasoning level or web-search capability absent from the source declaration. Returned maker/name metadata is displayed separately from the source name. Model IDs are not used to guess a maker.
64
+
65
+ A running request stays with its original source, credential revision and capabilities. Refreshing a catalog does not select models or change defaults. Failed reads keep last-good data with failure evidence; they do not trigger inference, re-login or source switching. Normal API refresh uses a 30-minute cache and a one-minute minimum interval after explicit reads or failures.
66
+
67
+ Codex selections containing only GitHub models keep native OpenAI mode and readable names. Other selections use the client's private local gateway credential. Paused access is rejected before credential validation. CCDX does not write or clear native ChatGPT sign-in data. When models are missing after a client update, check the selected models and run `ccdx doctor`; fully quit and reopen the app before changing credentials.
68
+
69
+ Claude App and Claude Code use separate keys on `http://127.0.0.1:2026/anthropic`. Compatibility aliases are internal; visible model names follow source metadata. Client synchronization respects manual/managed fields and records ownership for restoration. Already-running clients may need a normal restart.
70
+
71
+ Claude App can continue an existing conversation on another selected, authorized source when complete Messages history is available. Unfinished tool turns, unavailable attachments and company-account isolation are checked before transfer. Opaque signed or compacted history is not transferable between services. Codex and Claude Code keep their existing continuation rules. A 409 is a history/isolation conflict; it does not by itself mean the selected model is unavailable.
72
+
73
+ ## Microsoft 365
74
+
75
+ Supported company environments discover local accounts at startup. Access depends on the account, tenant, device policy and service entitlement. Optional failure does not block another source.
76
+
77
+ Choose consuming apps under **Model sources → Microsoft 365 → Allowed apps**. Read the company catalog with `ccdx source m365 models --refresh`; this sends no inference. Use `source m365 accounts` to list accounts or `source m365 account` to choose one. Existing explicit account selection takes priority, followed by an exact Windows work-account match or the single available company account. Account changes require a new conversation.
78
+
79
+ Catalog diagnostics distinguish local cached data from an online response and expose check time, service origin, HTTP status, last success and service request ID when available. Model counts can differ across environments. A 403 alone does not prove a stale cache, an expired account or a changed endpoint. Do not repeatedly sign in or probe inference to diagnose catalog failures.
80
+
81
+ ## Checks and troubleshooting
82
+
83
+ - **Saved account, access denied:** use source status/check to distinguish the saved credential from current access. `source github reauth` replaces sign-in only after a successful new login. Other apps' credentials are read-only.
84
+ - **No client models:** inspect allowed sources, selected models and unavailable selections. An empty selection means paused access, not missing credentials.
85
+ - **Configuration unchanged:** CCDX kept existing settings. Preview the intended plan before syncing; do not overwrite managed settings to force success.
86
+ - **Request failure:** use Requests or `ccdx requests --failed`. HTTP failures and model completion outcomes are separate. A successful HTTP transport can still carry a model error.
87
+ - **Token counting unavailable:** an observed API count-endpoint 404 is cached briefly per model/header scope. Inference and token counting are separate capabilities; no synthetic count is returned.
88
+ - **Local checks:** `doctor` is read-only by default. `--online` checks access; `--compat` sends minimal inference and consumes usage. `--fix` backs up owned configuration and performs bounded repairs. It does not enable optional features, change company policy or force-restart apps. Partial repairs exit 1.
89
+ - **Cache cleanup:** adding `--history` can break the next continuation. It does not delete client transcripts or generated images.
90
+
91
+ Request inspection covers bounded retained records, not a full conversation archive. Unidentified clients stay unidentified. Routine diagnostics omit secrets, prompts and error bodies. Explicit error excerpts use bounded, redacted collection. The usage JSON `requests` field counts recorded usage rows, not HTTP calls. Usage is returned token metadata; cache hit is reused input divided by input, with unknown/partial data indicated. It is not a request-based cache rate or a billing receipt.
92
+
93
+ ## Settings and appearance
94
+
95
+ Settings separates saved preferences from effective state. Auto-save applies changes by default; required restarts remain explicit. Restore-defaults creates a backup first and keeps accounts, keys, model plans and chats. CLI preference reset/restore uses its own service-only backup; it does not change browser appearance or replace the Web UI's backup.
96
+
97
+ Web and terminal colors are independent. Web appearance is browser-local. The terminal keeps its selected color and animation; NO_COLOR, dumb/non-TTY and narrow output remain supported. Reduced motion disables decorative movement. Closed tabs and hidden views stop scheduled work. Model/usage data loads on demand; the Web UI adds no inference calls.
98
+
99
+ ## Installation and updates
100
+
101
+ Use the installers linked in the [README](../README.md) when Node.js is unavailable. They support macOS and Windows on x64/ARM64, reuse a compatible Node.js, or install verified Node 24.22.0 privately. They do not install Git, compilers or system package managers, or change company registry/proxy/certificate/shell policy.
102
+
103
+ Complete Release packages include locked runtime dependencies. The updater verifies package identity, version and digests before installation, backs up the discovered package and launchers, and restores them on installation/runtime-check failure. A busy installation fails in place. Lock errors include the lock path; do not delete a lock held by another install.
104
+
105
+ `ccdx update github` uses the latest stable Release. Normal source-package installation uses the configured registry. After npm EALLOWREMOTE, the updater can use a verified same-version complete platform package without relaxing npm policy. Other failures are not retried across arbitrary sources. Explicit `--allow-remote` grants URL downloads to that installation's whole dependency tree, not one hostname; use it only if policy permits. No persistent npm setting changes.
106
+
107
+ Finish active work before updating the active installation, then restart CCDX normally. The installed package version can differ from the running process. No interruption-free upgrade is promised for an ordinary foreground service.
108
+
109
+ Overnight updates are opt-in. The supervised service checks within its local midnight window, stages only eligible patches in the same minor version, and waits for idle work before handoff. Candidates must be published for at least 24 hours. Failed preparation/handoff retains or restores the previous service. Enabling this feature requires its documented normal restart; it does not attach a supervisor to an existing ordinary process. Minor upgrades such as 1.2 → 1.3 remain manual.
110
+
181
111
 
182
112
  ## Model capabilities and Claude synchronization
183
113
 
@@ -283,256 +213,8 @@ sync shows declared capabilities, supported budgets and limitations. Reopen the
283
213
  client after its owned configuration changes. All tests using sample capabilities
284
214
  are isolated; they do not assign sample limits to a user's real models.
285
215
 
286
- ## Microsoft 365 provider
287
216
 
288
- Starting with 0.10.0, CCDX can discover authorized M365 models independently of
289
- Copilot CLI. This is not restoration of the retired personal-GitHub Claude profile
290
- or PM Studio patch. The core Codex provider remains GitHub until explicitly changed.
291
-
292
- ```bash
293
- ccdx m365 status
294
- ccdx m365 models
295
- ccdx m365 accounts
296
- ccdx m365 account
297
- ccdx m365 account --id aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
298
- ccdx m365 switch
299
- ccdx m365 switch m365 --model gpt-6-sol --auto-review-model gpt-6-sol
300
- ccdx m365 switch github
301
- ccdx m365 off
302
- ccdx m365 on
303
- ccdx m365 remove
304
- ccdx usage --provider m365
305
- ccdx usage --provider github
306
- ```
307
-
308
- The model IDs above are examples, not guaranteed entitlement. `switch` checks the
309
- current M365 catalog before committing. Interactive mode asks for the provider,
310
- Codex GPT model and Auto-review model; scripts must supply available IDs (or reuse
311
- previously saved valid choices). Switching requires the running updated adapter.
312
- It affects subsequent requests, not in-flight streams. Existing Codex threads keep
313
- their selected model: choose an available M365 model in the App. Unavailable
314
- models return a clear error instead of being aliased. There is no automatic
315
- cross-provider failover, quota borrowing or organization/account substitution.
316
-
317
- Startup uses the official optional `@azure/msal-node-runtime` 0.20.6 package in a
318
- short-lived Node helper. It discovers OS broker accounts and calls silent token
319
- acquisition only. It neither launches a login UI nor reads Copilot CLI tokens.
320
- macOS requires MDM enrollment and a working Microsoft Enterprise SSO broker;
321
- Windows uses its Microsoft account broker. Tenant policy, device compliance,
322
- account authorization and Loki entitlement still decide access. Saved bindings remain selected, including bindings created before account selection was added. Without a binding, Windows runs its system `whoami.exe /upn` once when multiple candidates exist (2.5-second limit) and accepts only a unique exact case-insensitive match with a discovered company account. It does not use the device enrollment identity, environment username, email suffix or list order. Local sign-ins, unsupported UPN lookup and shared UPNs fall back to a single company account or explicit selection. The Node broker has no explicit current-OS-account flag; a UPN match is not a SID/object-ID or device-compliance check. Entra/hybrid enterprise environments still need their own validation.
323
-
324
- Duplicate stable account/tenant records are merged only when their identity metadata agrees. Conflicts and multiple remaining accounts require user action. Personal Microsoft consumer-tenant accounts are excluded. Windows local sign-in with an Office company account works only when the broker can discover that account; Office's sign-in UI does not prove broker visibility or model entitlement.
325
-
326
- Use **Model sources → Microsoft 365 → Company account** or `ccdx m365 account` to choose. `ccdx m365 accounts` performs local discovery only; its opaque IDs can be passed as `ccdx m365 account --id ID`. These commands require the updated running service. Selection rediscovers accounts, rejects stale IDs, authorizes only the selected account and fetches its catalog once before committing. Failure retains the previous binding/catalog. Active M365 requests or startup work prevent selection; new M365 requests are refused during validation, while GitHub remains independent. Account changes apply to both M365 GPT and Claude; the selected Codex provider and saved model choices are not silently changed. Models missing from the new catalog require an explicit model choice. No interactive Microsoft sign-in UI is opened automatically. Interaction requirements, policy refusal or a missing native package leave M365 unavailable. None of these invalidate GitHub credentials.
327
- The GitHub-selected Codex path retains its existing first-run GitHub login flow.
328
-
329
- The optional package download is approximately 14.6 MB, contains prebuilt binaries
330
- and has no install script or runtime dependencies. It is not bundled Copilot CLI.
331
- If this optional broker alone is unavailable, core GitHub/prediction/image behavior
332
- remains available with the existing dependencies installed. Do not use a blanket
333
- `--omit=optional` workaround: sharp still needs its platform-specific optional binaries.
334
- M365 is enabled automatically only on macOS/Windows; Linux reports it
335
- unsupported. The `CCDX_M365` environment control accepts `0` to suppress M365 startup for that process. It does not
336
- restore existing client settings; use `m365 off` for that explicit operation.
337
-
338
- Entra tokens are retained in memory until renewal/close, never saved in a CCDX
339
- credential file. Renewal is silent and single-flight, with a 28-second helper
340
- deadline and one-minute failure backoff. The provider uses only
341
- `https://loki.delve.office.com/api/v1/llmapi`; discovery uses `/models` and
342
- inference uses its advertised native Responses or Messages endpoints. This is a
343
- private service, not a promised public SLA. Its fixed origin is shared by the Node and Windows target policies; authentication resources and company network policy are unchanged. No request is redirected to another
344
- origin. Model caches and replay namespaces are bound to this service origin and account. A legacy cache with no origin, or one from the prior dogfood origin, is preserved on disk but is not published as this environment’s catalog; a successful discovery replaces it. Disabled sources and saved client/model selections are not automatically changed. Explicit proxy/trust settings are preserved. Windows delegates system
345
- PAC/WPAD and integrated authentication to its own isolated WinHTTP worker;
346
- unsupported macOS dynamic PAC is reported rather than bypassed.
347
-
348
- System `ExceptionsList` entries such as `169.254/16`, `10/8`, `172.16/12` and `192.168.1/24` are normalized to full four-octet IPv4 CIDRs before the existing shared Node/PAC matcher. Missing octets become zero only when the supplied octets cover the prefix; invalid octets, ambiguous leading zeros, out-of-range or underspecified prefixes remain errors. User-supplied `NO_PROXY` retains its existing strict syntax. No system setting, proxy bypass policy, DNS lookup or network probe is added. The shared system-input correction also applies to prediction environment parsing.
349
-
350
- M365 proxy-setup failures retain their existing outer category (`m365_proxy_settings_unsupported`, `m365_proxy_discovery_failed`, or the existing environment-failure category `m365_network_error`) and add an optional `network_diagnostic`: fixed `source` (`system`/`environment`), `stage` (`proxy_discovery`/`proxy_config`) and `cause_code`. Causes distinguish discovery, dynamic PAC/WPAD, invalid bypass rules, invalid static settings and invalid/unsupported proxy addresses; unknown causes stay generic. CLI/startup explain the specific cause without suggesting a new sign-in for a known network setup failure. WebUI shows the bilingual reason in source status (codes in its tooltip) and the existing model-check details, with source/stage/cause fields. Proxy URLs, credentials, raw settings and raw nested errors are never projected. These local setup failures happen before the model HTTP request; a local 502/503 does not establish a model-service denial. Successful transport setup or a later unrelated refresh failure clears the previous setup diagnostic. Failed catalog reads still remain failures and preserve last-good data; they are not successful empty catalogs. No automatic route substitution or extra polling is added.
351
-
352
- The M365 profile under `~/.local/share/codex-copilot-dx/profiles/m365/` contains
353
- `settings.json`, nonsecret `account.json`, account-bound `models.json`, a private
354
- local `gateway.json` key, and `client-config.json` field ownership. JSON reads are
355
- bounded at 4 MiB and regular files only; new owned files use private permissions.
356
- Codex source and M365 review choices live separately in
357
- `~/.config/codex-copilot-dx/providers.json` (or under `XDG_CONFIG_HOME`). Existing
358
- GitHub auth/cache/preferences, Codex auth, prediction trust and image keys are not
359
- copied into the M365 profile. The system's Microsoft SSO account is never deleted.
360
-
361
- M365 catalogs refresh at startup and on explicit lookups. Existing model-list
362
- reads and Claude Messages traffic start a background refresh after two hours;
363
- disk caches older than seven days are rejected. `ccdx models` and Auto-review's
364
- selector follow the selected Codex source. Dashboard tabs query a registered
365
- Provider independently of that selection; M365 uses a fresh provider catalog
366
- lookup and labels the returned catalog timestamp. Its disabled/hidden or
367
- ineligible models remain visible as directory metadata, with no eligible client.
368
- Client discovery and request validation still exclude wrong publishers/protocols
369
- and disabled/hidden models. A listing does not prove inference access or quota.
370
- M365 Fast is unverified and `priority` requests fail explicitly; choose Standard.
371
- GitHub Fast behavior is unchanged.
372
-
373
- M365 Auto-review has its own required model choice and defaults to low reasoning.
374
- `ccdx auto-review-model` changes that provider's model/effort without touching the
375
- GitHub preference or falling back to its cached catalog. Native prediction still
376
- uses the conversation's selected model through the normal Codex endpoint. The
377
- optional image MCP/skill/API remains separately configured and off by default.
378
-
379
- ### Claude gateway and client ownership
380
-
381
- Claude App ordinary model synchronization compares the model-list JSON by its
382
- structure. The App-owned boolean `prefer1m` may change without blocking managed
383
- model additions or removals; its explicit true/false value is preserved by exact
384
- model identity while 1M support remains declared. New entries with declared 1M
385
- support default to `prefer1m: true`, so the App shows one 1M option rather than
386
- separate standard/1M rows. Unknown or smaller windows are not promoted to 1M.
387
- Names, display overrides, effort caps, unknown fields and meaningful model order
388
- changes retain strict ownership protection. Invalid JSON, duplicate identities or
389
- invalid preference types are preserved rather than rewritten.
390
-
391
- When a prior manual recovery already exactly matches the generated selected list,
392
- a previous ownership record may be refreshed without rewriting the App profile.
393
- Surviving old entries must retain their non-preference fields and relative order;
394
- the original restoration value is kept. An unowned model list is not claimed just
395
- because it happens to match. Non-model fields and restoration keep their existing
396
- strict ownership checks. Restart the App normally if its loaded model menu is
397
- older than the saved profile. Source/key changes in an existing conversation still
398
- require a new conversation; this patch does not relax that isolation.
399
-
400
-
401
- Company-account history is isolated. `conversations.json` stores at most 1024 hashes of conversation identifiers (or the first user item when no native identifier exists) and their account fingerprints; no messages, raw session IDs or tokens are stored there. Each new conversation writes its ownership once; known conversations use memory. After changing accounts, known foreign conversations are refused before forwarding. Unknown requests containing old history are also refused, including after restart; use a new conversation. Clients without stable conversation IDs can collide when their first user item is identical, so supply a unique native session ID. Evicted/unrecognized history fails closed after a switch. The history-isolation marker is saved with the binding and survives token renewal. Removing the M365 profile clears this ownership file, but never removes system sign-in or usage history.
402
-
403
- Account selection stages the new authorization/catalog before replacing the old provider. Catalog and binding writes use the existing locked atomic writer with restoration on failure; this is not a crash/power-loss transaction. Client configuration remains a separate readiness state: its failure does not claim that account authorization failed or overwrite custom/managed fields. Previously saved model preferences are not substituted when the new account lacks those models.
404
-
405
- Since 1.1.0, Claude mounts under the main HTTP listener at
406
- `http://127.0.0.1:<ADAPTER_PORT>/anthropic` (default main port 2026).
407
- It exposes `GET /anthropic/v1/models`, `POST /anthropic/v1/messages` and
408
- `POST /anthropic/v1/messages/count_tokens`. The Claude Base URL excludes the final `/v1`.
409
- The local socket, loopback Host, native-client Origin rejection and private Bearer
410
- or `x-api-key` checks remain independent of any main-listener LAN opt-in.
411
- Messages tools, thinking, signatures, image blocks, beta headers and SSE retain
412
- their native protocol and backpressure/cancellation handling. Provider-specific
413
- cache policy is described below; the local gateway key is never forwarded upstream.
414
-
415
- The protocol handler owns only its responses, never the shared server. Codex,
416
- WebUI and Claude share the main port; native prediction keeps its CONNECT/PAC
417
- transport and saved port. Root `/v1/messages` remains retired, including on a
418
- custom main port. Claude requests never reach GitHub. M365 GPT-only catalogs do
419
- not configure Claude. Optional Claude setup failure leaves the Codex backup independent.
420
-
421
- Unchanged CCDX-owned Code/App addresses migrate from 2027 to the shared prefix,
422
- with the original restoration values preserved. User-edited fields, managed
423
- settings and explicit environment routes remain preserved. CCDX does not keep
424
- a permanent 2027 compatibility listener; migrate hand-written old URLs explicitly.
425
- Already-running clients may need a normal restart to reload their base URL.
426
- Disabling/removing M365 is rejected while its Codex or Claude inference is active,
427
- so an accepted disable does not cut off those requests.
428
-
429
- Loki explicitly rejects one-hour prompt-cache retention. M365's request policy
430
- caps standard `cache_control: {type: "ephemeral", ttl: "1h"}` fields to `5m`,
431
- logs that limitation once and counts adjustments in its status. Prompt bytes,
432
- breakpoint positions, tool input, thinking and approval settings do not change.
433
- This is a retention/cost limitation of the new M365 path, not an equivalent
434
- one-hour cache guarantee. GitHub caching is unchanged.
435
-
436
- The gateway publishes canonical Claude version IDs such as `claude-opus-5-5`,
437
- while M365 receives its exact `claude-opus-5.5` ID. Existing raw IDs are still
438
- accepted. Only exact supported family/version spellings are normalized; alias
439
- collisions fail explicitly. Bodies, thinking signatures and native response bytes
440
- remain intact apart from the existing cache-TTL policy and the upstream model ID.
441
-
442
- `capabilities.supports.reasoning_effort` supplies deployment-specific effort
443
- metadata. App `inferenceModels` entries receive the highest recognized advertised
444
- `maxEffort`; Code discovery receives canonical IDs. A successful catalog refresh
445
- reconciles unchanged owned fields outside inference serialization. An owned legacy
446
- Code default can migrate to its matching canonical ID; valid user model/effort
447
- preferences are preserved. Reads after a profile change invalidate page catalogs.
448
- Unknown metadata stays unknown. Unknown effort names remain visible as upstream
449
- metadata and are not invented as App caps. When an explicit effort list exists,
450
- requests for absent efforts fail before inference, without dropping the field or
451
- substituting a lower level. Missing metadata leaves the upstream authoritative.
452
-
453
- App effort controls also depend on its model knowledge. Supported versions can
454
- read Anthropic's signed catalog under the App's existing network and management
455
- policy; CCDX neither replaces that signed document nor changes its URL/policy.
456
- `maxEffort` is a ceiling, not an arbitrary discrete allowlist: client-visible
457
- options may differ from an upstream's sparse list, while exact request validation
458
- remains authoritative. Unknown model identities or new protocol semantics can
459
- still need a client or CCDX update. A displayed control alone is not an inference
460
- verification. See [Claude model configuration](https://claude.com/docs/third-party/claude-desktop/configuration)
461
- and [gateway behavior](https://code.claude.com/docs/en/llm-gateway-protocol).
462
-
463
- For Claude Code, CCDX owns only its gateway environment fields in
464
- `CLAUDE_CONFIG_DIR/settings.json` or `~/.claude/settings.json`. For Claude App it
465
- uses the installed client's third-party config library, with one named
466
- `CCDX Microsoft 365` profile and the normal third-party deployment setting.
467
- macOS stores the owned App configuration below `~/Library/Application Support/Claude-3p`;
468
- Windows uses `%LOCALAPPDATA%/Claude-3p`. First-party Claude configuration is not modified.
469
- See the [official desktop configuration contract](https://claude.com/docs/third-party/claude-desktop/configuration).
470
- Existing foreign gateways,
471
- cloud-provider choices, other selected App profiles and detected managed desktop
472
- policies are preserved. No binary patch, system certificate, execution-policy
473
- change or forced App restart is performed. An already-running client can require
474
- its normal restart to read the saved settings; “configured” is not proof of a
475
- visible chat or successful reply.
476
-
477
- Claude Code 2.1.295 emits experimental fields that this Loki API rejects with
478
- `invalid_body`. Owned gateway setup therefore supplies the documented
479
- `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1` compatibility option when no explicit
480
- environment override exists. Existing user values are preserved. This leaves
481
- standard tools, thinking and prompt-cache fields available; first-party-only beta
482
- features are not promised. CCDX does not silently delete conversation content,
483
- disable approval checks, or retry inference with reduced semantics. See the
484
- [official variable reference](https://code.claude.com/docs/en/env-vars).
485
- For Codex, both verified providers reject native image-generation declarations;
486
- their explicit request policy retains CCDX image function/MCP tools instead.
487
-
488
- `off` selects GitHub, stops M365 and restores only unchanged owned Claude fields.
489
- `remove` additionally removes CCDX's account/catalog/gateway/ownership files,
490
- while retaining the disabled preference and historical usage. Active M365 requests
491
- block removal; user-modified fields block full cleanup and are reported, not
492
- deleted. Neither operation clears Codex transcripts or shared image output.
493
-
494
- ### Isolation and measurements
495
-
496
- Each request is pinned to its provider. Response IDs/history are namespaced by
497
- provider and account inside the existing shared history-byte limit; this is not a
498
- second unbounded history cache. Explicit switching can replay complete visible
499
- history. Foreign encrypted reasoning is not forwarded; opaque tool/compaction
500
- state requires verified local plaintext recovery, otherwise the request fails
501
- without discarding earlier context. No automatic cross-source retry is performed.
502
-
503
- CLI usage and WebUI include source filtering; historical records without a source
504
- are treated as GitHub. Claude's cache-read/cache-write input is included in its
505
- normalized total input, with raw reported usage retained. Missing counts remain
506
- unknown. Combined totals are labeled; identical model names across providers can
507
- be separated with the filter. The M365 status card separates auth/catalog state,
508
- gateway availability, client configuration and selected Codex source. Observed
509
- client requests are not claimed to prove the App's UI state. `doctor --online`
510
- checks the selected provider; `doctor --fix` does not reimport inactive GitHub auth.
511
- Claude gateway outcomes are displayed separately; core HTTP totals retain their
512
- existing main-listener meaning rather than mixing in another protocol's counts.
513
-
514
- CCDX is a local compatibility adapter for Codex App. It configures Codex to use an OpenAI Responses API on loopback while GitHub authentication, model discovery, and inference stay backed by GitHub Copilot.
515
-
516
- ## How it works
517
-
518
- ### Retired prediction integration
519
-
520
- The manual prediction MCP, automatic Stop hook and dashboard panel are removed.
521
- CCDX does not install a prediction skill or replacement predictor. Startup disables
522
- the old `suggestion.json` preference and removes only unchanged CCDX declarations
523
- from the active `CODEX_HOME/config.toml` (or `~/.codex/config.toml`).
524
- `CCDX_SUGGESTION_CONFIG` still identifies the legacy settings path for cleanup.
525
- For an immediate cleanup without starting the adapter, run `ccdx suggestion off`.
526
- The old `suggestion on` and `suggestion model` commands cannot re-enable it.
527
-
528
- Modified, inline and profile-specific declarations are preserved. Cleanup failures
529
- do not block the core adapter. Saved model preferences and old candidate files are
530
- not deleted; they are inactive. Native Codex preference settings, hook trust records,
531
- other hooks and the optional image MCP are untouched. Two inert compatibility
532
- entrypoints prevent user-modified registrations from invoking a removed module:
533
- the old Hook exits with an empty result, and the old MCP exposes no tools or panel.
534
-
535
- ### Optional native predictions
217
+ ## Optional native predictions
536
218
 
537
219
  Native next-message predictions are **off by default** and use no MCP, Hook, skill,
538
220
  panel, renderer injection, or client-program modification. This compatibility
@@ -638,15 +320,15 @@ have the separate restart/setup requirements described below.
638
320
 
639
321
  ```bash
640
322
  # Fully quit Codex App first.
641
- ccdx prediction on
323
+ ccdx app codex prediction setup
642
324
  # Restart the running CCDX process, then launch Codex through ccdx.
643
325
  ccdx
644
- ccdx prediction status
326
+ ccdx app codex prediction status
645
327
  # Repair only an already-enabled bridge in a compatible running CCDX service:
646
- ccdx prediction fix
328
+ ccdx app codex prediction repair
647
329
 
648
330
  # To remove the optional setup, fully quit Codex first:
649
- ccdx prediction off
331
+ ccdx app codex prediction remove
650
332
  ```
651
333
 
652
334
  Enabling explicitly adds a private certificate trust record to the selected App
@@ -746,7 +428,7 @@ requests can fail during an outage and are never replayed by this supervisor.
746
428
  Disabled prediction startup creates no recovery timer. The existing in-memory
747
429
  overlay switch still observes explicit on/off changes independently.
748
430
 
749
- `ccdx prediction fix` asks the running adapter for one explicit repair, without
431
+ `ccdx app codex prediction repair` asks the running adapter for one explicit repair, without
750
432
  starting another core service or forcibly restarting Codex. Disabled predictions
751
433
  remain off. Healthy/current bridges with unchanged environments are kept; a failed bridge or changed App identity
752
434
  reuses the saved port, certificate and verified profile. Compatibility, certificate,
@@ -820,410 +502,13 @@ route state, recovery attempts and recoveries. These are independent of the
820
502
  unknown candidate-visibility value. A successful recovery only means the bridge
821
503
  was recreated on the original address, not that gray text appeared.
822
504
 
823
- ### Configuration ownership
824
-
825
- Core setup, image setup/guidance, config doctor, optional history compression and
826
- legacy prediction cleanup resolve the same `CODEX_HOME/config.toml`; absent
827
- `CODEX_HOME`, they use `~/.codex/config.toml`. An explicit function-level file path
828
- still takes precedence for embedders. App-profile trust is a separate location
829
- selected by `CODEX_ELECTRON_USER_DATA_PATH`, not by `CODEX_HOME`.
830
-
831
- CCDX-owned config mutations share an owner-recorded cross-process lock, reread
832
- under the lock, and retain existing atomic replacement/rollback checks. User
833
- settings updates use a separate lock for their shared JSON file; prediction
834
- on/off uses its own settings lock. Readers take no lock and write no lock file.
835
- Contention fails with a retry message instead of stealing a live lock. Other
836
- applications do not participate in these locks, so snapshot conflict checks still
837
- apply; the locks do not claim a global filesystem transaction.
838
-
839
- Since `0.9.33`, local settings/auth metadata reads are capped at 1 MiB, token
840
- files at 64 KiB, and saved model catalog files at 9 MiB including metadata.
841
- Oversized files remain untouched. Existing strict readers reject them; optional
842
- cache readers treat them as unusable. Conversation files, HTTP request limits
843
- and runtime history/cache limits are unchanged.
844
- Full `ccdx doctor` reports npm's global installation target and readonly credential
845
- permission evidence. Windows checks existing NTFS allow entries for other
846
- identities, without changing ACLs. This is not a full effective-access audit;
847
- unavailable checks warn. `doctor config` performs neither npm nor ACL probes.
848
-
849
- ### Core adapter
850
-
851
- One in-process adapter listens on `127.0.0.1:2026` by default and exposes:
852
-
853
- - `POST /v1/responses`
854
- - `POST /v1/responses/compact`
855
- - `GET /v1/models`
856
-
857
- Responses-only models and compaction use Copilot's Responses transport directly. For requests routed through Chat Completions, CCDX converts the supported text, image, and function-tool subset and rejects incompatible message content rather than turning it into JSON text. Chat `length` and `content_filter` finish reasons become incomplete Responses in both streaming and non-streaming modes. Both streaming SSE and non-streaming responses are supported.
858
-
859
- Chat conversion maps an explicitly supplied `reasoning.effort` to `reasoning_effort`.
860
- Known effort values are checked against the existing model catalog when it advertises
861
- an effort array; without that metadata, upstream validation remains authoritative.
862
- No extra model lookup is made. Malformed function tools, forced undeclared functions,
863
- unsupported tool-choice strings and unknown text formats receive a local compatibility
864
- error instead of being dropped. Native Responses request fields are not changed by this check.
865
-
866
- The adapter handles response history, encrypted reasoning state, function/custom tools, images, compaction, cancellation, retries, and usage metadata within the compatibility boundaries below. Routing prefers endpoint metadata from Copilot's live or cached catalog; when metadata is unavailable, a small built-in set identifies known Responses-only GPT models.
867
-
868
- ### Local compaction recovery
869
-
870
- `0.9.28` adds bounded local recovery; the affected user's real chat still needs
871
- verification. After the exact decoded HTTP 400 `input item does not belong
872
- to this connection` rejection, or its HTTP-200/pre-output Responses failure
873
- equivalent, a request containing encrypted compaction can attempt one verified
874
- plaintext rebuild. Healthy encrypted histories remain unchanged.
875
-
876
- The reader is loaded only after this failure. It requires a loopback peer and
877
- Host, no browser Origin, and LAN mode disabled. It binds a UUID from native
878
- `thread-id` / `client_metadata.thread_id`, or an exact UUID session/cache key
879
- when primary metadata is absent. Conflicting primary IDs are rejected. It reads
880
- only UUID-matching rollout filenames under the service's configured
881
- `CODEX_HOME/sessions` and `archived_sessions`; it does not search by conversation
882
- title, similarity, arbitrary request paths or another machine's filesystem.
883
-
884
- Supported source files are complete JSONL logs and their `.jsonl.zst` variants,
885
- decoded with Node's built-in Zstandard support. Header identity, the exact
886
- compaction ciphertext, retained message order and function/custom-tool pairs
887
- must match. A history-base reference, fork reference, rollback/reset marker,
888
- missing plaintext tool content, malformed data or multiple matching sources
889
- stops recovery. Referenced/split histories are not assembled by this recovery;
890
- the caller must have a complete standalone source prefix.
891
-
892
- The request replaces the rejected compaction with recorded plaintext before it,
893
- retains current instructions and post-compaction input, and removes unavailable
894
- reasoning. It does not decrypt or claim to reproduce hidden encrypted reasoning.
895
- Normal preparation, image limits and upstream model/context limits still apply.
896
- The reader has a five-second deadline, a 4,096-entry directory lookup bound and
897
- a 16-candidate bound. Decoded reads and the rebuilt body are bounded by the
898
- running adapter's decoded-body limit; history admission reservations cover
899
- recovery preparation. Requests cannot retry after visible output has begun.
900
-
901
- Overlapping equivalent recovery readers share in-flight source discovery/decoding,
902
- with independent cancellation and independent restored requests. Every caller retains
903
- its admission reservation; exclusive admission can serialize reads instead of sharing.
904
- Successful plaintext is not retained after the flight settles. Up to 32 failure-code
905
- records last two seconds, keyed by the exact source file identity/size/timestamps,
906
- thread, compaction digest and byte limit. Directory discovery still runs; missing
907
- sources, cancellation, deadlines and unstable snapshots are not cached. Source changes
908
- invalidate reuse. No transcript index, watcher or healthy-request scan is added.
909
-
910
- Neither the original rollout nor client configuration is rewritten. Recovery
911
- diagnostics contain type/count/status metadata, not transcript text, ciphertext
912
- or file paths. If verification fails, `ccdx_history_rebuild_required` includes
913
- `recovery.local_status`; "not modified" does not imply CCDX has backed up complete
914
- plaintext. Cross-machine/LAN recovery is intentionally unavailable. A full
915
- plaintext replay can still exceed the upstream context window; this recovery
916
- does not silently truncate it or add chunked re-compaction.
917
-
918
- ### Reasoning usage declaration
919
-
920
- Native Responses success replies preserve `X-Reasoning-Included: true` only
921
- when the upstream explicitly returns a case-insensitive literal `true`.
922
- Missing, false or other values are not forwarded: current Codex treats header
923
- presence as a declaration that historical reasoning is already counted.
924
- CCDX does not infer that declaration from `output_tokens_details`, invent it,
925
- add it to Chat-converted replies or HTTP/JSON failures, or change token totals.
926
- Streaming headers describe the upstream declaration, not a guarantee that the
927
- stream will later complete. This is compatibility metadata, not proof of lower
928
- context use, faster inference or fewer compactions on every client.
929
-
930
- ### Fast and Standard modes
931
-
932
- Codex can select Standard or Fast without changing CCDX configuration. When the client requests a model with `service_tier: "priority"`, CCDX uses its exact `-fast` model only when the live Copilot catalog advertises that variant as enabled, selectable, OpenAI-owned, and Responses-only. Standard mode continues to use the base model; CCDX does not invent Fast availability when the upstream catalog does not provide it. This retains the established `gpt-5.6-sol` / `gpt-5.6-sol-fast` mapping and applies the same exact-match rule to future models.
933
-
934
- Codex Auto-review uses the hidden `codex-auto-review` model ID. CCDX maps it to Copilot's `gpt-6.1-sol` Responses model by default, independently of the interactive Fast/Standard selection, and logs both model IDs when the mapping is used. Without a saved reasoning override, an omitted Auto-review effort defaults to `low`; explicit client efforts are preserved. A saved override changes only review effort, preserving other reasoning fields. The review target and effort can be changed interactively without reinstalling or restarting a current CCDX adapter.
935
-
936
- ### GPT-6 model catalog
937
-
938
- Codex App requests a versioned, capability-rich model catalog that is different from Copilot's raw model list. CCDX reads the complete catalog bundled with the installed Codex App and preserves every other model entry and capability. It exposes each managed GPT-6 entry only when Copilot advertises that exact model as enabled, selectable, OpenAI-owned, and Responses-capable.
939
-
940
- When an installed 0.155.x catalog does not yet contain `gpt-6-sol` or `gpt-6-luna`, CCDX derives their client-compatible entries from that catalog's GPT-6 Astra schema and the published OpenAI Codex model definitions at commit `0a2eb4696c26ac33204bcd255721ab30220a4774`. When an installed 0.158+ catalog contains `gpt-6-sol` but not `gpt-6.1-sol`, CCDX derives only the missing 6.1 entry from that client's Sol schema and OpenAI Codex model identity/defaults at commit `ab84d71f5767e4a565ce81c2c426287cb48c7918`. Fallback reasoning controls are intersected with Copilot's advertised efforts; every other bundled entry retains its established behavior. A newer client-provided entry supplies its schema and future fields while CCDX still gates its visibility, speed tiers, and 6.1 Sol reasoning controls against Copilot.
941
-
942
- CCDX exposes GPT-6 Standard paths and removes unverified speed-tier metadata. Existing GPT-6 bundled reasoning-effort options remain unchanged; 6.1 Sol is limited to efforts advertised by Copilot. Fast follows the exact upstream-variant rule above. Versioned model discovery matches the bundled catalog to the client's `client_version`, including the nested Codex CLI binary in current macOS App bundles, caches it by application binary identity, and reloads it after an App update. If a matching usable catalog cannot be loaded, the versioned models request returns `503`; an unversioned request returns the Copilot-style list.
943
-
944
- `/v1/models` still attempts live discovery first. With a usable in-process catalog, it limits that upstream wait to 1.5 seconds (or a shorter configured upstream timeout) before falling back to last-known-good data. Without a catalog it retains the regular upstream timeout. Received HTTP `401`/`403` responses remain errors, not cached successes; fallback does not grant inference access. This does not change the explicitly live `ccdx models` command.
945
-
946
- ## Prerequisites
947
505
 
948
- - A GitHub account with Copilot access to the desired models
949
- - Node.js 22.15 or newer, for built-in Zstandard request decompression
950
- - Codex App on macOS
951
-
952
- ## Install and start
953
-
954
- ```bash
955
- npm install -g codex-copilot-dx@latest
956
- ccdx
957
- ```
958
-
959
- `ccdx` is the primary launcher. The old `codex-copilot-dx` executable remains temporarily as a compatibility shim: it prints a deprecation warning at most once every seven days in interactive terminals, runs `ccdx`, and remains silent in scripts. The warning timestamp is stored under `XDG_CACHE_HOME` or `~/.cache`; `doctor config` bypasses that warning cache to remain read-only. The alias will be removed in a future breaking release.
960
-
961
- For a one-off run without a global install:
962
-
963
- ```bash
964
- npm exec --yes --package=codex-copilot-dx@latest -- ccdx
965
- ```
966
-
967
- On a normal launch, CCDX:
968
-
969
- 1. Prints the installed package version and checks GitHub's latest stable release in the background (not npm).
970
- 2. Reuses a compatible running adapter when available; otherwise it reuses a compatible local Copilot credential or starts GitHub Device Flow when authentication is required.
971
- 3. Loads a usable model cache or attempts a live refresh, then starts listening. A cache older than two hours refreshes in the background; a fresh cache can be used immediately. A failed refresh retains the last-known-good list when one is available.
972
- 4. Checks the startup-managed settings in `CODEX_HOME/config.toml` (default `~/.codex/config.toml`), including the local `/v1` endpoint.
973
- 5. Attempts to open Codex App on macOS unless `CCDX_AUTO_LAUNCH` disables it.
974
-
975
- The `OPENAI_API_KEY=dummy` value used in the Codex shell environment is only a client-side placeholder. It is not a GitHub credential. CCDX exchanges the saved GitHub OAuth credential for short-lived Copilot service tokens internally.
976
-
977
- On startup, CCDX also adds `context_management = true` under `[features]` when the key is missing, creating the section if needed. Existing values, including `false`, are preserved. Existing inline or dotted `features` declarations and nested context-management settings are left intact to avoid conflicting TOML definitions. This opts unconfigured users into Codex context management; support and behavior depend on the installed Codex version. A configuration that already matches is not rewritten.
978
-
979
- Startup and adapter reuse also attempt an optional `local_thread_store_compression = true` default under `[features]`. CCDX probes installed macOS App runtimes with `features list`, using an empty temporary Codex directory, no inherited credentials/provider overrides, a 1.5-second timeout per runtime and a 128 KiB output limit. All discovered App readers must advertise a supported, disabled feature; missing/removed/unknown/default-on features or failed probes skip setup. Existing user settings (including `false`, inline/dotted forms and legacy profile overrides) are preserved without probing. Alternative feature-table declarations that cannot be safely extended are left intact. The shared config is reread after probing, and only this key can change. Temporary probe directories are removed; no user transcript is read or compressed by CCDX itself, and no upstream or npm lookup is added. Ready and core requests do not wait for this optional task; its failures never abort the main service. On a first launch, the App may read the config before this background task finishes; the setting is available on its next config load/restart.
980
-
981
- This remains an experimental Codex storage feature. Current Codex compresses cold local transcript files, including shared histories, with Zstandard; every external reader of that Codex directory must also support the format. It does not reduce model context, request-body limits or CCDX's in-memory history cache, and CCDX does not promise faster inference. Existing third-party transcript readers are not detected. `ccdx doctor config` remains a config-only preview of essential startup settings; it does not spawn runtimes or predict this optional compatibility-gated default.
982
-
983
- If a compatible adapter is already running, a later launch reuses it and checks the local Codex configuration. Reuse requires the same package version, protocol version, and required capabilities. After updating the package, stop the old adapter before starting the new version. Installing or updating the package alone does not restart the adapter or update Codex configuration.
984
-
985
- ### Codex configuration writes
986
-
987
- Normal startup and reuse of an existing adapter check `CODEX_HOME/config.toml` (default `~/.codex/config.toml`) once, after startup prerequisites succeed. There is no file watcher or periodic configuration rewrite. Startup, image setup, config doctor, compression and legacy prediction cleanup share this path. CCDX does not edit project-level Codex files.
988
-
989
- | Setting | Existing file | New file |
990
- | --- | --- | --- |
991
- | Top-level `openai_base_url` | Add or update to the adapter's `/v1` address | Set to the adapter address |
992
- | `model_context_window` | Add `1000000` only when missing | `1000000` |
993
- | `model_auto_compact_token_limit` | Add `900000` only when missing | `900000` |
994
- | `[shell_environment_policy.set]` OpenAI URL/key | Update `OPENAI_BASE_URL` and set `OPENAI_API_KEY="dummy"` when this section is recognized; leave an absent section absent | Create the section and set both keys; set `shell_environment_policy.inherit="core"` |
995
- | `[features]` `context_management` | Add `true` when missing; preserve explicit values and alternative declarations as described above | `true` |
996
- | `[features]` `local_thread_store_compression` | Optional compatibility-gated default; preserve existing values, skip already-on/unsupported/unavailable runtimes | `true` only after a successful probe |
997
- | `[mcp_servers.ccdx_image]` | Added in a marked CCDX-owned block only after `ccdx enable-image`; removed by `ccdx disable-image` | Absent by default |
998
-
999
- The two token limits are fixed defaults, not detected model capabilities. Existing custom values are retained. Writes target the listed keys with format-preserving edits and atomic replacement; this is not a general TOML formatter. Quoted keys, quoted table headers, and explicit dotted shell-environment declarations are recognized; inline shell-environment tables are left intact. Startup and image configuration commands validate UTF-8/TOML and verify that unrelated settings retain their values before writing. An unsafe edit leaves the original file unchanged. Use `ccdx doctor config` to inspect parsed values and preview what this writer would do with the current file. No actual change means no file rewrite.
1000
-
1001
- Interactive image setup rereads the shared config after prompts and network validation, so unrelated changes made during setup are preserved. It checks the snapshot again before committing and rejects conflicting image declarations. Identical configuration bytes are not replaced; private file permissions may still be corrected. These checks reduce lost-update risks but are not a filesystem-wide transaction with other applications that do not share a lock.
1002
-
1003
- ## Version 0.7.0 migration
1004
-
1005
- CCDX 0.7.0 retired the former personal-GitHub Claude App, Claude Code, Anthropic Messages API, isolated Claude account, and PM Studio patch integrations. Their old setup, status, restore, profile, and routing commands remain unsupported. Version 0.10.0 adds a separate M365-only Claude gateway; it does not reactivate these old routes or PM Studio support.
1006
-
1007
- If PM Studio is still patched by an older CCDX release, update or reinstall PM Studio to restore its official application bundle. CCDX 0.7.0 does not patch PM Studio and does not provide a restore workflow.
1008
-
1009
- The upgrade intentionally does not delete or rewrite retired Claude or PM Studio configuration, historical patch backups, or isolated credentials created by older versions. Normal Codex configuration updates continue as documented above. Review and remove obsolete retired-integration state yourself only if you no longer need it.
1010
-
1011
- ## Commands
1012
-
1013
- Run `ccdx <command> --help` for command-specific behavior and side-effect details.
1014
- Startup uses aligned status/project/result columns and a left-aligned Ready footer
1015
- with the Web UI URL and `ccdx help`. Ctrl+C is shown only for the foreground-owned
1016
- service, never a short-lived command reusing another service. A static, favicon-style
1017
- atom uses the saved terminal color (green by default) and half-block characters only on interactive color terminals
1018
- at least 72 columns wide; narrow terminals, `NO_COLOR`, `TERM=dumb` and redirected
1019
- output keep a plain title. No new graphics/font/runtime dependency is installed.
1020
- Credentials found are not labeled online-authorized, cached model lists are not
1021
- labeled fresh upstream data, and image configuration is not a provider test.
1022
- Ready reports core readiness independently of optional prediction/image warnings.
1023
- Model refresh logs show counts; `ccdx models` retains the complete live list.
1024
- After Ready, the default foreground display becomes a fixed status region;
1025
- request and background-refresh detail is available with `--verbose` or explicit file logging. Status messages remove terminal controls and collapse newlines;
1026
- the static banner and multiline interactive prompts retain their own presentation.
1027
- VS Code compatibility-version details remain available in debug logging. Startup
1028
- does not wait for optional update/compression work or add online doctor/model probes.
1029
-
1030
- ### Live models
1031
-
1032
- ```bash
1033
- ccdx models
1034
- ```
1035
-
1036
- With GitHub selected, this performs a fresh, read-only GitHub Copilot model-directory lookup without starting the adapter, opening Device Flow, reading the local model cache, or consuming an inference request. It lists selectable GPT model IDs, providers, advertised APIs, and preview status. With M365 selected it reads the running provider's isolated GPT catalog. Catalog availability does not guarantee that a later inference request will avoid quota, rate-limit, or policy enforcement.
1037
-
1038
- Concurrent identical live lookups share only the active request. Caller
1039
- cancellation is independent; results are not retained as a fresh catalog after
1040
- completion. The dashboard cancels its waiter when the read is abandoned.
1041
-
1042
- Interactive terminals use aligned tables for `models`, `auth status`, and `usage`. Redirected or piped output retains the plain-text layout for scripts; use `--format table` or `--format plain` when a command offers an explicit format override.
1043
-
1044
- `ccdx usage` and the dashboard Model Usage table show token cache hit rate for each model and the aggregate: recorded cached input tokens divided by recorded input tokens, weighted by token count rather than averaging request percentages. This describes the upstream prompt cache; the local history and image-transform caches are separate. Incomplete historical records do not hide a computable ratio: `~` marks a rate derived from incomplete counts. A rate is `—` when input tokens are zero, usable totals are missing, or token counts are invalid. Older logs may omit explicit zero cache counts; new Responses usage records retain reported zeros. CLI tables keep existing token columns on narrow terminals and show rates below the table when the extra column does not fit.
1045
-
1046
- ### Auto-review model
1047
-
1048
- ```bash
1049
- ccdx auto-review-model
1050
- ```
1051
-
1052
- With GitHub selected, the selector first queries the running adapter, including its last-known-good model list when live refresh is unavailable, then falls back to a local model cache no older than seven days. It offers model IDs that advertise a Responses endpoint and are not explicitly hidden from the model picker. M365 selection uses only that running provider's catalog and separate saved preference, with no GitHub cache fallback. This selection does not itself verify policy or inference access.
1053
-
1054
- Enter a model number, then a reasoning-effort number. The second menu reuses the same model-directory lookup and lists only advertised efforts. GPT-6.1 Sol excludes `none` and `minimal`, even if upstream metadata incorrectly lists them. Enter keeps the current valid effort or selects `low` for a new selection when advertised; `0` follows the client (or `low` if the request omits effort). If effort metadata is absent, only `0` is offered. Enter `q` at either step to cancel without saving either choice.
1055
-
1056
- Both choices are saved together in `~/.config/codex-copilot-dx/config.json`, or under `XDG_CONFIG_HOME` when set. Choosing `gpt-6.1-sol` clears the model override and restores the package default. A selected effort is saved as `auto_review_reasoning: { "model": "gpt-6.1-sol", "effort": "medium" }` and applies only when its model matches the effective review target. Existing saved models, including `gpt-5.5`, and environment model overrides retain their precedence; changing the model via an environment variable does not transfer another model's effort. Choose `0` to clear the effort override; its `null` marker remembers client-following so Enter preserves that choice next time. Users who do not configure effort retain their existing behavior. Adapters running 0.9.13 or newer read both settings on the next Auto-review request; older adapters must first be upgraded and restarted. No client patch, foreground-model change, Fast mapping, permission or approval-policy change is involved.
1057
-
1058
- ### Runtime caches
1059
-
1060
- ```bash
1061
- ccdx cache
1062
- ccdx cache --limit 128
1063
- ccdx cache --limit default
1064
- ccdx cache --clean
1065
- ccdx cache --clean --history
1066
- ```
1067
-
1068
- `ccdx cache` separates the shared in-memory Responses history from the rebuildable input-image transform cache. The history limit accepts 16–1024 MiB, is saved in the normal CCDX settings file, and applies immediately to a compatible running adapter. `CCDX_RESPONSE_HISTORY_MAX_BYTES` remains the higher-precedence environment override. Lowering the limit below current usage is rejected rather than evicting tasks silently. `ccdx cache -128` is a short alias for `--limit 128`; `-clean` aliases `--clean`.
1069
-
1070
- Plain `--clean` clears only completed image transforms; the next matching request may recompute them. Adding `--history` also invalidates all process-local `previous_response_id` chains and can make a task's next continuation fail, so it requires interactive confirmation or `--yes`. Cleanup refuses active cache users; retry after current requests finish. It never deletes Codex transcripts, generated image files, provider credentials, image edit handles, model catalogs, or usage/debug logs. A stopped or older adapter must be restarted before runtime cleanup; a saved limit applies on the next start.
1071
-
1072
- ### Request-body limits
1073
-
1074
- ```bash
1075
- ccdx limits
1076
- ccdx limits --decoded 256
1077
- ccdx limits -256
1078
- ccdx limits --decoded default
1079
- ```
1080
-
1081
- `ccdx limits` distinguishes the saved decoded request-body limit from the running adapter's active limit. The default is 128 MiB; the opt-in saved limit accepts 128–512 MiB. Changes take effect only after restarting the adapter, never restart it automatically, and do not clear conversations or caches. `CCDX_MAX_DECODED_BODY_BYTES` overrides the saved setting; unset it before changing the saved limit. The separate 64 MiB raw/compressed-body limit is not changed. Larger decoded requests can use substantially more process memory during JSON parsing and image preparation; raising this limit may enable a large thread to compact, but does not guarantee successful inference or compaction. Return to `default` after temporary use.
1082
-
1083
- ### Control console and online settings
1084
-
1085
- The sidebar separates Overview, indented Codex/Claude Apps, Model sources, Usage, Requests, and Settings. Codex owns optional image generation, native
1086
- prediction adaptation and the temporary Responses conversation buffer. That
1087
- buffer supports continuation; it is not a chat archive. Shared HTTP traffic and
1088
- per-protocol model outcomes are distinct. Claude Messages metrics are not labeled
1089
- as all Microsoft 365 traffic. Saved credentials, authorization, catalog discovery,
1090
- client configuration and successful requests are separate evidence.
1091
-
1092
- Interactive desktop starts open the default browser once after core readiness.
1093
- `--no-browser` skips this for one invocation; `open_webui:false` in
1094
- `~/.config/codex-copilot-dx/config.json` disables subsequent automatic opening.
1095
- Query commands do not open it. Headless/CI/SSH or noninteractive starts skip it;
1096
- a browser-launch failure does not stop the service. This is an opening attempt,
1097
- not a guarantee that every browser will reuse an existing tab.
1098
-
1099
- The default TTY display uses wrapping source/Claude summaries, a line-framed usage/inference table, and separate notice/activity rows, without an alternate screen or raw keyboard input. It shows usage returned since this process began; pending
1100
- usage is excluded, missing usage stays partial, and this is not an invoice.
1101
- Business requests drive terminal activity; status/catalog polling does not. The live table fills its existing last usage row with Cache hit, using the same process-local cache_hit_rate and partial marker as Overview. Unknown/invalid rates display —; a known zero displays 0.0%. Existing nine
1102
- animation styles retain their timing and cycle pauses; the default green retains its original palette. `--verbose`,
1103
- `--show-request-id` or `CCDX_LOG_LEVEL=debug` restore detailed terminal output.
1104
- Failed reads show previous-data status and the last successful update time, or that no data has been received. Narrow summaries wrap rather than hiding Claude App/Code state. Non-TTY/CI/dumb/too-small terminals use plain output; repeated identical notices
1105
- are coalesced. File logging retains its existing explicit opt-in and redaction.
1106
- In-memory usage still updates when `CCDX_DISABLE_USAGE=1` disables persistence. `runtime_usage.by_provider` separates returned process-local usage by source. The Requests view contains live Request flow, Requests by source, recent failures and request context; `ccdx status` also lists source/protocol outcomes. Unknown outcomes and partial usage remain distinct. CLI remains English; WebUI keeps English/Chinese.
1107
-
1108
- The Clear conversation buffer action clears all process-local conversation continuation data. If image optimization or conversation history is active, cleanup is refused; retry after current requests finish. Old chats may fail to continue; saved Codex transcripts remain. It invokes the existing image-transform/history cleanup operation, rather than an inactive-only selector.
1109
-
1110
- The source page groups account/access checks and the model list under the selected
1111
- source. Selecting a source tab only browses it; application routing is changed from
1112
- the application page. Model names remain in the main table; maker, protocol,
1113
- reasoning levels, listing state and context limit are in each model's details.
1114
- The Codex choices and source table share one catalog read with freshness,
1115
- cancellation and account-generation checks. Explicit Refresh still checks again.
1116
-
1117
- Selection uses a solid theme fill with centered text, without a preceding check.
1118
- Model-list text uses the normal text color. Selects have square borders and a
1119
- visible keyboard focus indicator. Settings groups webpage appearance, independent
1120
- terminal color/animation, startup and updates. The terminal preview is expandable;
1121
- choosing an animation previews it, while Save applies it to the running terminal.
1122
- Usage trends are separate from the model summary and remain on demand. Request
1123
- rows show an observed HTTP failure separately from the model's terminal result;
1124
- request IDs and attempt counts are available in the same bounded details. List
1125
- timestamps use local 24-hour time in both UI languages.
1126
-
1127
- M365 catalog refusals expose a fixed reason, HTTP status, check/last-success time
1128
- and service request ID when available. `entra_access_disabled` means the server
1129
- reported that Copilot CLI Entra access is not enabled for that account; a generic
1130
- 403 does not establish why access changed. Sign-in, discovery and successful
1131
- inference remain separate evidence. Failed discovery keeps the account-bound
1132
- last-good list. A successful refresh clears old failure evidence. No automatic
1133
- relogin, model call, source switch or policy exception is added.
1134
-
1135
- The settings API is local, requires the dashboard header, bounded JSON and
1136
- same-origin POST. It invokes the same Provider, cache and integration operations;
1137
- it does not spawn a CLI or generic shell command. Settings reads do not reveal
1138
- upstream keys. Each operation reads back saved and effective state. Corrupt saved
1139
- service preferences fail closed for optional calls rather than reopening them.
1140
-
1141
- | Control | Effective scope |
1142
- | --- | --- |
1143
- | Webpage color | Current browser, immediately; independent of the existing dark/light choice |
1144
- | Terminal color | Live supported status table and animation; startup logo on the next launch |
1145
- | Terminal animation | Live supported status terminal; plain/verbose/environment-disabled modes are reported separately |
1146
- | Open WebUI | Next interactive desktop start |
1147
- | Image calls | New local MCP calls; keeps provider credentials and allows an already-started call to finish |
1148
- | Prediction adaptation | Subsequent configuration traffic on an already-provisioned bridge; keeps trust/route, and App caches can remain |
1149
- | Model source | Explicit validated selection for subsequent Codex requests; existing requests retain their binding |
1150
- | Conversation buffer | Live validated limit; cleanup refuses pinned/active data, then clears all buffered continuation IDs |
1151
-
1152
- Boolean allow preferences `terminal_animation_enabled`, `image_enabled` and
1153
- `prediction_enabled` default to true, preserving already configured features;
1154
- they do not provision or enable the default-off image/prediction integrations.
1155
- The existing explicit CLI enable commands resume the corresponding paused gate.
1156
- `disable-image` and `prediction off` retain their documented full cleanup
1157
- semantics, distinct from a WebUI pause. First-time setup and client trust/routing
1158
- changes still use existing compatibility checks and may require a normal App
1159
- relaunch. Environment-controlled limits cannot be overridden through the page.
1160
-
1161
- Visible auto-refresh reads the in-memory status approximately every two seconds,
1162
- and Provider/settings evidence approximately every 16 seconds. Hidden pages stop
1163
- scheduled reads. Catalogs and retained usage are fetched only for their open view
1164
- or an explicit lookup; their normal refresh interval remains 30 minutes. Paused
1165
- auto-refresh still permits manual refresh/settings retry. No history-log scan is
1166
- performed at the status cadence. The atom moves on load/manual refresh only and
1167
- respects reduced motion. Client attribution absent from older records stays unknown.
1168
-
1169
- ### Overview activity
1170
-
1171
- Overview reserves a fixed-height row below its status summary. Six 4px theme-colored dots appear and retract in order while the status snapshot reports active Responses, compaction, Claude Messages or actual image generation. Catalog reads, token counting, image MCP discovery and management calls are excluded; retries do not add another logical request. Active dots have no halo. Idle shows one small dot with a breathing halo. Invalid/missing status or a read older than six seconds shows Activity unknown, without a halo. This reuses the existing two-second status polling; short requests between snapshots may not be shown. No model probing, stream connection or extra polling is added. Hidden pages/views pause motion; reduced motion shows static corresponding states.
1172
-
1173
- ### Color themes
1174
-
1175
- Settings separates Web appearance and Terminal appearance. Both offer Classic green (default), Klein blue and Soft pink. Web appearance also offers Pure white: white page/surfaces with black text and icons in light mode, inverted in dark mode. All WebUI palette tokens, including alerts and charts, are grayscale; status icons and words retain their meaning. Terminal previews continue to reflect the independently selected terminal palette. Green preserves the previous palette and terminal table's original text colors. Blue and pink color the terminal logo, full table and activity animation without changing glyphs, timing or metric definitions. Webpage color is independent of terminal color, and of the page header's dark/light switch.
1176
-
1177
- Web choices use `ccdx.dashboard.palette` (`green` / `klein` / `pink` / `mono`) and the existing `ccdx.dashboard.theme` (`dark` / `light`) in browser local storage. They are applied before the stylesheet, including the atom favicon. Same-origin tabs receive storage updates; other browsers retain their own choices. If storage is blocked, the current tab still changes and explicitly reports that the choice was not saved. No service request is needed to change webpage colors.
1178
-
1179
- Terminal color uses `terminal_color_theme: "klein"` or `"pink"` in the normal CCDX user config. An absent value means `green`; choosing green removes the override. It does not change `terminal_animation` or any capability flag. The same bounded, strict settings read, file lock and atomic writer are reused. Invalid/unreadable existing config is not overwritten with defaults. A successful save applies to the supported live status table; the startup logo uses the saved choice next time. Previously printed terminal lines are not rewritten. Color codes are added after width calculation and clipping. Truecolor, 256-color and ordinary ANSI fallbacks are supported; `NO_COLOR`, dumb terminals and redirected output preserve plain output. A terminal's own palette and background affect the displayed color. Pink uses a darker tone when COLORFGBG explicitly identifies a light background (7 or 15); otherwise its default tone is pale pink. CCDX does not query or change the terminal background.
1180
-
1181
- The terminal sample in Settings is labeled Preview and uses sample numbers, not current usage. Existing nine animation previews and their save operation remain available beneath the color choice. Errors and warnings retain their text and status icons in every webpage theme; the three colored palettes also retain red/amber cues.
1182
-
1183
- ### Version and update information
1184
-
1185
- Settings ends with Version & updates. The current version belongs to the running service, which can differ from a newly installed package until CCDX restarts. Dates are GitHub Release publication dates, not local installation dates; an unavailable date is explicitly unknown. A verified newer stable release shows its version/date and `ccdx update github`. Copying a command never executes it. No background installation or service restart is added.
1186
-
1187
- Opening Settings reads `GET /_ccdx/ui/updates`, protected by the existing loopback/Host/dashboard-header checks. It reads public GitHub REST release metadata without credentials, accepting stable, non-draft releases only. The first successful check needs at most two serial metadata requests: latest, and the exact current tag when different. The current publication date is retained in memory. Concurrent reads share one lookup; successful results are cached for five minutes and failures for one minute. The page reuses the visible-view 30-minute refresh controller, so the two-second status timer never polls GitHub. Manual checks also respect the service cache. Network configuration discovery is asynchronous and reads only npm's named proxy/CA/TLS/offline settings; no registry or policy is rewritten. Each metadata request has a four-second deadline and a 128 KiB decoded-body limit, with no automatic retry.
1188
-
1189
- Failed/rate-limited checks never claim that the installed version is latest. Last-known release details remain labeled as such, separate from the latest check attempt. A failed current-tag date lookup does not hide an otherwise verified available update. The startup web-redirect check remains unchanged and independent of this REST check. If npm/network settings cannot be read or company policy blocks GitHub, the version card reports the check as unavailable.
1190
-
1191
- Expand the recovery instructions to choose macOS Terminal or Windows PowerShell. Commands download the version-pinned Release installer into a unique temporary directory and remove that directory afterward. They use the newer of the running version and last-known stable release, falling back to the running version if no release is known; stale metadata cannot select a downgrade. Installers retain the documented no-Git, minimum-runtime, rollback and configured-registry behavior. Windows instructions keep the current execution policy; if company policy blocks scripts, use its approved installation method. The current installer prefers a complete platform package and installs it offline; source-only old releases require the configured registry.
1192
-
1193
- Model-list failures name the selected source, retain its last successful list when available, and distinguish that list's timestamp from the failed check. Expand Check details for the bounded public reason, source, available HTTP status and check time. A retry time is shown only when the source supplies an actual retry delay; no new retry or automatic provider failover is added. Existing diagnostic redaction and size limits remain.
1194
-
1195
- ### Terminal animation
1196
-
1197
- Choose the terminal activity animation interactively:
1198
-
1199
- ```bash
1200
- ccdx animation
1201
- ```
1202
-
1203
- The selector is ordered numerically:
1204
-
1205
- 1. Comet (default)
1206
- 2. Twin
1207
- 3. Shuttle
1208
- 4. Chase
1209
- 5. Mirror
1210
- 6. Pulse
1211
- 7. Stack — short light trails arrive, accumulate, then leave as one bundle
1212
- 8. Relay — fixed nodes receive and pass a short light trail
1213
- 9. Split — one incoming light trail divides into two outgoing trails
1214
-
1215
- All nine rows preview their animations together while you enter a number to select one. The live previews keep each theme's original timing and leave the input cursor in place; selection ends them immediately. Small terminals, disabled animation, CI and dumb terminals retain static previews. Resizing or clearing the terminal pauses the live gallery so input stays usable. When the gallery cannot run, CCDX retains the selected animation's one-cycle confirmation when supported. The setting is saved in `~/.config/codex-copilot-dx/config.json`, or under `XDG_CONFIG_HOME` when set.
1216
-
1217
- All nine animations use the same 20-column colon track and cyan/blue palette. They indicate activity, not completion percentage. Braille was removed in 0.7.7. A saved `terminal_animation: "braille"` falls back to Comet without rewriting the settings file; choosing another animation replaces it, and explicitly choosing Comet clears it. Other settings remain intact.
1218
-
1219
- Running 1.1.0+ services pick up a changed saved theme without restarting. The WebUI applies it directly; the CLI gallery save is picked up by the status renderer within about one second. Older services still need a restart after upgrade. `CCDX_TERMINAL_ANIMATION=0` (also `false`, `no`, or `off`) remains the boolean gate that disables terminal animation regardless of the selected theme.
1220
-
1221
- ### Optional image generation
506
+ ## Optional image generation
1222
507
 
1223
508
  Image generation is disabled by default. Configure it interactively only when you want Codex App to receive the local CCDX image tool:
1224
509
 
1225
510
  ```bash
1226
- ccdx enable-image
511
+ ccdx app codex image setup
1227
512
  ```
1228
513
 
1229
514
  The command accepts an HTTPS base URL or a full `/images/generations` endpoint, then asks for an API key without echoing the key. A bare origin such as `https://api.example` expands to `/v1/images/generations`; `https://api.example/v1` expands to the same endpoint. Custom base paths are retained, and existing full endpoints remain unchanged. CCDX uses GET for the corresponding `/models` catalog and POST for image requests; there is no endpoint-search or automatic fallback. It asks for a numeric model selection only when multiple image models are available, then detects either the standard OpenAI Images request format or the supported `input.messages` format for the selected model only. Its single validation request omits the prompt and does not generate an image.
@@ -1243,8 +528,8 @@ Direct MCP generations and edits retain their original inline image content and
1243
528
  Inspect or disable the optional provider with:
1244
529
 
1245
530
  ```bash
1246
- ccdx image-status
1247
- ccdx disable-image
531
+ ccdx app codex image status
532
+ ccdx app codex image remove
1248
533
  ```
1249
534
 
1250
535
  `image-status` never prints the API key and performs only a local, non-generating tool-readiness check. It lists generation and editing separately based on the local tools/list response; a configured model name alone does not prove editing is available. Disabling removes the stored provider credential, the CCDX-owned MCP block, and unmodified skill, reference, and helper files; user-modified files are preserved. Cached tool calls then fail closed. The Node helper creates a new file under the task's `output/imagegen` directory by default and reports its absolute path; it never overwrites an existing file or automatically repeats a failed generation. The image endpoint is contacted only by `enable-image` validation and by explicit `generate_image` or `edit_image` tool calls. Ordinary Responses, models, authentication, Fast, Auto-review, compaction, and image-input paths remain on their existing routes.
@@ -1261,573 +546,6 @@ With `qwen-image-3.0-pro` or `qwen-image-3.0` using either supported protocol, C
1261
546
 
1262
547
  Editing references are opaque IDs bound to the provider configuration, not paths or URLs. Source images up to 10 MiB are kept in a 64 MiB byte-bounded in-memory LRU. IDs expire on eviction, provider/credential changes, or adapter restart; restarting Codex App alone does not clear them. A missing or expired ID fails before upstream dispatch. This feature does not import arbitrary local images or provide masks, transparent output, or an `/images/edits` endpoint. Other providers retain their existing generation behavior. The helper accepts `--image-id` for the same edit operation; its stdout remains the saved absolute file path and stderr reports the new ID. Normal host approvals still apply, and failed edits are never replaced with an automatic new generation.
1263
548
 
1264
- ### Update
1265
-
1266
- Choose a source interactively:
1267
-
1268
- ```bash
1269
- ccdx update
1270
- ```
1271
-
1272
- Or choose directly:
1273
-
1274
- ```bash
1275
- ccdx update npm
1276
- ccdx update github
1277
- ```
1278
-
1279
- Since 1.2.1, the GitHub channel resolves the latest stable Release, downloads
1280
- `codex-copilot-dx-VERSION.tgz` and `SHA256SUMS` from that exact release, checks
1281
- SHA-256 and the packed package name/version, and gives the verified local file
1282
- to npm. **Git is not required.** It never installs `main`, falls back to another
1283
- channel or automatically grants remote-download permission. Each asset has a
1284
- 60-second download deadline and bounded size (64 KiB manifest, 16 MiB package,
1285
- 64 MiB decompressed metadata scan). The checksum comes from the same HTTPS
1286
- release; it detects corrupt/mismatched files and is not a separate signature.
1287
- Source packages use npm's configured registry, including a company mirror. A confirmed EALLOWREMOTE in a GitHub update permits one verified complete-package attempt offline, without changing that registry or policy.
1288
- This is not a fully offline or registry-free distribution.
1289
-
1290
- Windows runs `npm.cmd` through system `cmd.exe` with AutoRun and delayed expansion
1291
- disabled. Its fixed tarball basename is passed separately from the temporary
1292
- working directory, including when that path has spaces or shell metacharacters.
1293
- Use `ccdx.cmd` if PowerShell blocks npm's `.ps1` entry. No PowerShell policy,
1294
- registry, proxy, certificate setting or persistent npm permission is changed.
1295
- macOS/Linux keep direct npm execution with separate argument arrays.
1296
-
1297
- Before npm changes a discovered global target, CCDX backs up only its package
1298
- and two command entries and acquires an exclusive install lock. A linked target
1299
- is preserved and refused. Installer or runtime-verification failure restores the
1300
- old package/commands; successful installation removes the backup. A failed restore
1301
- reports the retained backup and lock for manual recovery. New lock records include
1302
- the installer PID, creation time and backup directory. Existing-lock errors name
1303
- the exact file; other lock-creation failures retain their actual I/O error rather
1304
- than claiming another install. Old empty locks remain owner-unknown. A lock left
1305
- by a killed installer requires checking that no installation is running and
1306
- inspecting its retained backup before recovery. Locks are not removed merely
1307
- because they are old; an incomplete restore must be completed first.
1308
- There is no promise of crash/power-loss atomicity. Other apps, credentials,
1309
- settings, caches and the running service are not replaced. Readonly/busy Windows
1310
- files can prevent installation; finish use of that installation and retry.
1311
-
1312
- The selected target must have the correct name/stable version (exact version for
1313
- GitHub), a working version command and working sharp. A previously installed
1314
- native M365 broker must remain loadable. A mismatched npm prefix warns and retains
1315
- the caller's choice; if the target cannot be discovered, verification/rollback
1316
- cannot be guaranteed and the command explicitly says so. Restart CCDX separately.
1317
-
1318
- Normal startup still checks GitHub's `releases/latest` web redirect once in the
1319
- background, with a two-second deadline and no npm/REST/PAT access. It validates
1320
- only the redirect header, cancels the body and silently skips errors; it never
1321
- installs, polls or retries. Explicit GitHub updates use a ten-second lookup.
1322
- `ccdx update gh` is shorthand. `ccdx update npm` keeps the configured registry and
1323
- installs `codex-copilot-dx@latest`; it never silently switches to GitHub.
1324
-
1325
- npm policy is read using bounded named global fields, without printing credentials.
1326
- An unrelated project's `.npmrc` cannot grant permission. npm 12's
1327
- `allow-remote=none` can reject a mirror's cross-origin dependency URL with
1328
- `EALLOWREMOTE`. GitHub updates restore the previous package, then try one
1329
- same-version complete platform package from the official Release. Its SHA-256,
1330
- version, platform marker and bundled dependency declaration must validate before
1331
- an offline installation. Missing/corrupt complete assets stop the fallback;
1332
- authentication, integrity and other npm errors do not trigger it. Nightly updates
1333
- perform this fallback in their candidate directory before any service handoff.
1334
- No registry, proxy, CA, download permission or saved client selection is changed.
1335
- Explicit npm-source updates keep their selected source and do not silently use GitHub.
1336
-
1337
- If the complete package is unavailable, only if company policy permits and you
1338
- trust this entire package tree, use the explicit one-install exception:
1339
-
1340
- ```sh
1341
- ccdx update github --allow-remote
1342
- ccdx update npm --allow-remote
1343
- ```
1344
-
1345
- This grants URL downloads throughout that installation's dependency tree, not a
1346
- hostname allowlist. It does not change `.npmrc`, add further retries, allow every script
1347
- or override other administrator policy. Older npm receives no unsupported flag.
1348
- Unknown support prevents an explicitly requested exception from starting.
1349
-
1350
- For an older updater that still requires Git, install the Release tarball directly:
1351
-
1352
- ```sh
1353
- npm install -g https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.32/codex-copilot-dx-1.2.32.tgz
1354
- # Windows PowerShell: use npm.cmd instead of npm.
1355
- ```
1356
-
1357
- This manual npm URL command relies on npm/HTTPS and does not perform CCDX's
1358
- separate SHA-256 check. Under strict remote policy, use the verified bootstrap or
1359
- an administrator-approved local package/cache; do not automatically broaden policy.
1360
- A failed old `github:owner/repo#tag` install with `spawn git ENOENT` means npm
1361
- could not launch Git, often because Git was absent from the terminal's PATH.
1362
- It is unrelated to Wave styling; unknown-option warnings are separate.
1363
-
1364
- ### Install without Node or Git
1365
-
1366
- The Release also contains `install.sh`, `install.ps1`, `ccdx-install.mjs` and
1367
- `SHA256SUMS`. Download the platform script from the intended release and run it
1368
- with the current shell policy. The scripts reuse compatible Node/npm and the
1369
- configured global prefix. If unavailable, they download **only official Node
1370
- 24.22.0 LTS** for the current platform, verify the pinned official SHA-256,
1371
- and keep it inside CCDX's private directory. macOS arm64/x64, Windows arm64/x64
1372
- and glibc Linux arm64/x64 archives are selected explicitly. Linux musl users can
1373
- reuse an existing approved compatible Node; this bootstrap does not add libc.
1374
- Unsupported platforms fail before installing a system runtime.
1375
-
1376
- Default private prefixes are `${XDG_DATA_HOME:-~/.local/share}/ccdx` and
1377
- `%LOCALAPPDATA%\CCDX`; an explicit `npm_config_prefix` takes precedence. No global
1378
- Node, Git, Python, compiler, Build Tools or package manager is installed. Native
1379
- packages use prebuilt dependencies with install scripts disabled. The bootstrap
1380
- verifies sharp and the native broker on macOS/Windows; a missing required prebuilt
1381
- component fails and restores the old CCDX package. The private Node remains
1382
- available for a retry if a later package download is blocked.
1383
-
1384
- The helper and package are verified against the release checksum list. The
1385
- bootstrap script itself is initially trusted through the selected HTTPS release;
1386
- review it or compare its checksum through an independent trusted copy if needed.
1387
- The helper reuses the selected npm's bundled `make-fetch-happen` downloader and
1388
- bounded named proxy/no-proxy/CA/TLS/offline settings, with no automatic retries.
1389
- It adds no downloader dependency, forwards no registry credentials and refuses
1390
- network downloads in npm offline mode. A nonstandard npm missing that component
1391
- fails with local-package guidance. Outer platform-script downloads use curl or
1392
- Windows' download tool under their existing network/certificate policy; managed
1393
- PAC-only/offline environments may require administrator-provided Release files.
1394
- The bootstrap keeps user/global npm configuration, proxy and certificate choices.
1395
- Unavailable downloads or restrictive policy stop with no channel fallback.
1396
- It still needs approved access to GitHub Release assets, Node downloads when
1397
- needed, and the configured registry for dependencies. For offline/managed devices,
1398
- ask the administrator to pre-stage these exact files and dependency cache or use
1399
- an approved existing Node/npm distribution; CCDX does not bypass network policy.
1400
-
1401
- Private launchers bind the chosen Node and set `CCDX_PRIVATE_INSTALL_PREFIX` for
1402
- future updates. Windows bootstrap uses these validated commands even with an
1403
- existing Node, so spaces and shell metacharacters in the prefix do not break npm's generated batch commands. Exact npm-owned PowerShell launchers are removed; custom scripts and script policy stay unchanged. They supply a private `npm_config_prefix` only when the caller has
1404
- not set one. Updates preserve those launchers. PATH and shell profiles are not
1405
- rewritten: the installer prints the full command path and the directory to add
1406
- for `ccdx` shorthand. Compatible POSIX installations keep npm's normal commands. Windows PowerShell
1407
- expands percent signs in batch command filenames, before CCDX can run. The
1408
- Windows bootstrap refuses an install prefix containing `%` before modifying it;
1409
- choose a writable prefix without `%` using `npm_config_prefix`. Unicode, spaces,
1410
- `&` and `!` are covered, including a legacy console code page. This avoids shipping
1411
- an additional native executable just to bypass the shell's path parsing.
1412
- No install hook is added to the npm package.
1413
-
1414
- The current verified bootstrap chooses a complete platform package when the
1415
- Release manifest contains one, then installs it offline with scripts disabled.
1416
- Source-only old releases retain the previous registry-based path. Complete packs
1417
- are separate from the lightweight npm artifact and contain the locked runtime
1418
- dependency closure, including the applicable sharp/libvips and Broker files.
1419
- Supported complete targets are macOS/Windows x64 and ARM64, and Linux x64/ARM64
1420
- with glibc or musl. Selection follows the running Node architecture. Other Node
1421
- platforms retain the source installation path without claiming a complete package.
1422
- An old 1.2.29 updater does not learn this fallback until updated; use the current verified
1423
- bootstrap once when the old path cannot install under its saved npm policy.
1424
-
1425
- The scripts accept only `sh install.sh [--allow-remote]` or
1426
- `./install.ps1 [-AllowRemote]`; the permission is explicit and applies to that
1427
- one installation, with the same whole-tree meaning described above. Do not use
1428
- it when company policy forbids it. Interrupted runtime downloads stay in a cleaned
1429
- temporary directory; installed private runtime cleanup is a separate user choice.
1430
-
1431
- ## Diagnostics
1432
-
1433
- `ccdx doctor` is read-only by default and makes no inference request. It checks
1434
- local credentials/configuration, Node/platform, installation target, Windows
1435
- command launchers, enabled optional feature settings and the running adapter.
1436
- Disabled image/prediction features do not trigger provider or routing setup.
1437
- `--online` checks GitHub/Copilot access and a nonempty model directory; `--compat`
1438
- explicitly consumes model usage and requires completed Responses/SSE, not just
1439
- HTTP 200. Probe bodies are bounded to 4 MiB.
1440
-
1441
- `ccdx doctor --fix` makes one repair attempt per supported area and verifies its
1442
- result: exact owned Windows command shims, startup-managed Codex settings, a
1443
- verified existing GitHub credential when none is saved, and the already-enabled
1444
- prediction bridge through its existing management API. Credential recovery can
1445
- contact GitHub without `--online`, but never starts Device Flow. Existing tokens,
1446
- user-modified/invalid configuration, unrelated MCPs/hooks and company routing or
1447
- security policy are not replaced. Existing changed config is transactionally
1448
- backed up to `config.toml.ccdx-doctor.bak` (the latest repair backup only). Repairs
1449
- do not install optional image tools, enable prediction, renew certificates or
1450
- force-restart Apps. A required normal App/service restart remains an explicit
1451
- partial result. Partial repairs exit 1; no automatic retry loop is added.
1452
-
1453
- `ccdx doctor --json` emits one redacted JSON report; combine with `--fix` to
1454
- include `before_checks` and final per-operation repair results. Inspect these
1455
- results rather than equating a configured bridge with a visible gray suggestion.
1456
-
1457
- Windows adds no install-time lifecycle script, so npm 12's script-approval policy
1458
- is not expanded. In restricted PowerShell, install with `npm.cmd`, then first run
1459
- `ccdx.cmd` or `ccdx.cmd doctor --fix`. Startup recognizes only the exact npm
1460
- PowerShell shims for the two CCDX commands, checks their matching `.cmd` targets
1461
- and package identity, then removes those `.ps1` shims. Subsequent calls can use
1462
- bare `ccdx` without changing policy or profiles. The updater applies the same
1463
- check only after verifying its installed target/version. Customized, symlinked,
1464
- unexpected or unreadable shims are preserved; optional setup failures do not
1465
- block core startup or turn a verified update into failure. Direct npm reinstalls
1466
- can recreate the shims; a first `.cmd` invocation repairs them again. Read-only
1467
- commands such as version/help/status do not repair them. Aliases/functions and
1468
- another installation earlier in PATH can still override resolution. npm's own
1469
- `.ps1` shim is untouched, so `npm.cmd` may still be needed. macOS/Linux and source
1470
- checkouts are no-ops.
1471
-
1472
- `ccdx status` and the dashboard show the sample count beside each timing. First
1473
- output is observed at the gateway from generated deltas, hidden-reasoning/tool
1474
- announcements or content snapshots; a runtime-only result is marked separately.
1475
- Empty message/envelope frames, client tool results and compaction are excluded.
1476
- `first_output_sources` and each recent request's `first_output_source` describe
1477
- that evidence, not internal model decode or prefill timing. First output is
1478
- displayed in ms, and output speed in token/s. The additive
1479
- `output_tokens_per_second` metric divides the sum of reported output-token
1480
- intervals (`output_tokens - 1`) by their summed first-output-to-finish durations.
1481
- It is a time-weighted per-request estimate, not the inverse of average TPOT, an
1482
- unweighted average of request speeds, or concurrent system throughput. At least
1483
- two integral output tokens and a positive duration are required; missing usage
1484
- is unknown, not zero speed. The existing TPOT histogram remains unchanged for
1485
- API consumers, including its partial-failure samples. Both estimates can
1486
- include hosted-tool and downstream delays. The new
1487
- timing classifier does not change stream forwarding or the existing output
1488
- commitment that gates compatibility retries.
1489
-
1490
- The adapted Codex model catalog preserves valid multi-agent reasoning mappings.
1491
- Only a mapping no longer supported by the final advertised effort options is
1492
- repaired to the last available non-Ultra effort; no model switch or forced
1493
- highest-effort policy is introduced. Client-provided defaults, option order,
1494
- instructions and multi-agent version stay intact.
1495
-
1496
- CI additionally provisions the latest official Codex on its runner and uses an
1497
- isolated app-server to verify configuration, its model list and synthetic direct
1498
- and proxied Responses message delivery. It logs the tested runtime version,
1499
- does not skip installed-version mismatches and does not install clients on user
1500
- machines or use live credentials/models.
1501
-
1502
- `ccdx doctor` also inspects installed macOS App version metadata and running
1503
- Codex/ChatGPT App executable identities, without reading command arguments,
1504
- changing client files or killing processes. It shows the running adapter version,
1505
- upstream model-directory source, and the last client-version/bundled-directory
1506
- match observed by that adapter. These are observations, not proof of the App's
1507
- internal model cache. Fully quit the named App with Command-Q before reopening;
1508
- closing its window alone may leave its App server running. `doctor config` stays
1509
- configuration-only, with no process inspection or adapter request.
1510
-
1511
- The default streaming path sends small downstream SSE comments after 15 seconds
1512
- of silence only once valid stream headers have been sent. Comments do not count
1513
- as model output/TTFT, extend upstream/idle deadlines, start another upstream call,
1514
- or release a held compatibility-retry prelude. They stop on completion, failure
1515
- or cancellation and are skipped while the downstream is backpressured. A valid
1516
- JSON reply to a streaming request is still not silently converted to SSE.
1517
-
1518
- ### Local dashboard
1519
-
1520
- Interactive desktop starts open [http://127.0.0.1:2026/](http://127.0.0.1:2026/)
1521
- once by default, using the configured main port when customized. See
1522
- [control console and online settings](#control-console-and-online-settings) for
1523
- startup preferences, output modes and effective-state rules. Assets require both
1524
- a loopback connection and loopback Host, including when the main listener uses LAN mode.
1525
-
1526
- The sidebar separates Overview, indented Codex/Claude Apps, Model sources, Usage, Requests, Checks & repairs, and Settings. Desktop header rows have explicit heights, the header sticks when it reaches the viewport top, and stable scrollbar space prevents horizontal movement between long and short pages. Narrow screens keep compact navigation and a two-row toolbar. Page switches reset scroll and move keyboard focus to the main content; background/manual data refreshes preserve scroll. Each page has its own purpose description, and data groups carry their own update times rather than a shared page-wide freshness claim. Codex-specific images, prediction integration
1527
- and conversation buffering stay under Codex. Buffer controls and request performance have separate groups. HTTP traffic counts include model
1528
- catalogs and route errors; model outcomes and timing are named by protocol.
1529
- Microsoft 365's Claude Messages summary is not a Provider-wide request total.
1530
-
1531
- The source access table uses bounded local credential metadata and Provider snapshots, showing only the selected source. Switching source tabs also changes the account controls and catalog, never application routing. Overview groups client rows by app and uses an explicitly selected source; it does not substitute a configured but unselected source when the selected source is unavailable. The source card still lists every registered source. Claude App and Claude Code have separate setup/local-service rows, while Messages performance stays combined and is labeled accordingly. A running local service does not prove the app is open.
1532
- A locally saved GitHub credential is not online entitlement. Account names with
1533
- underscores retain their exact display value; identity, keys and environment
1534
- values are not inferred from model names. Client configuration, gateway state,
1535
- recent requests and actual inference are separate observations. The top summary
1536
- describes source/application status without mapping arrows. The source card counts and lists every discovered registered source, including disabled sources; availability and account evidence remain in the detailed tables. Each sidebar tab has a decorative inline SVG icon, with application entries indented. Terminal appearance has one Settings entry, and the animation selector has one separating rule. Settings contains webpage/terminal appearance, startup preferences and version updates. Local memory, queues, notices, raw HTTP traffic and request-size caps live under Checks & repairs → Runtime details. Account-check links identify the source and lead to its existing account tools. Save failures appear beside the affected controls; configuration repair previews and destructive-action confirmations remain in place.
1537
-
1538
- Catalog tabs browse registered Provider directories without changing routing.
1539
- Rows retain protocol, eligible clients, reasoning metadata and directory state.
1540
- Unknown metadata stays unknown; listings are not verified inference access.
1541
- The source form lives under Codex and explicitly applies subsequent routing. GitHub conversation models are selected in Codex, so its conversation-model field is hidden rather than empty. Auto Review has its own model/effort form under Codex, for either source; choices use the same advertised-effort policy and preference storage as the CLI. First source setup initializes the review choices atomically; later conversation-model saves preserve the saved review choice, and review changes use their own Save button. The GitHub model environment override is shown and locked. Microsoft 365 enable/disable stays under Model sources; disabling confirms that Claude local access stops, unchanged CCDX-owned settings are restored and Codex returns to GitHub. Active requests still block disabling.
1542
- Existing active streams keep their Provider binding. User/organization client
1543
- configuration is not overwritten by browsing or by a pause operation.
1544
-
1545
- Top Refresh updates local evidence and open data groups, plus current-page settings.
1546
- Auto-refresh defaults on and is browser-local. Small status snapshots update about
1547
- every two seconds; source/settings evidence updates every eight status ticks.
1548
- Catalogs and retained usage load only on demand or in their open view, with the
1549
- existing 30-minute cadence and short freshness gate. Hidden pages stop scheduled
1550
- reads. Catalog requests are deduplicated, stale tab reads are cancelled and late
1551
- results rejected. Failed reads preserve last-good data and label it as stale.
1552
- Service-setting errors are visible on the current page and can be retried manually.
1553
-
1554
- ### Settings saving and restore
1555
-
1556
- Settings → **Save & restore**, after Version & updates, controls only this page’s
1557
- preferences. **Save changes automatically** defaults on. Terminal palette,
1558
- animation, animation enablement, opening the webpage at startup and overnight-update
1559
- preferences save after a short coalescing delay. Webpage appearance stays in the
1560
- current browser. Turning automatic saving off reveals Save changes and Discard
1561
- changes; enabling it with a draft asks before saving that draft. Invalid or failed
1562
- saves keep the draft. Polls do not overwrite drafts, old responses do not replace
1563
- newer edits, and a conflicting settings revision requires reviewing the current
1564
- settings. Ordinary appearance saves do not enumerate accounts, authenticate or
1565
- refresh provider catalogs. Overnight updates remain off by default and enabling
1566
- them confirms the existing restart risk; saving the preference never installs an update.
1567
-
1568
- Restore defaults confirms the scope, backs up the saved preferences first, then
1569
- writes the settings-page fields in one locked atomic transaction. Defaults are:
1570
- green webpage and terminal palettes, dark webpage appearance, Comet animation,
1571
- terminal animation on, open webpage on startup, overnight updates off and automatic
1572
- saving on. Language, model/source selections, API keys, native sign-in and client
1573
- configuration, review/memory choices, image/prediction access, history, usage and
1574
- network/environment policy are preserved. Environment-controlled effective values
1575
- remain controlled. Pending drafts are explicitly discarded only after confirmation.
1576
-
1577
- The private `settings-preferences-backup.json` beside the settings file contains
1578
- only the six allowlisted service preferences, version, ID and creation time; it
1579
- contains no credentials or provider settings. Restore backup uses the latest
1580
- pre-reset snapshot. Backup failure aborts reset; a failed settings write restores
1581
- the prior settings and prior backup. A repeated reset with its same operation ID
1582
- cannot overwrite the original snapshot after a lost response. Unreadable settings
1583
- or backups are preserved and reported.
1584
-
1585
- Browser appearance has its own origin-local backup linked to the operation ID.
1586
- At most two entries are held while a reset result is uncertain, reducing to the
1587
- matching latest backup after a confirmed settings read. Service and browser storage
1588
- are not one atomic transaction: a browser-storage failure after the service save is
1589
- reported as partial completion and can be retried. Another browser without the
1590
- matching appearance backup reports that limitation rather than claiming a complete
1591
- restore. No periodic backup service, credential export or full configuration reset
1592
- is added.
1593
-
1594
- The full `/_ccdx/status` response remains the default CLI/diagnostic contract.
1595
- Overview and Settings use an explicit `?scope=summary` projection containing service
1596
- identity, uptime, model activity and current-run usage. The browser keeps summary
1597
- and full reads in separate resource entries; summary data cannot replace request
1598
- history or turn missing full fields into zero values. Other pages request full
1599
- status when opened. Hidden data regions skip DOM work, retaining their last data
1600
- until a visible full read; native inference and the selected model are unaffected.
1601
-
1602
- The usage selector retains current and historical sources. Combined model rows
1603
- and daily analytics preserve source identity; old records without a client label
1604
- are not guessed into one. Legacy untagged Provider records retain their historical
1605
- GitHub attribution. Cache-read tokens are included in input, not added twice.
1606
- The separate current-run summary updates from returned usage in memory, without
1607
- rescanning retained logs at the status cadence.
1608
- Overview adds an approximate token cache hit rate: returned reused input tokens divided by returned input tokens, weighted by tokens rather than request percentages. Missing evidence is distinct from an explicit zero; all-unknown cache evidence, zero input and invalid counts display `—`. Mixed complete/incomplete cache evidence displays `~` before the recorded aggregate ratio. This describes recorded input reuse, not a request success ratio, invoice or whole-account cache statistic. Missing output alone does not invalidate usable input/cache evidence.
1609
-
1610
- The usage source selector applies to the whole page. Model selection controls both daily trends and the calendar; 7/30/90-day range and bar/line view belong to daily trends, and request/Token measure belongs to the fixed annual calendar. These controls do not redefine the all-history model table; selecting a known day narrows the table and Show all restores retained-history totals.
1611
-
1612
- Usage analytics remains collapsed until opened: 7/30/90-day charts and a bounded
1613
- 365-day calendar in the browser time zone. Model/range/day selection reuses its
1614
- snapshot. Days outside retained history are distinct from zero recorded activity.
1615
- Filters, chart nodes and unsaved animation selection survive unrelated refreshes.
1616
- Dark/light, English/Chinese and reduced motion remain supported. Language changes
1617
- translate page labels in place without fetching models or rebuilding charts;
1618
- commands, identifiers and upstream error text retain their original values.
1619
- Chart view defaults to Bar chart on each page load; its dropdown switches to Line chart without another request or log scan. Both views retain the same input/output values, scale, model/source/range filters and date selection. Lines show separate input/output series, pass through each known day's value, stay between neighboring values and break across unavailable history; a lone known day is a point. The calendar is unchanged by view switching.
1620
-
1621
- Visible bar stacks rise from the baseline once over 450 ms; curves draw left to right over 600 ms (a lone point fades in over 200 ms). Opening/revealing a chart and changing its data, filters or view can replay the entrance. Selecting a day, changing calendar measure and unchanged background refreshes do not replay it. Hidden/collapsed views, page suspension and reduced-motion preferences cancel active chart motion; reduced-motion or unsupported animation APIs retain the complete static chart. Chart motion adds no polling loop, chart library or runtime dependency.
1622
-
1623
- The atom logo stays in the sidebar brand (compact top navigation on narrow screens).
1624
- It rotates once on load and manual Refresh, never on scheduled reads, and respects
1625
- reduced motion. Terminal animation settings are independent of the WebUI logo.
1626
-
1627
- Startup lists the number of discovered cached/live Provider catalogs, their model
1628
- counts and source, and separate Claude Code/App configuration states. Checking,
1629
- unavailable, preserved custom settings and uninspected configurations remain
1630
- distinct. Background discovery does not delay core readiness; its latest state
1631
- appears in the running terminal region. These observations do not prove inference
1632
- access. Normal prediction startup uses one line; exceptions retain reasons and
1633
- required restart guidance. `ccdx prediction status` retains environment/recovery
1634
- details, including routing, CA and TLS verification state.
1635
-
1636
- After Ready, a supported TTY has a bounded region: uptime, source/Claude state,
1637
- a line-framed usage/inference table, one notice row and one activity row below it.
1638
- Input includes reused input; partial usage counts returned records with missing fields.
1639
- Inference HTTP calls exclude catalog/count-tokens requests; model outcomes are
1640
- separate protocol observations, not an HTTP-success total. Activity motion includes
1641
- image MCP traffic; inference counters exclude it. Usage is process-local returned
1642
- data, not a bill or pending estimate. Counts/tokens use compact display.
1643
- Data refreshes about once a second; animation ticks reuse the table and redraw only
1644
- changed rows. Historical notices do not turn a running service into a health verdict.
1645
- Client cancellations remain in verbose/file diagnostics as informational records;
1646
- timeouts and actual failures remain notices. Non-TTY, CI, dumb and terminals under
1647
- 40 columns or 16 rows retain plain output. At 40×16 the compact table keeps all metrics and short source/Code/App states. Larger terminals wrap full state descriptions. No runtime terminal dependency is added.
1648
-
1649
- Terminal appearance lives only in Settings. Preview frames load on opening; closing, hiding the view/page or reduced
1650
- motion stops preview timers. Saving changes the running supported status terminal.
1651
-
1652
- The recent-failure view merges bounded Responses events, main-listener HTTP
1653
- failures and recent Responses/compact/Messages request timelines, with at most ten
1654
- visible entries. Request IDs correlate final outcomes; a retry alone is not proof
1655
- of recovery. It is diagnostic metadata, not a session archive. Original error
1656
- responses remain unchanged. Review upstream diagnostic prose before sharing.
1657
-
1658
- Inspect only the local Codex configuration:
1659
-
1660
- ```bash
1661
- ccdx doctor config
1662
- ```
1663
-
1664
- This command reads `~/.codex/config.toml` and checks UTF-8/TOML syntax, correctly scoped CCDX-managed URL/environment settings, positive integer context limits, their relative ordering, and `features.context_management`. Explicit `false` is valid. A missing optional shell environment section is valid for an existing file. Structured context-management settings are retained and reported as unverified for the installed Codex version.
1665
-
1666
- It also runs the existing startup writer in memory and lists the managed keys that would change. A missing file produces a creation preview. A preview that yields invalid TOML or changes unowned settings is reported as an error rather than applied. No files are written, including debug logs; it does not read credentials, contact the adapter or upstream, start Device Flow, or open Codex App. It uses `ADAPTER_HOST` and `ADAPTER_PORT` for the expected URL. Unrelated startup/probe timeout settings do not affect this config-only command.
1667
-
1668
- The syntax check uses a TOML 1.1 parser and validates only the listed managed fields, not the full installed Codex schema. It does not merge project files, profiles, environment overrides, or command-line overrides into an effective Codex configuration. Syntax errors report line/column without source snippets; configured URL and key values are not printed. The command accepts no `--online`, `--compat`, or write/fix options.
1669
-
1670
- For the broader credential/configuration/adapter diagnostic:
1671
-
1672
- ```bash
1673
- ccdx doctor
1674
- ```
1675
-
1676
- The ordinary doctor reuses the same configuration checks, inspects the saved GitHub credential, and probes the local adapter. It does not start the adapter or modify credentials or Codex configuration; when `CCDX_LOG_PATH` is set, this broader command can write its diagnostics to that log. Both doctor modes exit `1` when any check is an error, and `0` for OK/warning-only results, including missing configuration or an explicit feature opt-out. Unsupported arguments or invalid relevant CLI options exit `2`.
1677
-
1678
- To verify the saved GitHub token, Copilot entitlement, and live models endpoint without starting Device Flow or changing the credential:
1679
-
1680
- ```bash
1681
- ccdx doctor --online
1682
- ```
1683
-
1684
- To exercise the protocol through an already-running adapter:
1685
-
1686
- ```bash
1687
- ccdx doctor --compat
1688
- ```
1689
-
1690
- The compatibility doctor sends a few minimal Copilot requests covering Auto-review, native Responses, streaming history, and compaction. It consumes a small amount of Copilot usage, never starts the adapter or Device Flow, and does not change client configuration. Combine it with `--online` when both checks are needed.
1691
-
1692
- For a concise summary of the running adapter:
1693
-
1694
- ```bash
1695
- ccdx status
1696
- ```
1697
-
1698
- For the complete machine-readable status payload:
1699
-
1700
- ```bash
1701
- curl -s http://127.0.0.1:2026/_ccdx/status | jq
1702
- ```
1703
-
1704
- The status endpoint is restricted to the socket's real loopback address even when LAN binding is explicitly enabled. It reports fixed-size HTTP request counters separately from bounded `completed` / `incomplete` / `failed` / `cancelled` response outcomes by model and origin, plus bounded incomplete-reason counts, TTFT/TPOT histograms, admission pressure, memory use, response-history size/tree concentration/lookup misses, image queue/cache and adaptive-history state, model-cache counts, token expiry state, and the ten most recent upstream `response.failed` diagnostics retained by the running process. HTTP errors without a model terminal remain "without terminal" and retain their known origin; they are not counted as model failures. History eviction markers are not failed-request counts; `ccdx status` warns near the cache limit without deleting or compressing history. Failure diagnostics include the event type, model, error code/message, response/request IDs when supplied upstream, and retry outcome. Common credential forms, long opaque encrypted values, and explicitly labelled input/prompt/tool-content echoes are redacted. They are cleared when the adapter restarts. Whole request/response bodies, credential fields, and account profiles are not archived in status. Explicit HTTP diagnostic mode can retain a bounded error excerpt; see HTTP error diagnostics below. Arbitrary upstream prose cannot be guaranteed free of sensitive content; review diagnostics before sharing them.
1705
-
1706
- `stream_performance.by_route.*.empty_stream_completions` counts completed streams
1707
- with no observed output and an explicit zero output-token count. The recent request's
1708
- `empty_stream_completion` flag records the same condition. Missing usage is not zero;
1709
- non-streaming replies and observed tool/refusal output are excluded. This diagnostic
1710
- does not change completion status, trigger a retry or reject legitimate empty replies.
1711
-
1712
- `image_mcp` has its own HTTP route counter. After the image handler has been used, `image_generation` separately reports active, succeeded, failed, busy, cancelled, and chat-file delivery-failure counts, including tool errors returned with HTTP 200. A delivery failure can accompany a successful generation; it never causes another generation. Before handler initialization this field is `null`, meaning not observed, not necessarily disabled. Status never initializes that handler, reads its provider credential, installs guidance, or probes the provider. Input-image optimization metrics remain separate. `logging` reports pending records/bytes, queue caps, overflow drops, and write failures for usage and enabled debug-file logging.
1713
-
1714
- `stream_performance.by_route` also reports `request_ttft_ms`, measured from adapter entry to the first observed output delta, including local preparation. The existing `ttft_ms` continues to start at upstream dispatch. Neither timestamp means the client has drained or displayed the output. `preparation_ms` contains bounded histograms for admission (including history reservations), body reading/decompression/JSON parsing, history materialization/compact preparation, image optimization, and request serialization. Each sample measures one operation, including failed operations; retries can add samples. These are diagnostic intervals rather than a complete breakdown of request time: body reading includes internal decoded-body admission waits; authentication, routing, and other preparation are not individually timed. Non-streaming requests contribute preparation samples without inventing a first-token measurement.
1715
-
1716
- `stream_performance.recent_requests` retains at most 20 finished Responses/compact requests. Each entry contains a CCDX-owned request ID, start timestamp, bounded model/route labels, HTTP status, final model outcome, known error origin, last observed phase and provider-call count. `timings_ms` includes cumulative preparation durations and offsets from adapter entry for the first upstream dispatch, latest upstream headers, first output, latest observed upstream activity, terminal and finish. Null means not observed, not zero. Stage durations can overlap and should not be added into a total. Provider-call counts include compatibility attempts but exclude OAuth exchanges and low-level connection retries. Streams update a single activity timestamp per read; no content, headers, opaque state or unbounded event list is retained. Entries are process-local and reset on restart; normal status refresh reads them without new upstream calls or background polling.
1717
-
1718
- `http_errors` separately counts HTTP failures on tracked API routes and retains
1719
- the latest 20. Entries contain HTTP status, technical code when safe, observed
1720
- model, route/source and request IDs; the message is a fixed local explanation.
1721
- They never retain the original body, prompt, URL query or headers. Original
1722
- errors are still returned unchanged. Management/dashboard reads are excluded.
1723
- The recent-error panel merges these entries with model failures and request
1724
- timelines, retaining at most ten visible items. HTTP counts do not change model
1725
- terminal counts; unknown sources/models remain unknown.
1726
-
1727
- Every API response includes a safe `X-Request-Id` for correlation. To include the same ID in related terminal and file log lines, start with:
1728
-
1729
- ```bash
1730
- ccdx --show-request-id
1731
- ```
1732
-
1733
- ### Authentication recovery
1734
-
1735
- The dashboard's **RECENT REQUESTS** section opens by default and reuses the same
1736
- status snapshot. It shows at most 20 finished request observations: time, source, model, outcome and returned input tokens, with serialized
1737
- upstream payload bytes, image count, reported input tokens, the advertised model
1738
- window and terminal outcome, plus process-local compaction outcome counts. Missing
1739
- fields are unknown, not zero; input/window is a reference ratio, not an exact live
1740
- session measurement. No prompts, image bytes, files, tool results or extra session
1741
- scan are retained. Technical fields are folded into each row. Expanded fields survive unchanged reads and retained matching request observations; closed/hidden request groups defer row rebuilding without another API call.
1742
-
1743
- When the saved token is missing, `ccdx` looks for compatible local Copilot GitHub tokens, validates them with GitHub and Copilot, and imports a valid one before starting Device Flow. It checks explicit token sources (`CCDX_GITHUB_TOKEN`, `CCDX_GITHUB_TOKEN_PATH`, and `CCDX_GITHUB_TOKEN_PATHS`) plus common local `auth.json` layouts. Generic discovery refuses to choose silently when valid credentials for multiple GitHub accounts are found.
1744
-
1745
- Discovery also reads legacy OpenCode's `$XDG_DATA_HOME/opencode/auth.json`
1746
- (otherwise `~/.local/share/opencode/auth.json`), specifically `github-copilot`
1747
- OAuth `refresh`, and an installed GitHub CLI's noninteractive
1748
- `gh auth token --hostname github.com`. It does not import unrelated API keys,
1749
- enterprise-host OAuth, browser cookies, subscription credentials or a newer
1750
- OpenCode database format. `APPDATA` and `LOCALAPPDATA` auth.json roots are included
1751
- where present. GitHub CLI is optional, not a runtime dependency; its output/time
1752
- are bounded and no login prompt is started. Other apps' files remain read-only.
1753
- Source reads are bounded, discovery validates at most 24 distinct tokens within
1754
- a 12-second overall validation budget, and each candidate has a 4-second budget.
1755
- Directory/profile scans have explicit caps; hitting a cap or a network failure
1756
- reports incomplete discovery rather than silently selecting an account or
1757
- starting another login. Set an explicit source/account to resolve ambiguity.
1758
- An existing saved-token startup path performs no extra discovery/network calls.
1759
- Package reinstallation does not clear that user-owned credential. Copilot's short-lived
1760
- access token is obtained again when needed; it is not the saved GitHub credential.
1761
- For the default credential store, Copilot HTTP 403 preserves the credential and
1762
- reports access/network policy rather than recommending deletion. Copilot HTTP 401
1763
- performs a bounded GitHub identity check only if compatible local recovery did not
1764
- succeed. Only an identity HTTP 401 permits reauthorization guidance; an unavailable
1765
- check does not establish expiry. Neither case automatically deletes the credential
1766
- or starts Device Flow. Denials are not hidden by a cached Copilot token. A discovery
1767
- HTTP 403 also stops before Device Flow, preserving external sources and account
1768
- selection. Isolated/custom credential clients retain their own recovery contract.
1769
-
1770
- After an account is selected, automatic `401`/`403` recovery and in-process token rotation accept only that same GitHub account. Concurrent callers share token refresh work without sharing cancellation, and a still-valid Copilot token may be used briefly after a transient refresh failure. Explicit token variables remain the intentional way to select another account.
1771
-
1772
- If refresh still fails with Copilot `401` or `403`, preserve the saved credential.
1773
- Run `ccdx auth status --online` only when you explicitly want an online diagnosis;
1774
- check account entitlement and company routing policy separately. Reauthorization
1775
- is appropriate only after independent GitHub identity rejection or an explicit
1776
- account-change decision, not merely a Copilot denial, package update, or failed
1777
- network probe. Existing same-account recovery and explicit source selection are
1778
- unchanged.
1779
-
1780
- ## Account and repair tools
1781
-
1782
- `ccdx auth` defaults to local status. `auth check` is the explicit online alias: it checks GitHub identity, Copilot authorization and a bounded model directory without inference. `auth status --online` remains available. A saved file is not proof of online access. Copilot denial and network failures do not recommend reauthentication merely because access failed.
1783
-
1784
- `ccdx auth login` starts GitHub device authorization when no sign-in is saved. `ccdx auth reauth` / `ccdx reauth` explicitly replaces an existing sign-in. `auth login --reauth` is also accepted. The existing account binding is required by default; `--login ACCOUNT` explicitly requests a different account, which needs a service restart before it can become the running inference account. The device request has a 30-second deadline, GitHub's interval/slow-down responses govern polling, and the device lifetime is limited to 15 minutes. Candidate identity, entitlement and directory validation has a 15-second deadline. No candidate is saved before all checks pass. A final cross-process lock and comparison prevent overwriting a concurrently changed credential. Cancellation, denial, mismatch, expiration or validation failure preserves the prior sign-in. One WebUI flow runs per service, with a 30-second minimum between starts; connection checks coalesce and retain a same-credential result for 10 seconds.
1785
-
1786
- New explicit-tool sign-ins use `~/.local/share/ccdx/github_token` and fingerprint-bound `.account.json` metadata, with private permissions and the existing atomic paired writer. When present, this owned store takes precedence over `~/.local/share/copilot-api/github_token`; existing startup/discovery compatibility remains supported. `auth logout` requires interactive confirmation or `--yes`, writes an empty owned credential, and does not delete or revoke other apps' legacy credentials. This intentionally blocks inference's legacy fallback. New login or normal startup can perform the existing explicit discovery/sign-in process again. CLI changes notify a compatible running local service; if notification is unavailable, the CLI asks for a service restart. In-flight model requests are not replayed or forcibly stopped. A token cache invalidation preserves its running account binding, so switching accounts still requires a restart.
1787
-
1788
- Model sources uses one source selector for the selected source controls, account and catalog. Disabled sources remain under its collapsed list; there is no second list of enabled source cards. Selecting a tab is browsing only. GitHub offers sign-in, independent connection checks and cancellation; sign-out is under More actions. The browser opens only the fixed GitHub device authorization URL after the user chooses Copy & open GitHub. Its copy icon writes only the displayed short user code. The originating sign-in click prepares one asynchronous clipboard write; browsers that reject it retain an explicit copy action and selectable text. Re-rendering/polling does not repeatedly overwrite the clipboard. Clipboard reads are never requested, failed writes never show Copied, and cancelled/obsolete flow completions cannot update the new flow. Opening the link retries the copy in the click without delaying the native link activation. No token or password entry field is added. Microsoft 365 retains local account discovery/selection and source controls; its corporate SSO is not replaced with a GitHub-style login. Raw codes remain under details and last-good model lists retain their previous timestamp after failures.
1789
-
1790
- `ccdx web` opens an existing compatible dashboard or starts a management-only local listener without sign-in, app configuration, app launch, prediction setup or automatic M365 startup. It does not claim normal startup integrations are active. Stop that management listener with Ctrl+C before running normal `ccdx` for application routing and optional integrations. Opening the dashboard does not initiate a GitHub Device Flow or model inference.
1791
-
1792
- Checks & repairs performs the existing local doctor checks without adapter/client online checks. Configuration repair uses the existing owned-key writer: the preview lists scope and backup filename, a revision check rejects changes since preview, and the writer rechecks that revision under its existing config lock. It preserves unowned TOML and refuses invalid/unsafe configurations. A changed existing file is backed up as `config.toml.ccdx-doctor.bak`; an unchanged file or a missing original has no previous file to back up. The page does not expose arbitrary commands, forced restarts, certificate setup or an automatic repair loop. Compatibility probes remain the explicitly displayed `ccdx doctor --compat` command and consume usage.
1793
-
1794
- `ccdx doctor network` and the page's Network settings read proxy/trust summaries without external HTTP requests or policy edits. Linux reports environment routing; Windows/macOS also inspect their supported system settings. `ccdx doctor report` prints the local report as JSON; Export report downloads the same bounded redacted projection. Home paths and account email addresses are replaced, and credentials, arbitrary check fields, chats and request bodies are omitted. Reports include only local checks, not a full network trace or proof of provider entitlement.
1795
-
1796
- `ccdx image pause|resume` and `ccdx prediction pause|resume` use the existing service preference gates. They keep credentials, trust and routes and cannot provision a feature that has not been configured. Running image requests may finish. Offline changes apply on service startup; online prediction adaptation uses the running service's settings action. The existing full `disable-image` / `prediction off` cleanup semantics are unchanged. `ccdx source` is an alias for `ccdx m365 switch`, with the same model validation and explicit selection rules.
1797
-
1798
- The protected `/_ccdx/ui/account` and `/_ccdx/ui/checks` APIs require loopback, a local Host and `X-CCDX-Dashboard: 1`. POST actions additionally require the matching Origin and JSON content type; bodies are capped at 4 KiB with a five-second body deadline, and unknown actions/fields are rejected. GET reads only local/process state. Sign-in polling GETs read in-memory operation state and do not trigger extra GitHub polling. Device-flow controllers are cancelled when the owning listener closes. SVG state icons are shipped locally and load no external icon library; an empty circle means unknown/not checked, a circle-minus means unavailable, and running uses circle-play rather than the success check.
1799
-
1800
- ## HTTP error diagnostics
1801
-
1802
- `http_errors.recent` keeps its 20-record rolling view. Independent
1803
- `actionable_recent` (20 generation/other failures and actionable count errors),
1804
- `capability_recent` (20 count/explicit-access notices), `route_recent` (eight path errors)
1805
- and `protocol_recent` (eight image-MCP HTTP 405 records) prevent route/method noise from erasing inference
1806
- evidence. `by_category` counts inference, capability, protocol, route and other HTTP failures;
1807
- classification does not discard errors, grant access or retry requests.
1808
- The WebUI defaults to reply issues and provides separate capability/access and connection/path views. Explicitly unselected models and turned-off access remain refused with their original HTTP status, but are notices rather than model-generation failures. Client disconnects remain in recent requests rather than being promoted to the issue list. Known non-model HTTP paths show Not applicable in the UI; unknown paths are retained, not assumed harmless. Repeated capability/path notices are grouped within the bounded retained records, with their occurrence count and latest request details; raw HTTP counters remain visible. A count-endpoint 404 is not a failed generation. Count authentication, rate-limit and server failures remain actionable.
1809
-
1810
- Before model resolution, safe requested model IDs and the client hint are retained even for local rejection. Known binding failures include a specific reason: model not selected, ambiguous name, unavailable catalog entry or disabled access. These diagnostics never authorize a model or replace it with a default. Claude records propagate the actual model/source and distinguish a cached capability result from an upstream HTTP failure. Upstream attempts count logical calls; shared counts are marked `shared_upstream`, and cached 404s report zero calls. No prompt or key is retained.
1811
-
1812
- New records retain safe error code/type/parameter paths, method, an allowlisted
1813
- endpoint without a query, and upstream attempt count. Requested/served model
1814
- IDs are distinct; only the explicit Auto-review alias identifies that request
1815
- purpose. Other purposes remain unknown, not guessed from a model name.
1816
- Known enum/numeric options
1817
- include reasoning effort, service tier, output format, max output tokens and
1818
- input/tool counts; no prompt, schema or tool values are kept. `error_body` says
1819
- whether the upstream provided empty, structured or unstructured error details.
1820
- Recent request `attempts` and HTTP `attempt_timings` retain the first and last two
1821
- provider dispatch/header offsets and statuses; these are not TCP-retry counts.
1822
-
1823
- By default arbitrary upstream error prose is not copied into HTTP diagnostics.
1824
- For a specific investigation, start a **new** service with
1825
- `CCDX_HTTP_ERROR_DETAILS=1` to retain a redacted error-message excerpt, capped at
1826
- 500 characters, in those bounded in-memory records. In Windows PowerShell set
1827
- `$env:CCDX_HTTP_ERROR_DETAILS='1'` before `ccdx.cmd`. This does not reconfigure an
1828
- already-running service, enable file logging, retain whole requests, or guarantee
1829
- that arbitrary upstream prose contains no private context. Review before sharing;
1830
- unset the variable after the investigation. Records disappear on service exit.
1831
549
 
1832
550
  ## Security
1833
551
 
@@ -1835,7 +553,7 @@ unset the variable after the investigation. Records disappear on service exit.
1835
553
  - Enabling LAN binding exposes a Copilot-backed API to other reachable machines. Provide your own host firewall and network isolation; do not expose the listener to an untrusted network.
1836
554
  - Inference POSTs reject any browser `Origin` header before reading the body or contacting upstream, including simple `text/plain` requests. Native Codex/Node requests without Origin and deliberately enabled native LAN clients keep their existing access. This is not authentication or protection against untrusted local native programs.
1837
555
  - Explicit auth tools store GitHub OAuth credentials at `~/.local/share/ccdx/github_token`, with precedence over the compatible legacy `~/.local/share/copilot-api/github_token` store. Short-lived Copilot service tokens remain in process memory and are refreshed as needed. See Account and repair tools for safe replacement/sign-out behavior.
1838
- - The optional image API credential is stored separately with mode `0600` only after `ccdx enable-image`; it is never placed in Codex configuration or diagnostic output.
556
+ - The optional image API credential is stored separately with mode `0600` only after `ccdx app codex image setup`; it is never placed in Codex configuration or diagnostic output.
1839
557
  - Runtime status and usage records retain metadata by default; explicitly enabled HTTP error excerpts can contain private context. Diagnostic logging records status and error messages; it is not a general redaction layer for arbitrary error text. See Debug logging before sharing logs.
1840
558
  - Request/response bodies, request-admission queues, retained history, image work, SSE buffers, log queues, retries, and shutdown have explicit limits. These component limits are not a single process-wide memory ceiling; completed image files are persistent user artifacts, not an automatically evicted cache.
1841
559
 
@@ -1877,7 +595,7 @@ unset the variable after the investigation. Records disappear on service exit.
1877
595
  | `CCDX_AUTO_LAUNCH` | enabled | Set to `0`, `false`, `no`, or `off` to start without opening Codex App |
1878
596
  | `CCDX_GITHUB_TOKEN` | unset | Explicit GitHub Copilot OAuth token to validate and import before Device Flow |
1879
597
  | `CCDX_GITHUB_TOKEN_PATH` | unset | Explicit file containing a GitHub Copilot OAuth token |
1880
- | `CCDX_GITHUB_TOKEN_PATHS` | unset | Multiple token files separated by the platform path delimiter (`:` on macOS/Linux, `;` on Windows) |
598
+ | `CCDX_GITHUB_TOKEN_PATHS` | unset | Multiple token files separated by the platform path delimiter (`:` on macOS, `;` on Windows) |
1881
599
  | `CCDX_GITHUB_LOGIN` | saved account | Require automatic discovery and recovery to use this GitHub login |
1882
600
  | `CCDX_DISABLE_TOKEN_DISCOVERY` | unset | Set to `1` to skip local token discovery and use the saved token or Device Flow |
1883
601
  | `CCDX_TOKEN_LOCK_TIMEOUT_MS` | `600000` | Maximum time to wait for another process to finish GitHub token login or import |
@@ -1885,7 +603,7 @@ unset the variable after the investigation. Records disappear on service exit.
1885
603
  | `CCDX_EXISTING_ADAPTER_TIMEOUT_MS` | `500` | Timeout for detecting an already-running local adapter during startup |
1886
604
  | `CCDX_MODEL_REFRESH_TIMEOUT_MS` | `5000` | Timeout for Copilot model refresh or live Auto-review model lookup |
1887
605
  | `CCDX_MODEL_REFRESH_INTERVAL_MS` | `7200000` | Periodic model refresh interval; `0` disables periodic refresh, while startup cache/refresh behavior still applies |
1888
- | `CCDX_RESPONSE_HISTORY_MAX_BYTES` | `67108864` | Higher-precedence total in-memory byte budget for locally expanded Responses history; `ccdx cache --limit` provides a persistent 16–1024 MiB setting when this is unset |
606
+ | `CCDX_RESPONSE_HISTORY_MAX_BYTES` | `67108864` | Higher-precedence total in-memory byte budget for locally expanded Responses history; `ccdx doctor cache --limit` provides a persistent 16–1024 MiB setting when this is unset |
1889
607
  | `CCDX_RESPONSE_HISTORY_MAX_ENTRIES` | `4096` | Maximum stored incremental Responses history nodes |
1890
608
  | `CCDX_USAGE_PATH` | `~/.local/share/codex-copilot-dx/usage.jsonl` | Local JSONL token-usage log |
1891
609
  | `CCDX_USAGE_MAX_BYTES` | `33554432` | Rotate the usage log at this size and retain one `.1` backup; set to `0` to disable rotation |
@@ -1912,6 +630,7 @@ Diagnostic redaction removes Basic authorization payloads and URL userinfo, and
1912
630
 
1913
631
  Set `CCDX_LOG_PATH=1` to record diagnostic logs independently of quiet terminal presentation to `~/.local/share/codex-copilot-dx/debug.log`, or provide a custom path. Add `CCDX_LOG_LEVEL=debug` for upstream attempts, retry causes, status codes, and timings. The adapter does not deliberately dump request/response bodies or authorization headers. File diagnostics redact common credential forms and labelled content echoes, but this cannot identify every secret in arbitrary external prose; review logs before sharing them. File writes are asynchronous and batched with a 4096-record / 2 MiB pending-and-in-flight ceiling. Overflow drops excess file records with one warning and a status counter; terminal output continues. CLI exit paths flush for at most 1.5 seconds. `ccdx doctor config` bypasses file logging entirely.
1914
632
 
633
+
1915
634
  ## Large histories and images
1916
635
 
1917
636
  Long computer-use sessions can accumulate screenshots that are sent again on later turns. This can increase local preparation time, upstream handshake latency, and the chance of a `413 Payload Too Large` response.
@@ -1956,431 +675,22 @@ Newer Codex App builds can advertise an `image_gen` namespace that already exist
1956
675
 
1957
676
  ## Development
1958
677
 
1959
- ```bash
1960
- npm ci
1961
- npm run verify
1962
- npm run bench:payload
1963
- ```
1964
-
1965
- `bench:check` covers both SSE parsers, including native Responses identity rewriting, 1/4/8 MiB fragmented events, write batching, and slow-client backpressure. It also repeats four concurrent image preparations across six rounds using a desktop-sized synthetic screenshot and a public-domain photograph. Checks enforce content preservation, single-pass JSON parsing, bounded copying, cache reuse, settled work, and bounded retained heap/ArrayBuffers after warm-up and GC. Sampled RSS and absolute timings remain report-only because allocators, runtimes, and machines differ; the fixtures do not establish production latency or visual model accuracy.
1966
-
1967
- `npm test` runs unit, handler, CLI, and documentation-contract tests. `npm run test:smoke` starts a real local adapter with fully injected offline upstreams. `npm run bench:check` enforces linear SSE scanning, image/tool processing, and request-admission resource limits. `npm run pack:check` verifies npm tarball contents without publishing. `npm run bench:payload` is a report-only isolated-process benchmark for 5–60 MiB synthetic padded-image payloads and does not contact Copilot. CI runs the complete `verify` gate on Node 22.15.0 and 24.x.
1968
-
1969
- The [documentation index](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/README.md) distinguishes current guidance from historical release evidence. Release reports retain the measurements and limits of their specific versions; they do not establish current live-provider compatibility.
1970
-
1971
- From a source checkout, `node scripts/codex-message-id-replay.mjs --codex /absolute/path/to/codex` checks message identity against an installed Codex runtime using only synthetic SSE, a local mock server, and automatically cleaned temporary Codex directories. It does not use the real client configuration or call Copilot.
678
+ Run `npm run verify` for unit tests, streaming smoke, resource budgets and package checks. Native Windows and macOS CI verifies installers, credential/configuration ownership, client protocols and the browser UI. Keep inference tests synthetic unless an online probe is explicitly requested. Release evidence stays in dated release notes; architecture proposals are separate from implemented guarantees.
1972
679
 
1973
680
  ## License
1974
681
 
1975
682
  MIT
1976
683
 
684
+ ## Common environment controls
1977
685
 
1978
- ### Live request flow and timing estimates
1979
-
1980
- Request flow is a read-only view of active Responses, Responses compaction and
1981
- Claude Messages requests observed by CCDX; it excludes image-MCP, token counting,
1982
- catalog and management calls. It groups
1983
- apps and source/model pairs; a model used through two sources stays separate.
1984
- `X-CCDX-Client` recognizes `codex-app`, `codex-cli`, `claude-app`, `claude-code`;
1985
- known Codex `originator` values also provide labels, including the actual
1986
- `Codex Desktop` spelling. Explicit client hints take precedence, followed by known
1987
- originators, then known versioned Codex User-Agent prefixes. A generic `codex`
1988
- prefix identifies only the Codex family, not App versus CLI. Unknown clients are
1989
- shown as Unidentified app (the existing `api` metadata ID is retained); unmarked
1990
- Messages requests remain Claude (app unspecified). These are client-reported
1991
- presentation hints, never verified identities, authorization or routing inputs.
1992
- Only bounded scalar strings are inspected; no User-Agent/header text is retained.
1993
- An unrelated agent containing the word Codex does not match.
1994
-
1995
- Only observed first output starts moving dots. A started attempt without output
1996
- is waiting, a subsequent attempt is retrying, and terminal evidence awaiting
1997
- connection completion is finishing. No fresh status for six seconds means unknown,
1998
- not idle or successful. Auto refresh off therefore expires the view. Hidden pages
1999
- pause animation; reduced-motion uses static dots. Idle retains bounded last-known
2000
- nodes with zero counts; unknown retained counts are dashes. Initially up to 12
2001
- model groups are visible, with an explicit show-more control. Snapshots retain up
2002
- to 64 details per metrics instance; exact active totals may be higher and omitted
2003
- details are reported. With omitted details, observed group counts use ≥; retained
2004
- nodes with no current detail use dashes, even while the exact total is active. Short requests between two status reads can appear only in
2005
- the finished table; the diagram does not fabricate or replay them.
2006
-
2007
- A single app/source-model route has aligned name/hub anchors and straight paths,
2008
- even when multiple requests share that route. Branches alone use rounded curves.
2009
- Known singleton and idle-zero node counts are hidden. Concurrent counts read
2010
- “2 requests” beside the name and outside its selected area; lower bounds retain ≥
2011
- and missing/stale counts remain dashes. The exact active total appears once in
2012
- the flow header, not again below the logo.
2013
-
2014
- Clicking an app or model name filters only active details. Counts, source totals,
2015
- all five terminal outcomes (including unknown), last 20 finished requests and
2016
- issues remain available. No prompt/image/credential is added to active telemetry.
2017
- The existing local-dashboard host/origin protections apply to the new flow asset.
2018
-
2019
- Codex and Claude request-performance panels show approximate first-output P50/P95
2020
- in milliseconds with sample counts. Values come from existing histogram buckets,
2021
- not raw samples; the highest bucket uses the observed maximum. These are the
2022
- upstream first-output observations already used for the mean, include failures
2023
- after partial output, and do not measure user-perceived completion or promise a
2024
- routing improvement. No samples displays a dash.
2025
-
2026
-
2027
- ### Account shortcuts and compact toolbar (1.2.12)
2028
-
2029
- Checks & repairs offers equal-height GitHub account / M365 account shortcuts.
2030
- Both open the corresponding model-source page; neither starts a connection check,
2031
- account enumeration, login or model call. Actual checks stay on that source page.
2032
- The M365 shortcut retains link semantics and the shared button appearance.
2033
-
2034
- Auto refresh has content-based width, sized for the longer localized on/off label
2035
- so toggling it does not shift nearby controls. The language control has a 40px
2036
- minimum width, cannot flex-shrink and keeps 中文 / EN on one line. Compact toolbars
2037
- wrap when required rather than compressing text; header position remains stable
2038
- between modules in the same language and viewport.
2039
-
2040
- ### Application editing and keyboard behavior (1.2.20)
2041
-
2042
- Codex, Claude App and Claude Code keep separate page-local model/default/sync
2043
- drafts. Switching clients, navigating within the dashboard or reading current
2044
- settings preserves unsaved drafts. Save and Discard changes affect that client
2045
- only; reloading the browser discards page-local drafts. Model selection restores
2046
- focus to the corresponding checkbox/default button. Add API focuses its first
2047
- field; Cancel restores the entry control. Narrow layouts stack source, context
2048
- and reasoning below each model while retaining the same table semantics.
2049
-
2050
- Reading a catalog marks only its Read models button busy and offers Cancel.
2051
- Cancelling leaves the editor and its draft intact. No inference is sent. Source
2052
- saves report persistence separately from subsequent metadata refresh. Background
2053
- read failures retain existing messages; key read/save states use polite live
2054
- announcements. Account labels and values stay paired, and request summaries use
2055
- configured source names. Technical IDs remain available in request details.
2056
-
2057
- ### Codex App updates and model selection
2058
-
2059
- After an App update, completely quit and reopen the App once if the model list is
2060
- empty, then inspect `ccdx doctor`. On macOS, doctor reads bundled CLI package
2061
- metadata and the optional model-cache version without executing a binary or
2062
- altering the cache. A version mismatch is a diagnostic hint; it does not prove
2063
- that the cache caused a failed catalog. HTTP catalog `models` and app-server RPC
2064
- `model/list.data` are different layers, not evidence by themselves of a format
2065
- regression between client versions.
2066
-
2067
- The Responses WebSocket protocol is not implemented by CCDX. Upgrade requests
2068
- are refused promptly so supported native clients can fall back to HTTP/SSE.
2069
- This is tested separately from model-directory and provider-identity behavior;
2070
- SSE events are not relabeled as a WebSocket protocol.
2071
-
2072
-
2073
- ### Nightly updates (opt-in)
2074
-
2075
- Available from 1.2.22 after one manual upgrade. Settings → Version & updates →
2076
- Update overnight writes the boolean `nightly_updates`, false when absent. Enabling
2077
- it requires a normal CCDX restart; disabling it cancels pending automatic work in
2078
- a supervised service. Management-only `ccdx web` never installs updates. The risk
2079
- text explains that automatic installation/restart can affect conversation
2080
- continuation. The feature does not promise zero downtime or infallible rollback.
2081
-
2082
- Only an owned, writable npm installation with recognized command launchers can
2083
- use the supervisor. Standard execution stays unchanged when disabled. When enabled,
2084
- a foreground parent runs the gateway from an immutable private package tree;
2085
- Ctrl+C stops both, and no launchd/systemd/Windows service or boot task is installed.
2086
- Stopping CCDX, sleeping or powering off does not start a separate updater. After
2087
- a long observation gap, a new ten-minute idle interval is required.
2088
-
2089
- The parent observes bounded local state once a minute. A release check occurs at
2090
- most once per local calendar day, within 00:00–04:00, after ten observed idle
2091
- minutes. The new version must be a stable patch in the same major/minor series
2092
- and have been published at least 24 hours earlier. No prerelease or automatic
2093
- minor/major migration is accepted. Active inference, image work, configuration
2094
- operations, discovery or sign-in defer the update. New work during preparation
2095
- also defers it. Checks do not invoke models.
2096
-
2097
- Preparation uses the official pinned GitHub Release tarball and checksum, an
2098
- independent npm prefix, the configured registry/proxy/CA/TLS/offline policy and
2099
- ignored lifecycle scripts. Existing private-runtime launchers are regenerated;
2100
- custom launchers are not silently claimed. No Git, new Node installation,
2101
- permission override, certificate change or public-registry fallback is added.
2102
- A policy refusal, unavailable dependency or runtime check failure leaves the
2103
- current service running. The supported native broker is checked when already
2104
- present in the original installation.
2105
-
2106
- Before switching, the parent compares client/configuration fingerprints and
2107
- authorized model/default selections, backs up the global package and commands,
2108
- and validates the candidate on an internal loopback-only ephemeral listener while
2109
- the current instance continues serving. Previously healthy selected sources must remain healthy, every previously
2110
- published model must remain available, and defaults/credential scopes must match.
2111
- Additional upstream models are allowed. API discovery publication and client
2112
- writers are paused during this warmup. Only then is the old gateway quiesced.
2113
- A bounded private IPC message transfers Responses
2114
- history, source-scoped parent links/opaque items, image-edit references and
2115
- already-cached API keys limited to unchanged configured references.
2116
- Conversation payloads, image references and cached keys are never written to a
2117
- handoff file or diagnostics. Ordinary process-local counters begin a new run;
2118
- retained usage files remain available.
2119
- The combined serialized state is limited to 64 MiB; oversized/busy state defers
2120
- the update without eviction. New requests during the brief switching interval
2121
- can receive a temporary failure with `Retry-After: 1`.
2122
-
2123
- The warmed replacement imports state before taking over the same main port. Its
2124
- maintenance startup preserves client configuration, skips interactive GitHub
2125
- login, and opens neither browser nor client. Model/default selections and
2126
- configuration fingerprints must match before it accepts normal traffic. Failed
2127
- startup, discovery or a mismatched candidate leaves the original instance
2128
- alive. A failed port/prediction handover attempts package rollback and resumes
2129
- that same instance with its original caches. Cleanup of a retired runtime is
2130
- best-effort; pending cleanup suspends further automatic transitions. The old
2131
- process is retired only
2132
- after the replacement has acknowledged acceptance. A deliberate Ctrl+C
2133
- never starts another worker. Unexpected later worker exits are reported once;
2134
- this is not a general crash-respawn mechanism.
2135
-
2136
- The private `nightly-update-state.json` beside settings stores only the attempted
2137
- local day and paused version. Installed candidates that fail verification are
2138
- not repeatedly attempted; a newer version or explicit manual update is needed.
2139
- Unreadable records pause automatic updates without stopping the gateway. A
2140
- failed package rollback or failed restoration can require manual recovery;
2141
- Settings retains the full platform installation commands.
2142
-
2143
- ### Web resilience and resource versions
2144
-
2145
- Optional status/usage/animation views contain local initialization/render errors,
2146
- retain the surrounding shell and expose a local retry. Retry replays only the
2147
- latest bounded call state per view method. Network errors retain their existing
2148
- last-successful snapshots and explicit unknown/error status. Request-flow detail
2149
- rows are keyed and updated in place, retaining selection and DOM identity.
2150
-
2151
- The flow atom's thin ring is static while idle and rotates once per five seconds
2152
- while fresh active requests are observed, including waits/retries. The atom itself
2153
- does not rotate; counts do not accelerate the ring. Hidden/stale views stop it,
2154
- and reduced motion disables rotation. Existing curves, tables, palettes,
2155
- client identification and authorization remain unchanged.
2156
-
2157
- Static dashboard bytes are snapshotted together on first use and reused by the
2158
- process. HTML remains `no-store` and stamps script/style URLs with the service
2159
- version. Other assets use content-derived ETags and `no-cache` revalidation;
2160
- matching validators return 304. A mismatched version query returns 409 rather
2161
- than mixing resources, requiring a page reload. If the installed package changed
2162
- before a coherent bundle could be loaded, the optional page fails explicitly;
2163
- inference remains separate. Protected JSON/account/settings routes stay
2164
- `no-store`. No API-body caching, compression worker or new dependency is added.
2165
-
2166
- `CCDX_SUPERVISED_SERVICE` is an internal inherited worker marker. It is used only
2167
- with a private parent IPC channel; do not set it as a user preference. It grants
2168
- no network action and is not a replacement for the saved nightly-update opt-in.
2169
-
2170
-
2171
- ### Manual API token counting
2172
-
2173
- Messages support does not establish support for `POST /v1/messages/count_tokens`.
2174
- CCDX forwards the configured Messages endpoint plus `/count_tokens`. A manual
2175
- API's observed HTTP 404 is remembered in memory for 60 seconds, separately for
2176
- each model and Anthropic version/beta-header scope. This is an observed endpoint
2177
- failure, not a declaration that the model source is down. Cached and initial
2178
- results return HTTP 404 with `ccdx_api_count_tokens_unavailable`; no estimated
2179
- or synthetic count is returned. Changing the source configuration/key creates
2180
- a new scope. Other statuses, including 401/403/405/429/5xx, are not cached by
2181
- this compatibility mechanism; status and safe Retry-After metadata survive.
2182
-
2183
- Identical concurrent count requests share one bounded upstream operation.
2184
- Each caller cancels independently; the last cancelled waiter aborts shared
2185
- work. Before a model/header scope has a capability observation, distinct inputs
2186
- wait for its first real admitted count request. An observed 404 is reused by
2187
- those waiters; success is reused only for identical inputs. Distinct inputs
2188
- then run their own counts. Capability waiting has at most 16 in-flight scopes
2189
- and remains under normal gateway body/queue admission. Capability waiting and
2190
- the caller's own count share its existing upstream timeout budget. Identical-result sharing
2191
- is limited to bodies up to 1 MiB, 16 operations and 4 MiB of shared request text.
2192
- Larger supported inputs and overflow use their normal admitted path. Count responses are capped at 64 KiB. At most 128 capability observations are retained. A 404 expires after one
2193
- minute; a positive observation permits normal concurrency and a later 404 can
2194
- replace it. Successful results and request bodies are not retained
2195
- after the operation. Counts neither invoke generation nor fail over to another
2196
- source. This does not supply a missing tokenizer or guarantee every Claude App
2197
- context-management feature on a third-party model.
2198
-
2199
- Background manual-API catalog failures back off for 1, 5, 30 and then 120
2200
- minutes; successful publication resets the sequence. Explicit refresh retains
2201
- the existing one-minute minimum interval rather than the longer background
2202
- backoff. A valid upstream Retry-After also applies, bounded to 24 hours. These
2203
- are read eligibility gates, not added background retry timers. Revision changes
2204
- invalidate prior eligibility and obsolete results never publish.
2205
-
2206
- Claude Code's validated `x-claude-code-agent-id` separates a child task's local
2207
- source guard from its parent's guard when a session is identified. Parent keys
2208
- without that header remain unchanged. This header is correlation only: model
2209
- access and the company's account/history checks remain authoritative.
2210
-
2211
-
2212
- ### Claude App cross-source continuation
2213
-
2214
- In Claude App, choose another model that you have selected and authorized for
2215
- that app. CCDX can continue the same conversation across Messages sources using
2216
- the complete history supplied by the client. This is explicit model selection,
2217
- not automatic failover. Codex and Claude Code retain their existing source rules.
2218
-
2219
- CCDX preserves the original client conversation. In the forwarded request it
2220
- keeps visible messages, available image/document content, and completed native
2221
- tool calls/results; it removes incompatible old-source thinking and records a
2222
- hashed history checkpoint. Subsequent thinking from the new source is retained.
2223
- A changed/compacted client prefix is rebuilt only between completed tool turns.
2224
- No automatic summary, tool execution, history truncation or hidden inference is
2225
- added. Target capabilities and input/output limits still apply; unsupported
2226
- upstream behavior is reported without retrying another source.
2227
-
2228
- Finish a running response/tool operation before changing sources. Incomplete
2229
- tool pairs, source-owned file/container handles and unrecoverable encrypted
2230
- history require completing the operation or restoring the original content.
2231
- Known history belonging to a different company account remains blocked. Model
2232
- validation and token counting do not move a conversation's source. A failed
2233
- request before usable output leaves its prior checkpoint; partial output keeps
2234
- the actual new-source checkpoint and is never automatically replayed.
2235
-
2236
- `conversation-transfers.json`, beside `connections.json`, stores at most 1024
2237
- HMAC-keyed entries with source/prefix hashes and message counts, within a 512 KiB
2238
- read limit. It stores no prompts, files, raw session IDs or credentials. Records
2239
- survive ordinary service restart; corrupt records are preserved and reported,
2240
- not replaced with empty defaults. This does not persist Responses history or
2241
- change Codex login/provider/model-list configuration.
2242
-
2243
- `conversation-prefixes.json` adds a second bounded receipt with protocol-equivalent
2244
- block fingerprints. A string and its single text block compare equally, and
2245
- combining adjacent same-role messages preserves the proved block prefix. This
2246
- changes only comparison, not the client's messages. Text/code whitespace and
2247
- tool argument values remain significant. Each semantic receipt is tied to the
2248
- legacy owner/count/hash; an older writer makes stale semantic proof ineligible.
2249
- The pair commits atomically. Legacy receipts upgrade only when their prefix is
2250
- proved, and the original legacy file remains readable by older versions. Each
2251
- file is limited to 1024 keys and a 512 KiB read. No tool or private state is
2252
- replayed to work around an unknown prefix or account mismatch. Rejections report
2253
- whether the source changed or the prefix changed, and whether a tool result is
2254
- missing/unmatched or a tool turn is active.
2255
-
2256
- ### Explicit M365 app access and directory read receipts
2257
-
2258
- Model sources → Microsoft 365 → Allowed apps grants the current source to one,
2259
- several or no enabled apps. Granting access does not choose models or change the
2260
- current source. Removing access removes only that source's selected routes,
2261
- preserving other source selections and an unavailable default until explicitly
2262
- replaced. The runtime enforces revoked access even if a client retains its old
2263
- model menu. Shared legacy Claude-key migration reports which retained consumers
2264
- need reopening. Existing saved grants/owned legacy setups are retained; first-time
2265
- discovery/sign-in alone does not connect all apps. An explicit CLI M365 source
2266
- choice authorizes Codex only. Ordinary grants do not synchronize unrelated Codex
2267
- configuration, authentication or catalogs.
2268
-
2269
- M365's explicit directory refresh always requests the network, even when a
2270
- usable local model cache exists. `Cache-Control: no-cache` and `Pragma: no-cache`
2271
- request HTTP revalidation through the existing transport. They do not bypass
2272
- enterprise proxies, certificates, account policies or change token refresh.
2273
- The read summary distinguishes network from CCDX cache, records the data time,
2274
- raw total, compatible GPT/Claude counts and locally excluded count. Collapsed
2275
- details include sanitized upstream/client correlation IDs, HTTP status and a
2276
- bounded upstream Age value when returned. A network response containing five
2277
- models replaces an older fifteen-model cache; a failed check preserves and
2278
- labels prior data. Directory access is not inference authorization. There is no
2279
- automatic empty-directory substitution, fabricated Claude entry, extra polling
2280
- loop or inference probe. Correlation IDs are receipts, not proof that every
2281
- intermediate proxy honored revalidation.
2282
-
2283
- ### Upstream maker metadata
2284
-
2285
- Manual API discovery accepts bounded text from publisher, vendor, owned_by, display_name and name.
2286
- The model maker shown in lists/details prefers publisher, then vendor; owned_by
2287
- is shown separately as ownership and is not treated as the maker. Absent maker
2288
- information is Not provided; no name-based inference is performed. These are
2289
- upstream declarations, not proof of backend identity.
2290
-
2291
- Rebuildable per-source files under `api-model-display/` beside settings are
2292
- scoped by source ID and deployment revision. They preserve at most 500 models,
2293
- 512 KiB per file and 16 in-memory sources. They contain only model IDs and
2294
- identity declarations, no key or response body. Old versions ignore them;
2295
- connection v2 metadata remains readable during rollback. The new read-only
2296
- `model_display` source field and per-discovery `display` field are ignored if
2297
- round-tripped into Save API; unknown configuration fields still fail validation. Missing display
2298
- evidence triggers the existing normal catalog read rather than requiring key
2299
- entry or model reselection. Failed discovery retains valid prior evidence for
2300
- the same revision; invalid optional display cache does not block inference.
2301
-
2302
- ### Memory-extraction dependency notices
2303
-
2304
- The Codex model editor reads [`memories.extract_model`](https://learn.chatgpt.com/docs/customization/memories#configure-local-memories) when explicitly configured
2305
- in the native Codex config. Otherwise, it may show a recently observed extraction
2306
- model from a bounded read-only correlation of native Phase 1 task failures and
2307
- one unambiguous local HTTP 400 model. No prompt, memory text or model-name
2308
- heuristic is used. Explicit configuration is labelled Configured in Codex;
2309
- observations are Recently observed. The current client does not expose its
2310
- compiled default in the queried interface, so CCDX does not label a guessed
2311
- model as Codex default. With memory generation explicitly enabled but no model
2312
- evidence, the editor shows Chosen by Codex and Default model ID not available;
2313
- this does not infer a model from the checked model list or claim a successful
2314
- memory write. With generation explicitly disabled it shows Memory generation is
2315
- off. Unknown generation state and no model evidence remain Not detected.
2316
-
2317
- The optional native log helper runs only on startup/connection-view reads (including an explicit WebUI refresh),
2318
- coalesced and at least one minute apart, with a 2.5-second limit. It reads up to
2319
- eight task records and sixteen candidate HTTP records each, clipped to 8 KiB,
2320
- from the prior 24 hours. It uses the bundled Node SQLite API in a separate
2321
- read-only process; missing/locked/unsupported stores remain optional. Only a
2322
- model ID and observation time can enter `codex-memory-observed.json`, scoped by
2323
- the Codex profile, with a 24-hour freshness bound. No periodic log scanner,
2324
- account lookup, native Codex process or inference is started by this helper.
2325
-
2326
- Closing a known extraction model or its source in WebUI prompts about new-memory
2327
- generation and preserves your explicit decision. The draft is separate from the
2328
- saved selection. Existing memories are not deleted. Native memory generation
2329
- settings, model aliases, defaults, authentication and authorization are not
2330
- changed to satisfy a dependency. Confirmations are WebUI guidance, not a new
2331
- requirement on existing CLI/API operations. A notice does not identify every
2332
- background task or prove that memory generation succeeded.
2333
-
2334
- ### Messages stop and network evidence
2335
-
2336
- Recent Messages records retain declared context size, requested and forwarded
2337
- output budgets, normalized returned input/output usage, and an allowlisted stop
2338
- reason when supplied. Missing values remain unknown. `max_tokens` is shown as
2339
- output-limit termination; CCDX does not raise an undeclared GLM output limit or
2340
- use context length as an output ceiling. HTTP success and complete generation
2341
- remain distinct.
2342
-
2343
- API transport errors retain fixed safe code, DNS/connect/TLS/request/response
2344
- phase and reused-socket state in HTTP diagnostics. They do not retain raw
2345
- exceptions or URLs, and do not trigger automatic POST or cross-source retries.
2346
-
2347
-
2348
- ### Model presentation and source impact (1.2.31)
2349
-
2350
- Model upstream IDs, source-qualified routes and client aliases retain their existing identities. Presentation follows a valid upstream display_name, then name, then the upstream ID. The shared client plan adds a source suffix only for ambiguous display labels; same-source display collisions include the upstream ID. No capability or backend identity is inferred from a name. The display cache stays separate from connection v2 and is bound to the source deployment revision. Display-only changes invalidate the client plan and reconcile selected consumers without changing their grants or defaults. Claude configuration uses labelOverride even when a mixed binding's default source is not an API. Existing client list order, user context preferences and configuration ownership are retained. The gateway directory and written configuration share display labels; user-preserved ordering is not replaced with a vendor-family ranking.
2351
-
2352
- Application pages distinguish saved selections from configuration-write results. A written configuration is not evidence that an already running App adopted it. Reopen the client to load changes. Manual-sync settings, preserved fields, missing defaults and failed writes retain separate statuses. When client capability controls are unverified, existing shared capability settings are kept; this does not assert support for those controls in the new version.
2353
-
2354
- Closing a source reviews selected deployments for every enabled app, including nondefault and temporarily unavailable selections. The preview reports selected-model counts and whether the default needs replacement. A still-valid default stays unchanged. Losing the default or the last selection requires an explicit replacement or pause through the existing access semantics. The WebUI submits an impact revision; changes to bindings or source identity invalidate that confirmation. Mere authorization without selected models is not counted as model consumption.
2355
-
2356
- ### Disclosure motion and scoped interface changes (1.2.31)
2357
-
2358
- Native details/summary controls use one theme-colored SVG chevron: down while closed, up while open. Rotation takes 160 ms; visible content uses a 160 ms opening and 110 ms closing opacity/translation transition, without height animation. Keyboard activation, cancellation by rapid toggling, translated summaries and dynamically inserted disclosures remain supported. Reduced-motion mode uses native immediate toggles, and backgrounding finishes pending transitions. The animation script is a versioned same-origin dashboard asset.
2359
-
2360
- The existing palettes, sidebar, atom, solid selected controls and usage views remain. All retained usage totals, source/model filters, 7/30/90-day trends, bar/line views and 365-day activity are retained. Checks hide the empty results header until results exist. Animation style has one specific disclosure title; saved/effective differences are expressed on one line. Coarse-pointer switch labels and toolbar icon targets expand without enlarging the drawn switches.
2361
-
2362
- ### Successful HTTP transport carrying model errors (1.2.31)
2363
-
2364
- A native Messages JSON error envelope under HTTP 200, or an SSE error event under a successful HTTP status, is recorded as model.error with the original HTTP status and a bounded structured error code/type. Existing failed-model accounting remains. The original response bytes/status are preserved; no automatic retry or replay is added. Normal output carrying incidental error-like fields is not reclassified. Token-count errors remain in their separate capability category. Request issue summaries lead with known plain-language causes, while technical codes, IDs, original diagnostic fields and clipboard export remain available in details.
2365
-
2366
-
2367
- ### Flow alignment and system fonts (1.2.32)
2368
-
2369
- Applications, request counts and their status lines share a right-aligned edge;
2370
- source/model nodes retain their shared left edge. Application wire anchors no
2371
- longer move with label width or mixed singleton/group counts. The existing
2372
- rounded turns, dashed activity, selection and reduced-motion behavior remain.
2373
- Narrow layouts keep counts below the application name and aligned to the same
2374
- text edge.
2375
-
2376
- The WebUI retains its Latin monospace stack and explicitly names Chinese
2377
- sans-serif system fallbacks before generic monospace: Microsoft YaHei UI/YaHei,
2378
- PingFang SC, Noto Sans CJK SC/Noto Sans SC and WenQuanYi Micro Hei. Form controls
2379
- inherit the page family; code and terminal samples reuse the same stack. No font
2380
- is downloaded or installed. Available system fonts determine the exact glyphs;
2381
- unsupported scripts still use browser fallback.
2382
-
2383
- Pure white uses the existing independent light/dark toggle, browser persistence,
2384
- cross-tab updates, automatic/manual saving, and pre-reset backup/restore. It does
2385
- not change the default green palette or the terminal palette and does not change
2386
- Codex/Claude routing, credentials or model selections.
686
+ | Variable | Use |
687
+ | --- | --- |
688
+ | `ADAPTER_HOST` | Listener host; default loopback |
689
+ | `ADAPTER_PORT` | Main listener port; default 2026 |
690
+ | `CCDX_AUTO_LAUNCH` | Set to 0 to skip opening Codex |
691
+ | `CCDX_M365` | Set to 0 to disable the company source for this run |
692
+ | `CCDX_USAGE_PATH` | Recorded usage file path |
693
+ | `CCDX_LOG_LEVEL` | Optional diagnostic logging level |
694
+ | `CCDX_LOG_PATH` | Optional diagnostic log path |
695
+
696
+ Internal supervisor and installer environment fields are not user settings.