codex-copilot-dx 1.2.29 → 1.2.31

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.
package/README.md CHANGED
@@ -11,13 +11,13 @@ npm install -g codex-copilot-dx@latest
11
11
  ccdx
12
12
  ```
13
13
 
14
- No Node or Git? Download [install.sh](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.29/install.sh) (macOS/Linux) or [install.ps1](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.29/install.ps1) (Windows), then run `sh install.sh` or `./install.ps1` under your current shell policy. The bootstrap reuses compatible Node/npm or installs verified official Node 24.22.0 privately for CCDX. It adds no Git, compiler or system package manager. It keeps registry/proxy/certificate policy, verifies the Release package and installed runtime, and restores the prior CCDX package if installation fails. Dependencies still need your configured registry. See [installation limits and private command paths](docs/REFERENCE.md#install-without-node-or-git).
14
+ No Node or Git? Download [install.sh](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.31/install.sh) (macOS/Linux) or [install.ps1](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.31/install.ps1) (Windows), then run `sh install.sh` or `./install.ps1` under your current shell policy. The bootstrap reuses compatible Node/npm or installs verified official Node 24.22.0 privately for CCDX. It adds no Git, compiler or system package manager. It keeps registry/proxy/certificate policy, verifies the Release package and installed runtime, and restores the prior CCDX package if installation fails. Manifest-listed complete packages install their bundled dependencies offline; older source-only releases need the configured registry. See [installation limits and private command paths](docs/REFERENCE.md#install-without-node-or-git).
15
15
 
16
16
  CCDX reuses a compatible local credential or starts GitHub Device Flow, listens on `127.0.0.1:2026`, configures Codex, and opens the App. Interactive desktop starts also open the local WebUI once; use `ccdx --no-browser` or disable this in WebUI settings. No client binary patch is needed. On Windows, open the App manually unless native prediction setup is enabled. In restricted Windows PowerShell, use `npm.cmd` to install and `ccdx.cmd` for the first launch, or run `ccdx.cmd doctor --fix`. Startup, updates and explicit repair remove only CCDX's exact npm-generated `.ps1` launchers so later calls can use `ccdx`. The npm package adds no install hook or policy change; custom launchers are preserved. npm's own script is untouched. The configured `dummy` API key is a placeholder, not a credential.
17
17
 
18
18
  The [local control console](http://127.0.0.1:2026/) separates Overview, Codex/Claude, Model sources, Usage, Requests, Checks & repairs and Settings, with a stable sticky header. Model sources owns API accounts, keys and model capabilities; application pages own visible models and defaults. Settings owns independent web/terminal colors (classic green, Klein blue or Soft pink), startup and updates. Accounts and model catalogs stay with Model sources; client-specific tools stay with their application. CLI remains English; WebUI supports English/Chinese. Codex shows evidenced memory-model dependencies and warns before closing them; native memory settings remain yours. An interactive terminal shows bounded startup checks, source/client state, a usage table with approximate cache hit rate, notices and animation. Plain/NO_COLOR/narrow output remains supported; `--verbose` retains request detail.
19
19
 
20
- Requests shows live app/source/model flow above existing summaries and finished records; a thin theme-colored ring rotates around its atom while requests are active. Usage offers animated bars or curves; reduced motion stays static. Hidden pages stop scheduled reads; status refreshes about every two seconds and source/settings evidence about every 16 seconds. Catalogs and retained usage load on demand or every 30 minutes while open. The UI does not add inference calls. Ready means local service availability, not verified model access. First output uses ms, speed token/s, and partial/unknown usage remains explicit. Images/predictions stay opt-in; their first setup uses CLI. 1.2.18 preserves Codex sign-in and unavailable model selections after saving bindings. See the [control reference](docs/REFERENCE.md#control-console-and-online-settings), [1.2.18 fixes and verification](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/RELEASE_1.2.18.md) and [copy inventory](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/UX_COPY.md).
20
+ Requests shows live app/source/model flow above existing summaries and finished records; a thin theme-colored ring rotates around its atom while requests are active. Usage offers animated bars or curves; reduced motion stays static. Hidden pages stop scheduled reads; status refreshes about every two seconds and source/settings evidence about every 16 seconds. Catalogs and retained usage load on demand or every 30 minutes while open. Disclosures use down/up chevrons with brief rotation and content transitions; reduced-motion mode remains immediate. Saved model selection and configuration-write results are shown separately; writing does not prove that the App has loaded the change. The UI does not add inference calls. Ready means local service availability, not verified model access. First output uses ms, speed token/s, and partial/unknown usage remains explicit. Images/predictions stay opt-in; their first setup uses CLI. 1.2.18 preserves Codex sign-in and unavailable model selections after saving bindings. See the [control reference](docs/REFERENCE.md#control-console-and-online-settings), [1.2.18 fixes and verification](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/RELEASE_1.2.18.md) and [copy inventory](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/UX_COPY.md).
21
21
 
22
22
  ## Commands
23
23
  | Command | Purpose |
@@ -54,9 +54,9 @@ Requests shows live app/source/model flow above existing summaries and finished
54
54
 
55
55
  Run `ccdx web` without GitHub sign-in. In **Model sources → Add API**, enter the HTTPS address/key, read the catalog, select models and declare their real interfaces. Then open **Codex** or **Claude**, choose visible models across sources, set a default and save. Claude App/Code use Messages; Codex uses Responses, all on port 2026. GitHub-only Codex selections retain native OpenAI mode and readable model names. Token counting is separate from message generation. For manual APIs, an observed count-endpoint 404 is remembered for one minute per model/API-header scope; CCDX returns a clear 404 without inventing a token count. Unknown count capabilities share their first admitted request; a 404 prevents distinct waiting inputs from fanning out. A supported endpoint still counts each distinct input separately. Identical small count requests share bounded work. A request stays on its selected deployment; there is no automatic cross-source retry or model replacement. Reopen clients after configuration changes. Claude App can continue an existing conversation on a different selected, authorized source when complete Messages history is available; unfinished tool turns, unavailable attachments and company-account isolation still apply. Codex and Claude Code retain their existing history rules. Stop management before normal `ccdx` startup for the live terminal.
56
56
 
57
- Keys use system credential protection or an explicit environment reference; clients receive separate local credentials. Saving reads model metadata automatically, without inference. Startup and the existing model refresh cycle also refresh enabled APIs when the 30-minute cache expires; failed reads retain saved configuration. Selecting no models pauses access; enable a source and select models to resume. Closed sources can be restored on Model sources; closed apps remain reachable for restoration on their app pages. Pinned streams finish on their original source. The version-two graph preserves old single-source visibility and saves a byte-for-byte v1 backup before migration. User and managed client settings remain protected.
57
+ Keys use system credential protection or an explicit environment reference; clients receive separate local credentials. Saving reads model metadata automatically, without inference. Startup and the existing model refresh cycle also refresh enabled APIs when the 30-minute cache expires; failed reads retain saved configuration. Selecting no models pauses access; enable a source and select models to resume. Closed sources can be restored on Model sources; closed apps remain reachable for restoration on their app pages. Pinned streams finish on their original source. The version-two graph preserves old single-source visibility and saves a byte-for-byte v1 backup before migration. User and managed client settings remain protected. Refreshing GitHub models also updates Codex candidates without changing saved selections or native sign-in.
58
58
 
59
- Model lists/details preserve the upstream maker declaration separately from your API source name. Missing maker metadata shows Not provided; model names are never used to guess a maker. Maker evidence is rebuildable display cache and does not change the strict connection schema or routing identity. Model details show upstream capabilities per API, with optional manual overrides collapsed below. Context, input/output limits, reasoning levels, thinking modes, input types, tools and native search are deployment-specific. Structured Anthropic declarations are mapped to Messages; they do not grant the same capabilities to a gateway's other interfaces. Missing and unrecognized metadata are distinguished, without guessing from model names. Manual overrides, including false, take priority. Claude synchronization projects compatible routes, supported host controls and per-model budgets. Unknown or out-of-range windows and unverified client versions are reported as limited; they are not promoted to 1M. Output requests are bounded by declared limits. Compatibility routes do not prove that every model supports every App tool, search or reasoning mode. See the [capability and synchronization limits](docs/REFERENCE.md#model-capabilities-and-claude-synchronization). [1.2.29 changes and verification](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/RELEASE_1.2.29.md) cover copyable GitHub verification codes, explicit M365 app grants, protocol-equivalent history continuation and traceable network/cache model reads. Existing native Codex sign-in/model protections and the 1.2.27 context-preference fix remain included.
59
+ Model lists/details preserve the upstream maker declaration separately from your API source name. Missing maker metadata shows Not provided; model names are never used to guess a maker. Maker and display-name evidence use a rebuildable cache and do not change the strict connection schema or routing identity. Names follow upstream display name, upstream name, then model ID. Claude compatibility aliases remain internal; mixed sources retain their original visible names regardless of the default source. Closing a source previews all selected consumers, including nondefault models. First-time API setup uses **Save & read models** and keeps the model editor open, including after a failed lookup. Model details show upstream capabilities per API, with optional manual overrides collapsed below. Context, input/output limits, reasoning levels, thinking modes, input types, tools and native search are deployment-specific. Structured Anthropic declarations are mapped to Messages; they do not grant the same capabilities to a gateway's other interfaces. Missing and unrecognized metadata are distinguished, without guessing from model names. Manual overrides, including false, take priority. Claude synchronization projects compatible routes, supported host controls and per-model budgets. Unknown or out-of-range windows and unverified client versions are reported as limited; they are not promoted to 1M. Output requests are bounded by declared limits. Compatibility routes do not prove that every model supports every App tool, search or reasoning mode. See the [capability and synchronization limits](docs/REFERENCE.md#model-capabilities-and-claude-synchronization). [1.2.31 changes and verification](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/RELEASE_1.2.31.md) cover model display, source impact, error evidence and scoped WebUI improvements. Shared GitHub catalogs and the policy-preserving complete-package update fallback remain included. Existing native Codex sign-in/model protections and the 1.2.27 context-preference fix remain included.
60
60
 
61
61
  ## Microsoft 365 access
62
62
 
@@ -111,7 +111,7 @@ See the [M365 reference](docs/REFERENCE.md#microsoft-365-provider) for ownership
111
111
 
112
112
  Open `ccdx web` for source-specific account tools and Checks & repairs without signing in first. It starts a management-only service when needed; stop it before normal app startup. Safe reauth, config preview/backup, local reports, feature pause/resume and matching circle SVG status icons are described in the [account tools reference](docs/REFERENCE.md#account-and-repair-tools). Existing themes, layout and bilingual support are preserved. Startup checks GitHub's latest-release web redirect, not npm or the anonymous REST quota, and suggests `ccdx update github`. Settings → Version & updates shows the running version, release dates and newer releases, with copyable update and macOS/Windows recovery commands. This separate, cached GitHub metadata check never installs; failed checks remain unknown. The separate **Update overnight** switch defaults off and requires a normal CCDX restart after enabling. Its foreground supervisor checks during 00:00–04:00 local time after ten observed idle minutes, selects same-series stable patches at least 24 hours old, stages verified packages and attempts rollback on failure. Ctrl+C stops it; no OS service is installed. Review the displayed risk and [handoff limits](docs/REFERENCE.md#nightly-updates-opt-in) before enabling. See the [reference](docs/REFERENCE.md#version-and-update-information).
113
113
  Settings → **Save & restore**, immediately after Version & updates, defaults to automatic saving of this page’s preferences. Turn it off to save or discard drafts manually. Restore defaults backs up the saved preferences first and offers Restore backup; it preserves accounts, keys, model/source selections, native sign-in, client connections, image/prediction access, chats and usage. Browser appearance stays browser-local; failed or conflicting saves retain the draft and show the actual result. See the [scope and recovery rules](docs/REFERENCE.md#settings-saving-and-restore).
114
- GitHub updates verify and install the exact Release tarball without Git; dependencies still use npm's configured registry. Lookup errors identify HTTP refusal, timeout, network failure or invalid redirects. For npm `EALLOWREMOTE`, only if policy permits and the update is trusted, use `ccdx update github --allow-remote`: explicit URL-download permission for that installation's whole dependency tree, not a hostname allowlist. Persistent npm settings stay unchanged.
114
+ GitHub updates verify the exact Release without Git. Source packages use the configured npm registry; a confirmed EALLOWREMOTE restores the old package and permits one same-version complete platform package attempt offline. Nightly preparation shares this fallback. A blocked old updater can use the current verified bootstrap once. Lookup errors identify HTTP refusal, timeout, network failure or invalid redirects. For npm `EALLOWREMOTE`, only if policy permits and the update is trusted, use `ccdx update github --allow-remote`: explicit URL-download permission for that installation's whole dependency tree, not a hostname allowlist. Persistent npm settings stay unchanged.
115
115
  Updates back up the discovered CCDX package and commands, restore them on install/runtime-check failure, and verify the installed version (exact for GitHub). Mismatched npm targets warn without changing PATH/prefix. Manual updates require a separate adapter restart. Full `ccdx doctor` reports this target and readonly credential permissions; it never changes ACLs.
116
116
  Recent errors separate HTTP and model failures. By default HTTP metadata retains status, source and IDs, not error bodies or prompts; original errors still reach Codex unchanged. Explicit, bounded error-excerpt collection is described in the [reference](docs/REFERENCE.md#http-error-diagnostics).
117
117
 
package/bin/cli.mjs CHANGED
@@ -485,6 +485,7 @@ try {
485
485
  log: (kind, message) => console.log(startupComplete ? status(kind, message) : startupCheck(kind, "Models", message)),
486
486
  });
487
487
  providerRuntime = createProviderRuntime({ githubClient: profileRuntime.codexClient, githubRegistry: profileModels.codexRegistry,
488
+ refreshGithubCatalog: () => profileModels.refreshCodex({ strict: true }),
488
489
  corePort: ADAPTER_PORT, preserveClientConfiguration: () => serviceWorker?.preserving === true || serviceWorker?.draining === true,
489
490
  clientAccessChanged: async enabled => { earlyIntegration.setPredictionActive(enabled && servicePreferences().prediction_enabled);if (enabled) await earlyIntegration.configure(); },
490
491
  githubCredentialFingerprint: () => profileRuntime.codexCredentialFingerprint,
@@ -278,11 +278,26 @@ the installer, not an unrelated working project's `.npmrc`. It queries version,
278
278
  Default installer argv preserves the saved download policy. The boolean
279
279
  `--allow-remote` opt-in adds one fixed permission argument only when supported;
280
280
  it applies to that installation's entire dependency tree, not selected hosts.
281
- Unknown support fails before an explicitly requested override. Installation
282
- streams remain inherited; conditional failure guidance is not an assertion that
283
- every nonzero exit is a policy error. There is no automatic retry or policy write.
281
+ Unknown support fails before an explicitly requested override. npm stderr is
282
+ forwarded unchanged while a bounded scanner recognizes only EALLOWREMOTE.
283
+ A confirmed GitHub dependency-policy refusal rolls back the first installation,
284
+ then permits one same-version complete platform package attempt offline. Other
285
+ failures do not trigger a retry. There is no npm policy write or public-registry
286
+ fallback. Explicit npm-source updates retain their original source.
284
287
  The source lock retains exact versions/integrities without binding smol-toml to a
285
288
  developer's corporate feed; omitted registry resolution is delegated to npm.
289
+
290
+ `release-install.mjs` owns complete-asset names, platform selection and bounded
291
+ SHA-256/version/target/bundled-root validation. Manual GitHub updates and nightly
292
+ candidate preparation reuse this contract. Complete installs disable network
293
+ dependency resolution and scripts; existing installation protection and native
294
+ runtime verification remain required. Bootstrap prefers a manifest-listed complete
295
+ asset and retains the old path for source-only releases. `runtime-package.mjs`
296
+ builds each complete package from the exact standard source tarball plus its
297
+ locked runtime dependencies, pruning only unrelated Broker OS/architecture files.
298
+ The npm artifact remains unchanged in form. Native target CI installs complete
299
+ packages using empty caches and strict npm12 offline policy. No runtime component
300
+ cache, new loader, inference route or background process is introduced.
286
301
  Readonly update preflight reports Node/npm, the running package and npm's selected
287
302
  global target. A different target warns, but never changes PATH or prefix. Its
288
303
  bounded npm probe is limited to explicit update/full doctor commands and opted-in supervisor startup, never inference.
@@ -731,6 +746,8 @@ No new polling, framework, runtime dependency, setting or endpoint is introduced
731
746
 
732
747
  ## Catalog transactions and default identity (1.2.20)
733
748
 
749
+ GitHub dashboard catalog reads use the existing `profile-model-runtime.mjs` single-flight through an injected refresh callback, rather than a second independent directory request. Successful publication updates the shared provider registry/endpoint cache, and the dashboard rereads connection candidates while preserving drafts. Explicit reads report refresh failures instead of presenting the last-good fallback as fresh success. Credential changes during a read reject publication; catalog browsing never synchronizes client files or changes selected deployments, defaults, grants or native authentication.
750
+
734
751
  `api-catalog-refresh.mjs` owns bounded catalog I/O, same-source single-flight,
735
752
  existing success/failure cooldowns, cancellation and deployment-version checks.
736
753
  It receives source/config/commit callbacks; it does not write configuration or
@@ -904,3 +921,14 @@ capability absence and protocol discovery remain distinct. Dashed flow motion
904
921
  uses CSS stroke offset on retained paths; model nodes share the same left edge.
905
922
  Geometry and SVG identity reuse from 1.2.23 remain in place, with hidden/stale/
906
923
  reduced-motion behavior and summary tables preserved.
924
+
925
+
926
+ ## Model presentation and shared source impact (1.2.31)
927
+
928
+ `model-display.mjs` is a pure presentation fallback. `api-model-display.mjs` retains bounded upstream names beside maker declarations in the existing revision-bound, rebuildable cache. `providers/api.mjs` exposes that evidence to `client-model-plan.mjs`, which disambiguates presentation independently of route identity. Claude uses labelOverride for client aliases regardless of the default source. No connection-schema or routing-ID migration is introduced. Existing client-file ordering and manual ownership remain authoritative.
929
+
930
+ The connection snapshot's read-only source_impacts reports actual selected consumers, removed/remaining selection counts, and default-replacement needs. Both source-close validation and the WebUI use that result; the default source alone never represents every selected deployment. An optional impact_revision protects new WebUI confirmations while preserving existing programmatic command compatibility. Settings writes remain serialized and revision checked. Source identity changes also invalidate confirmation.
931
+
932
+ Unknown client capability adapters preserve existing shared settings and report their limitation. The presentation schema and protocol capability evidence do not share an enable gate. HTTP-200 error envelopes and native SSE errors feed the existing bounded diagnostics as model.error; transport bytes and retry policies remain unchanged.
933
+
934
+ `dashboard/disclosure.js` is optional progressive enhancement of native details/summary. It uses cancellable opacity/transform animations, CSS chevrons independent of translated DOM text, and no polling/height animation. Reduced motion and hidden documents finish immediately. A resource integration test covers every script/style referenced by the shell. Flow regression measures layout reads and DOM identity under elapsed-only updates; existing geometry caches, list limits and visibility gates remain the performance mechanism.
package/docs/REFERENCE.md CHANGED
@@ -7,8 +7,11 @@ Claude gateway and an explicitly selected Codex backup.
7
7
  ## Manual APIs and client access
8
8
 
9
9
  `ccdx web` starts management without GitHub sign-in or automatic App launch.
10
- Use **Model sources → Add API**, save the HTTPS API base address/key
11
- (including a required prefix such as `/v1`), then reopen **Manage → Read models**.
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.
12
15
  Select the models to use and their supported interfaces, save, then choose each
13
16
  client's visible models and default on **Codex** or **Claude**. Unselected catalog entries
14
17
  are not saved. A selected model needs at least one interface; choosing an
@@ -149,6 +152,8 @@ Temporarily unavailable selected models remain visible in the application editor
149
152
  Saving them fails without changing prior settings; refresh the catalog or explicitly
150
153
  clear the affected selection. A missing directory entry never means deselection.
151
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
+
152
157
  A manual Codex provider includes an authenticated `model_catalog_url` on the same
153
158
  listener. Native app-server catalogs list configured names; the App may still use
154
159
  its custom-provider UI for non-GitHub selections. Unknown names
@@ -1183,7 +1188,7 @@ Opening Settings reads `GET /_ccdx/ui/updates`, protected by the existing loopba
1183
1188
 
1184
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.
1185
1190
 
1186
- 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. Dependencies still require the configured npm registry.
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.
1187
1192
 
1188
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.
1189
1194
 
@@ -1279,7 +1284,7 @@ channel or automatically grants remote-download permission. Each asset has a
1279
1284
  60-second download deadline and bounded size (64 KiB manifest, 16 MiB package,
1280
1285
  64 MiB decompressed metadata scan). The checksum comes from the same HTTPS
1281
1286
  release; it detects corrupt/mismatched files and is not a separate signature.
1282
- Dependencies still use npm's configured registry, including a company mirror.
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.
1283
1288
  This is not a fully offline or registry-free distribution.
1284
1289
 
1285
1290
  Windows runs `npm.cmd` through system `cmd.exe` with AutoRun and delayed expansion
@@ -1320,8 +1325,17 @@ installs `codex-copilot-dx@latest`; it never silently switches to GitHub.
1320
1325
  npm policy is read using bounded named global fields, without printing credentials.
1321
1326
  An unrelated project's `.npmrc` cannot grant permission. npm 12's
1322
1327
  `allow-remote=none` can reject a mirror's cross-origin dependency URL with
1323
- `EALLOWREMOTE`. Only if company policy permits and you trust this entire package
1324
- tree, use the explicit one-install exception:
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:
1325
1339
 
1326
1340
  ```sh
1327
1341
  ccdx update github --allow-remote
@@ -1329,14 +1343,14 @@ ccdx update npm --allow-remote
1329
1343
  ```
1330
1344
 
1331
1345
  This grants URL downloads throughout that installation's dependency tree, not a
1332
- hostname allowlist. It does not change `.npmrc`, add a retry, allow every script
1346
+ hostname allowlist. It does not change `.npmrc`, add further retries, allow every script
1333
1347
  or override other administrator policy. Older npm receives no unsupported flag.
1334
1348
  Unknown support prevents an explicitly requested exception from starting.
1335
1349
 
1336
1350
  For an older updater that still requires Git, install the Release tarball directly:
1337
1351
 
1338
1352
  ```sh
1339
- npm install -g https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.29/codex-copilot-dx-1.2.29.tgz
1353
+ npm install -g https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.31/codex-copilot-dx-1.2.31.tgz
1340
1354
  # Windows PowerShell: use npm.cmd instead of npm.
1341
1355
  ```
1342
1356
 
@@ -1397,6 +1411,17 @@ choose a writable prefix without `%` using `npm_config_prefix`. Unicode, spaces,
1397
1411
  an additional native executable just to bypass the shell's path parsing.
1398
1412
  No install hook is added to the npm package.
1399
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
+
1400
1425
  The scripts accept only `sh install.sh [--allow-remote]` or
1401
1426
  `./install.ps1 [-AllowRemote]`; the permission is explicit and applies to that
1402
1427
  one installation, with the same whole-tree meaning described above. Do not use
@@ -2257,7 +2282,7 @@ intermediate proxy honored revalidation.
2257
2282
 
2258
2283
  ### Upstream maker metadata
2259
2284
 
2260
- Manual API discovery accepts bounded text from publisher, vendor and owned_by.
2285
+ Manual API discovery accepts bounded text from publisher, vendor, owned_by, display_name and name.
2261
2286
  The model maker shown in lists/details prefers publisher, then vendor; owned_by
2262
2287
  is shown separately as ownership and is not treated as the maker. Absent maker
2263
2288
  information is Not provided; no name-based inference is performed. These are
@@ -2318,3 +2343,22 @@ remain distinct.
2318
2343
  API transport errors retain fixed safe code, DNS/connect/TLS/request/response
2319
2344
  phase and reused-socket state in HTTP diagnostics. They do not retain raw
2320
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-copilot-dx",
3
- "version": "1.2.29",
3
+ "version": "1.2.31",
4
4
  "description": "Local gateway for Codex and Claude with Copilot, Microsoft 365 and custom APIs",
5
5
  "author": "Dale Xiao",
6
6
  "type": "module",
@@ -51,6 +51,7 @@
51
51
  "verify": "npm test && npm run test:smoke && npm run bench:check && npm run pack:check",
52
52
  "prepublishOnly": "npm run verify",
53
53
  "release:pack": "node scripts/release-artifacts.mjs",
54
+ "release:runtime": "node scripts/runtime-package.mjs",
54
55
  "test:release-network": "node scripts/release-network-replay.mjs"
55
56
  },
56
57
  "dependencies": {
package/src/adapter.mjs CHANGED
@@ -419,7 +419,7 @@ export function createAdapterHandler(options = {}) {
419
419
  const finishRequest = ({ statusCode = 0, aborted = false } = {}) => {
420
420
  if (requestFinished) return;
421
421
  requestFinished = true;
422
- if (trackRequest && statusCode >= 400) {
422
+ if (trackRequest && (statusCode >= 400 || httpEvidence.model_error === true)) {
423
423
  try { httpErrors.record(buildHttpFailureDetails({ ...httpEvidence, statusCode, route: routeName, requestId, model: context?.model || context?.requestedModel,
424
424
  method: ["GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"].includes(req.method) ? req.method : "OTHER",
425
425
  target: ["/v1/responses", "/v1/responses/compact", "/anthropic/v1/messages", "/anthropic/v1/messages/count_tokens", "/anthropic/v1/models", "/mcp/image", "/.well-known/oauth-authorization-server", "/.well-known/oauth-protected-resource", "/.well-known/oauth-protected-resource/mcp/image"].includes(pathname) ? pathname : "unrecognized_path",
@@ -6,7 +6,7 @@ import { atomicWriteFileSync } from "./atomic-file.mjs";
6
6
  import { redactDiagnosticText } from "./diagnostic-text.mjs";
7
7
 
8
8
  export function apiModelDisplay(model) {
9
- return Object.fromEntries(["publisher", "vendor", "owned_by"].flatMap(key => {
9
+ return Object.fromEntries(["publisher", "vendor", "owned_by", "display_name", "name"].flatMap(key => {
10
10
  const value = model?.[key];
11
11
  return typeof value === "string" && value.trim() && value.length <= 160
12
12
  && !/[\u0000-\u001f\u007f\u202a-\u202e\u2066-\u2069]/.test(value) && redactDiagnosticText(value) === value ? [[key, value.trim()]] : [];
@@ -41,7 +41,9 @@ export function createApiModelDisplayStore(options = {}) {
41
41
  const value = { version: 1, revision, models: models.map(model => ({ id: model.id, ...apiModelDisplay(model.display) })) };
42
42
  const checked = validate(value, revision), text = JSON.stringify(value) + "\n";
43
43
  if (!checked || Buffer.byteLength(text) > 512 * 1024) throw Error("Invalid model display cache");
44
+ const changed = JSON.stringify([...(read(id, revision) || [])]) !== JSON.stringify([...checked]);
44
45
  fs.mkdirSync(directory, { recursive: true, mode: 0o700 });atomicWriteFileSync(file(id), text, { mode: 0o600 });cache.set(id, { revision, models: checked });while (cache.size > 16) cache.delete(cache.keys().next().value);
46
+ return changed;
45
47
  },
46
48
  };
47
49
  }
@@ -53,6 +53,7 @@ export function claudeSharedCapabilityPlan({ app = [], code = [], support = {} }
53
53
  }
54
54
 
55
55
  export function syncClaudeCapabilities(plan, options = {}) {
56
+ if (plan.limitations?.some(item => item.code === "client_version_unknown")) return { state: "partially_preserved", changed: false, preserved: 0, restart_required: false };
56
57
  const paths = claudeClientPaths(options), env = options.env || process.env;
57
58
  let current = {};try { current = JSON.parse(readBoundedFileSync(paths.code, { maxBytes: 1024 * 1024, encoding: "utf8" })); }
58
59
  catch (error) { if (error.code !== "ENOENT") throw error; }
@@ -178,13 +178,20 @@ export function createClaudeGatewayHandler({ provider, apiKey, desktopAliases =
178
178
  const raw = await readBoundedResponseText(upstream, { maxBytes: upstream.ok ? config.maxUpstreamResponsesResponseBytes : MAX_UPSTREAM_ERROR_BODY_BYTES,
179
179
  label: "Claude gateway response", signal: abort.signal });
180
180
  let value;try { value = JSON.parse(raw); } catch {}
181
+ const modelFailure = upstream.ok && (!value?.type || value.type === "error") && value?.error && typeof value.error === "object" && !Array.isArray(value.error)
182
+ && ["code", "type", "message"].some(key => typeof value.error[key] === "string" && value.error[key].trim())
183
+ && !["content", "output", "choices", "candidates"].some(key => Array.isArray(value[key]) && value[key].length);
184
+ if (modelFailure) {
185
+ const evidence = upstreamErrorEvidence(raw);
186
+ context.onHttpError?.({ ...evidence, code: evidence.code || evidence.error_type || "upstream_error", model_error: true, origin: "upstream_response", headers: upstream.headers });
187
+ }
181
188
  if (!upstream.ok) context.onHttpError?.({ ...upstreamErrorEvidence(raw),
182
189
  origin: context.countObservation?.cached ? "capability_cache" : "upstream_http", headers: upstream.headers });
183
190
  if (!countTokens && upstream.ok && value?.type === "message" && Array.isArray(value.content)) {
184
191
  if (value.content.some(hasMessageState)) conversation?.commit?.({ tool: value.content.some(block => block?.type === "tool_use") });
185
192
  model = value.model || model;responseId = value.id;usage = value.usage;stopReason = value.stop_reason;
186
193
  sawStop = typeof stopReason === "string";outcome = stopReason === "max_tokens" ? "incomplete" : sawStop ? "completed" : "failed";
187
- } else if (countTokens && upstream.ok) outcome = "completed";
194
+ } else if (countTokens && upstream.ok && !modelFailure) outcome = "completed";
188
195
  const outgoing = clientModel && !countTokens && upstream.ok && value?.type === "message" ? JSON.stringify({ ...value, model: clientModel }) : raw;
189
196
  if (!res.destroyed && !res.writableEnded) { res.writeHead(upstream.status, headers);res.end(outgoing); }
190
197
  } else {
@@ -192,7 +199,11 @@ export function createClaudeGatewayHandler({ provider, apiKey, desktopAliases =
192
199
  abort.setTimeout(config.streamIdleTimeoutMs, "stream_idle_timeout");
193
200
  res.writeHead(upstream.status, { ...headers, "Cache-Control": "no-cache" });
194
201
  const observer = createMessagesObserver(event => {
195
- if (event.type === "error") { failedEvent = true;outcome = "failed";return; }
202
+ if (event.type === "error") {
203
+ failedEvent = true;outcome = "failed";
204
+ const evidence = upstreamErrorEvidence(JSON.stringify(event));
205
+ context.onHttpError?.({ ...evidence, code: evidence.code || evidence.error_type || "upstream_error", model_error: true, origin: "upstream_event", headers: upstream.headers });return;
206
+ }
196
207
  if (sawStop || failedEvent) return;
197
208
  if (event.type === "content_block_start" && hasMessageState(event.content_block)
198
209
  || event.type === "content_block_delta" && (isMessagesOutputDelta(event.delta) || event.delta?.type === "signature_delta" && event.delta.signature)) conversation?.commit?.({ tool: event.content_block?.type === "tool_use" });
@@ -1,5 +1,6 @@
1
1
  import { modelReasoningEfforts } from "./provider-metadata.mjs";
2
2
  import { createHash } from "node:crypto";
3
+ import { modelDisplayName } from "./model-display.mjs";
3
4
 
4
5
  const EFFORTS = ["low", "medium", "high", "xhigh", "max"];
5
6
 
@@ -25,7 +26,7 @@ export function claudeModelEntries(models, { desktopAliases = false } = {}) {
25
26
  ids.add(name);
26
27
  const advertised = model.capability?.values.reasoning === false ? [] : model.capability?.values.reasoning_efforts || modelReasoningEfforts(model);
27
28
  const maxEffort = EFFORTS.filter(value => advertised?.includes(value)).at(-1);
28
- return { name, ...(model.display_name || desktopAliases && name !== claudeClientModelId(model.id) ? { labelOverride: model.display_name || model.id } : {}),
29
+ return { name, ...(model.display_name || name !== claudeClientModelId(model.id) ? { labelOverride: modelDisplayName(model) } : {}),
29
30
  ...(model.capability?.values.context_window >= 1000000 ? { supports1m: true } : {}), ...(maxEffort ? { maxEffort } : {}) };
30
31
  });
31
32
  }
@@ -423,7 +423,7 @@ function topicHelp(name, topic) {
423
423
  "suggestion": `The CCDX prediction panel has been retired. Run ${name} suggestion off to safely remove unchanged CCDX registrations. This cleanup does not change native predictions; see ${name} prediction --help for that separate opt-in feature.`,
424
424
  m365: `Usage:\n ${name} m365 [status|models|accounts|account|on|off|remove]\n ${name} m365 account [--id ID]\n ${name} m365 switch [github|m365] [--model ID] [--auto-review-model ID]\n\n- M365 is discovered silently at startup on supported managed environments.\n- accounts lists local company accounts without requesting tokens.\n- account chooses a company account; --id supports scripts. A running updated service is required.\n- Saved bindings stay selected. Otherwise an exact Windows sign-in match, then a single company account, is used.\n- Changing accounts applies to M365 in Codex and Claude; start a new conversation.\n- Claude uses /anthropic on the same local port.\n- Codex stays on GitHub unless you explicitly switch.\n- M365 switching requires a running compatible adapter and available GPT/Auto-review choices; it never substitutes unavailable models.\n- Select an available model in Codex after switching an existing thread.\n- Off restores only owned Claude settings and selects GitHub.\n- Remove also clears the CCDX M365 profile, retaining a disabled preference and historical usage.\n- System Microsoft sign-in, GitHub credentials, predictions and images are preserved.`,
425
425
  prediction: `Usage:\n ${name} prediction [status|on|off|fix|pause|resume]\n\n- Pause/resume only pauses adaptation; trust and route setup are kept.\n- Resume does not activate a feature that has not been set up.\n- Optional native next-message predictions; off by default. macOS and Windows.\n- Windows requires the registered official MSIX App, an initialized profile, Windows PowerShell and .NET Framework 4.7.2+; Git/OpenSSL is not required for prediction setup.\n- Quit Codex before on/off, then restart ccdx.\n- On adds private App-profile certificate trust and an App-only route for chatgpt.com and ab.chatgpt.com.\n- HTTPS on those hosts is decrypted locally; only prediction configuration is changed.\n- No client program files, OS trust, account permissions, MCP or Hooks are changed.\n- Static HTTP/HTTPS/SOCKS5 proxies and bypass rules are preserved.\n- Windows supports company PAC/WPAD; macOS dynamic PAC/WPAD remains unsupported.\n- Static IPv4/IPv6 CIDRs match URL IP literals without DNS.\n- The bridge port persists across restarts/updates; a busy saved port disables only predictions.\n- Launch/reuse checks the App's actual route; an older random or missing route may require one full App quit.\n- Official prediction configuration is preserved; the conversation's model is used.\n- App updates require another compatibility check.\n- Status distinguishes saved preference and observed config traffic from unverified candidate visibility.\n- Fix asks a compatible running CCDX adapter to repair the enabled bridge once on its saved port.\n- It never enables predictions, renews certificates or force-restarts Codex.\n- Healthy unchanged bridges are retained.\n- Fix rechecks system proxy settings.\n- Changed routes may need a normal App relaunch to reload cached PAC; failed rechecks preserve the previous bridge with a nonzero exit.\n- Process environment variables and Node trust are not hot-reloaded; changed trust inputs need a CCDX service restart.\n- Startup, status and doctor share sanitized environment diagnostics.\n- Missing App routes require a normal full quit and ccdx launch; partial repair exits 1.\n- An older adapter must first be upgraded and restarted once to gain this repair endpoint.`,
426
- update: `Usage:\n ${name} update [npm|github] [--allow-remote]\n\n- Updates the global package from the configured npm registry or the latest stable GitHub release.\n- With no source, an interactive terminal prompts for one.\n- Windows uses system cmd.exe to run npm.cmd without changing PowerShell policy; use the .cmd entrypoint if scripts are blocked.\n- GitHub verifies a Release tarball; Git is not required. Dependencies use the configured npm registry.\n- By default npm's remote-download policy is preserved.\n- If npm reports EALLOWREMOTE for a trusted mirror tarball, --allow-remote explicitly permits URL dependencies for this one installation's entire dependency tree; it is not a hostname allowlist.\n- No .npmrc, registry or persistent policy is changed, and failed installations are not retried automatically.\n- Use this only if company policy permits it.\n- Restart the running adapter after installation.`,
426
+ update: `Usage:\n ${name} update [npm|github] [--allow-remote]\n\n- Updates the global package from the configured npm registry or the latest stable GitHub release.\n- With no source, an interactive terminal prompts for one.\n- Windows uses system cmd.exe to run npm.cmd without changing PowerShell policy; use the .cmd entrypoint if scripts are blocked.\n- GitHub verifies a Release tarball; Git is not required. Dependencies use the configured npm registry.\n- By default npm's remote-download policy is preserved.\n- If npm reports EALLOWREMOTE for a trusted mirror tarball, --allow-remote explicitly permits URL dependencies for this one installation's entire dependency tree; it is not a hostname allowlist.\n- No .npmrc, registry or persistent policy is changed. GitHub updates retry once offline with a verified same-version platform package only after EALLOWREMOTE; other errors are not retried.\n- Use this only if company policy permits it.\n- Restart the running adapter after installation.`,
427
427
  version: `Usage:\n ${name} --version`,
428
428
  };
429
429
  return sections[topic];
package/src/cli-web.mjs CHANGED
@@ -19,6 +19,7 @@ export async function runWebCommand({ host = "127.0.0.1", port = 2026, env = pro
19
19
  let profile = createProfileRuntime({ home, codexClient: defaultCopilotClient });
20
20
  const models = createProfileModelRuntime({ home, env, codexClient: defaultCopilotClient, codexCredentialFingerprint: () => profile.codexCredentialFingerprint });
21
21
  const providers = createProviderRuntime({ home, env, corePort: port, githubClient: defaultCopilotClient,
22
+ refreshGithubCatalog: () => models.refreshCodex({ strict: true }),
22
23
  githubRegistry: models.codexRegistry, githubClientConfigured: false, githubCredentialFingerprint: () => profile.codexCredentialFingerprint });
23
24
  const serviceControl = createServiceControl({ home, env, providerRuntime: providers });
24
25
  const server = await startAdapter(port, host, { providerRuntime: providers, codexModelRegistry: models.codexRegistry,
@@ -1,6 +1,7 @@
1
1
  import { deploymentModelId, resolveModelCapabilities } from "./model-capabilities.mjs";
2
2
  import { claudeModelEntries } from "./claude-models.mjs";
3
3
  import { claudeDeploymentId, claudeRouteAliases } from "./clients/claude-models.mjs";
4
+ import { modelDisplayName } from "./model-display.mjs";
4
5
 
5
6
  const endpoints = { codex: ["/responses", "/v1/responses"], claude_app: ["/v1/messages"], claude_code: ["/v1/messages"] };
6
7
  export function sourceModels(source, client) {
@@ -15,23 +16,25 @@ export function compileClientModels({ client, binding, source, enabled, names =
15
16
  if (!binding.enabled) return { models: [], routes: new Map(), defaultModel: null, revision: "disabled" };
16
17
  const explicit = Array.isArray(binding.deployments), selected = explicit ? binding.deployments : binding.source
17
18
  ? sourceModels(source(binding.source), client).map(model => ({ source: binding.source, model: model.id })) : [];
18
- const models = [], routes = new Map(), raw = new Map(), catalogs = new Map(), available = [], counts = new Map();
19
+ const models = [], routes = new Map(), raw = new Map(), catalogs = new Map(), available = [], counts = new Map(), labels = new Map(), sourceLabels = new Map();
19
20
  for (const item of selected) {
20
21
  if (!binding.allowed.includes(item.source) || !enabled(item.source)) continue;
21
22
  const provider = source(item.source);
22
23
  if (!catalogs.has(provider)) catalogs.set(provider, new Map(sourceModels(provider, client).map(model => [model.id, model])));
23
24
  const model = catalogs.get(provider).get(item.model);
24
25
  if (!model || model.policy?.state && model.policy.state !== "enabled" || model.model_picker_enabled === false) continue;
25
- available.push({ item, provider, model, route: deploymentModelId(item.source, model.id) });counts.set(model.id, (counts.get(model.id) || 0) + 1);
26
+ const label = modelDisplayName(model), sourceName = names[item.source] || provider.name || ({ github: "GitHub Copilot", m365: "Microsoft 365" })[item.source] || item.source;
27
+ const key = JSON.stringify([label, sourceName]);
28
+ available.push({ item, provider, model, label, sourceName, key, route: deploymentModelId(item.source, model.id) });counts.set(model.id, (counts.get(model.id) || 0) + 1);
29
+ labels.set(label, (labels.get(label) || 0) + 1);sourceLabels.set(key, (sourceLabels.get(key) || 0) + 1);
26
30
  }
27
31
  const routeIds = new Set(available.map(entry => entry.route));
28
- for (const { item, provider, model, route } of available) {
32
+ for (const { item, provider, model, route, label, sourceName, key } of available) {
29
33
  const capability = model.capability || resolveModelCapabilities(model, { builtin: true });
30
- const sourceName = names[item.source] || provider.name || ({ github: "GitHub Copilot", m365: "Microsoft 365" })[item.source] || item.source;
31
34
  const ambiguous = counts.get(model.id) > 1;
32
- const entry = { ...model, capability, source_id: item.source, source_name: sourceName, route_id: route,
33
- ...(explicit ? { client_id: client === "codex" && !ambiguous && !routeIds.has(model.id) ? model.id : route,
34
- ...(ambiguous ? { display_name: `${model.display_name || model.name || model.id} · ${sourceName}` } : {}) } : {}) };
35
+ const display = sourceLabels.get(key) > 1 ? `${label} · ${sourceName} (${model.id})` : labels.get(label) > 1 ? `${label} · ${sourceName}` : label;
36
+ const entry = { ...model, display_name: display, capability, source_id: item.source, source_name: sourceName, route_id: route,
37
+ ...(explicit ? { client_id: client === "codex" && !ambiguous && !routeIds.has(model.id) ? model.id : route } : {}) };
35
38
  if (client === "claude_app" && explicit) entry.client_id = claudeDeploymentId(entry, route, { desktopEffortAliases });
36
39
  const publicId = explicit ? entry.client_id : client === "codex" ? model.id : claudeModelEntries([entry], { desktopAliases: client === "claude_app" && provider.id.startsWith("api_") })[0].name;
37
40
  entry.public_id = publicId;
@@ -1,5 +1,5 @@
1
1
  import fs from "node:fs";
2
- import { randomBytes } from "node:crypto";
2
+ import { randomBytes, createHash } from "node:crypto";
3
3
  import { accessSettingsPath, readAccessSettings, updateAccessSettings, checkedApi, checkedAccessSettings, accessError, CLIENT_IDS, CLIENT_NAMES } from "./access-settings.mjs";
4
4
  import { createApiSecretStore, checkedApiKey } from "./api-secrets.mjs";
5
5
  import { createApiCatalogRefresh } from "./api-catalog-refresh.mjs";
@@ -145,11 +145,25 @@ export function createConnectionRuntime({ legacy, home, env = process.env, platf
145
145
  ], clients: CLIENT_IDS.map(id => ({ id, name: CLIENT_NAMES[id], ...config.clients[id], setup: setup[id] || null,
146
146
  ...(id === "codex" ? { memory_model: memoryModel.snapshot() } : {}),
147
147
  observed_at: lastClients[id] || null, ...(compact ? {} : { model_plan: { default_model: plan(id).defaultModel, default_unavailable: plan(id).defaultUnavailable,
148
- models: plan(id).models.map(model => ({ source: model.source_id, id: model.id, public_id: model.public_id, route_id: model.route_id, capability: model.capability })),
148
+ models: plan(id).models.map(model => ({ source: model.source_id, id: model.id, display_name: model.display_name, public_id: model.public_id, route_id: model.route_id, capability: model.capability })),
149
149
  unavailable: (config.clients[id].deployments || []).filter(item => !plan(id).models.some(model => model.source_id === item.source && model.id === item.model))
150
150
  .map(item => ({ source: item.source, id: item.model, route_id: deploymentModelId(item.source, item.model) })),
151
151
  available: config.clients[id].allowed.filter(enabled).flatMap(source => sourceModels(getSource(source), id).map(model => ({ source, id: model.id,
152
- route_id: deploymentModelId(source, model.id), capability: model.capability || resolveModelCapabilities(model, { builtin: true }) }))), sync: sharedSync, support: capabilitySupport } }) })), managed, m365_state: state.m365.state });
152
+ display_name: model.display_name || model.name || model.id, route_id: deploymentModelId(source, model.id), capability: model.capability || resolveModelCapabilities(model, { builtin: true }) }))), sync: sharedSync, support: capabilitySupport } }) })),
153
+ ...(!compact ? { source_impacts: Object.fromEntries(["github", "m365", ...config.apis.map(api => api.id)].map(id => [id, sourceImpact(id)])) } : {}), managed, m365_state: state.m365.state });
154
+ }
155
+ function sourceImpact(source) {
156
+ const clients = CLIENT_IDS.flatMap(id => {
157
+ const c = binding(id);if (!c.enabled) return [];
158
+ const explicit = Array.isArray(c.deployments), removed = explicit ? c.deployments.filter(item => item.source === source) : [];
159
+ if (explicit ? !removed.length : c.source !== source) return [];
160
+ const remaining = explicit ? c.deployments.length - removed.length : 0;
161
+ const defaultSource = plan(id).routes.get(c.default_model)?.source || removed.find(item => deploymentModelId(source, item.model) === c.default_model)?.source || c.source;
162
+ const default_affected = defaultSource === source;
163
+ return [{ id, removed: explicit ? removed.length : sourceModels(getSource(source), id).length, remaining, default_affected, needs_replacement: default_affected || remaining === 0 }];
164
+ });
165
+ const api = settings.apis.find(item => item.id === source), profile = api ? deploymentRevision(api, env) : getSource(source)?.profileId();
166
+ return { clients, revision: createHash("sha256").update(JSON.stringify([source, enabled(source), profile, CLIENT_IDS.map(id => binding(id))])).digest("hex") };
153
167
  }
154
168
  async function syncClients(ids = CLIENT_IDS) {
155
169
  if (!ids.length) return;
@@ -228,18 +242,21 @@ export function createConnectionRuntime({ legacy, home, env = process.env, platf
228
242
  const next = editable(), current = next.apis.find(api => api.id === id);
229
243
  if (!current?.enabled || deploymentRevision(current, env) !== revision) throw accessError("ccdx_connections_conflict", 409);
230
244
  const byId = new Map(models.map(model => [model.id, model]));
231
- try { modelDisplay.set(id, revision, models); } catch { log("warn", "Model maker metadata could not be saved; routing is unchanged"); }
245
+ let displayChanged = false;
246
+ try { displayChanged = modelDisplay.set(id, revision, models); } catch { log("warn", "Model display metadata could not be saved; routing is unchanged"); }
232
247
  for (const model of current.models) if (byId.get(model.id)?.metadata) model.metadata = byId.get(model.id).metadata;
233
248
  current.checked_at = checkedAt;
234
- if (JSON.stringify(current) !== JSON.stringify(settings.apis.find(api => api.id === id))) {
235
- save(next);await syncClients(CLIENT_IDS.filter(client => binding(client).source === id || binding(client).deployments?.some(model => model.source === id)));
249
+ const changed = JSON.stringify(current) !== JSON.stringify(settings.apis.find(api => api.id === id));
250
+ if (changed) save(next);
251
+ if (changed || displayChanged) {
252
+ plans.clear();await syncClients(CLIENT_IDS.filter(client => binding(client).source === id || binding(client).deployments?.some(model => model.source === id)));
236
253
  }
237
254
  }
238
255
  function enqueue(work) { operations++;const job = serial.then(work).finally(() => { operations--; });serial = job.catch(() => {});return job; }
239
256
  const refreshApis = () => !closed && managed && !preserveClientConfiguration?.() ? catalogRefresh.refreshAll(settings.apis.filter(api => api.enabled).map(api => api.id)) : Promise.resolve();
240
257
  async function change(input) {
241
258
  if (closed) throw accessError("ccdx_connections_closed", 503);
242
- if (!validObject(input, ["operation", "id", "config", "key", "allowed", "source", "enabled", "replacements", "model", "auto_review_model", "auto_review_effort", "deployments", "default_model", "auto_sync"])) throw accessError("ccdx_connections_action_invalid");
259
+ if (!validObject(input, ["operation", "id", "config", "key", "allowed", "source", "enabled", "replacements", "impact_revision", "model", "auto_review_model", "auto_review_effort", "deployments", "default_model", "auto_sync"])) throw accessError("ccdx_connections_action_invalid");
243
260
  const next = editable();let freshRef, previousRef;
244
261
  if (input.operation === "source_access") {
245
262
  if (input.id !== "m365" || !Array.isArray(input.allowed) || new Set(input.allowed).size !== input.allowed.length || input.allowed.some(id => !CLIENT_IDS.includes(id))) throw accessError("ccdx_connections_action_invalid");
@@ -347,7 +364,9 @@ export function createConnectionRuntime({ legacy, home, env = process.env, platf
347
364
  if (input.id === "m365" && input.enabled && env.CCDX_M365 === "0") throw accessError("ccdx_provider_environment_disabled", 409);
348
365
  if (input.id === "m365" && !input.enabled && legacy.snapshot().m365.claude.requests?.active > 0) throw accessError("ccdx_source_busy", 409);
349
366
  if (!input.enabled) {
350
- const affected = CLIENT_IDS.filter(id => next.clients[id].source === input.id && next.clients[id].enabled);
367
+ const impact = sourceImpact(input.id);
368
+ if (input.impact_revision !== undefined && input.impact_revision !== impact.revision) throw accessError("ccdx_connections_conflict", 409);
369
+ const affected = impact.clients.filter(client => client.needs_replacement).map(client => client.id);
351
370
  if (affected.some(id => id !== "codex")) next.claude_private_keys = true;
352
371
  if (affected.length && !validObject(input.replacements, affected)) throw accessError("ccdx_source_in_use", 409);
353
372
  for (const id of affected) {