Skip to content

fix: repair three regressions from the #2463/#1478 landings - #2614

Merged
lidge-jun merged 1 commit into
devfrom
codex/dev-integration-repairs
Aug 25, 2026
Merged

lidge-jun merged 1 commit into
devfrom
codex/dev-integration-repairs

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

The full suite on dev HEAD reported 36 failures across four files. Each of the three PRs that caused them (#2610, #2613) was green on its own focused run — these only appear once the landings are combined, which is exactly what a full-suite gate is for.

1. DataCloneError in the provenance projection. projectConfigRebaseProvenance deep-cloned the whole config, and a provider entry may carry a value structuredClone refuses — a test fixture injects its own fetch, and a function is not cloneable. That took down every POST /api/providers/test case and both CLI parity suites. The projection only rewrites the top-level provenance key, so nothing below the top level ever needed copying: a shallow copy is both correct and what the function actually meant. The deep clone was doing work it never asked for.

2. The new alias route swallowed the API-key-pool rename. /api/providers/:name/alias matched /api/providers/keys/alias with name = "keys". Model routes dispatch before oauth-account-routes, so the alias handler found no provider named keys and returned 404 for every key-pool rename. Fixed with an explicit guard rather than by reordering dispatch, since that order is load-bearing for other routes and reordering to fix a pattern collision would trade one silent shadow for another.

3. ocx alias and its two endpoints were undocumented. Missing from the printUsage banner and from the GUI/CLI parity coverage map. Both sweeps exist to catch precisely this, and both did.

Verification

bun x tsc --noEmit                              exit 0
bun test ./tests/provider-api-keys.test.ts \
         ./tests/provider-connection-test.test.ts \
         ./tests/config-user-edits.test.ts \
         ./tests/config-rebase-provenance-writers.test.ts   69 pass / 0 fail
bun test ./tests/cli-headless-parity.test.ts \
         ./tests/cli-registry.test.ts                       45 pass / 0 fail
bun test ./tests/alias-management-api.test.ts + pool        5 pass / 0 fail

Each repair was verified against the specific failing assertion it addresses — the DataCloneError stack, the expect(rename.status).toBe(200) that received 404, and the two coverage sweeps' Expected [] / Received ["alias"] and ["/api/aliases", "/api/default-aliases"].

Checklist

  • Targets dev
  • No behavior change beyond restoring the pre-existing contracts
  • No credential, auth, workflow or release-automation surface touched

Found by the full suite on dev HEAD (36 failures across four files), not by any
of the three PRs' own focused runs - each was green in isolation.

1. rebase-provenance: structuredClone on the whole config threw DataCloneError
   whenever a provider carried a non-cloneable value. A test fixture injects its
   own fetch, and a function is not cloneable, which took down every provider
   probe and both CLI parity suites. Only the top-level provenance key is
   rewritten in that projection, so nothing below the top level needed copying
   at all - a shallow copy is both correct and what the function actually meant.

2. /api/providers/:name/alias swallowed /api/providers/keys/alias. Model routes
   dispatch before oauth-account routes, so the new alias route matched
   name='keys', found no such provider, and 404'd every API-key-pool rename.
   Guarded rather than reordered: the dispatch order is load-bearing elsewhere.

3. The alias command and its two endpoints were missing from the help banner and
   the GUI/CLI parity map. Both sweeps exist to catch exactly this, and both did.

Each repair verified against the failing test, and the full local set of affected
suites is green: provider-api-keys, provider-connection-test, config-user-edits,
config-rebase-provenance-writers, alias-management-api, cli-headless-parity,
cli-registry.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner August 25, 2026 20:05
@lidge-jun
lidge-jun merged commit 4adfd23 into dev Aug 25, 2026
@lidge-jun
lidge-jun deleted the codex/dev-integration-repairs branch August 25, 2026 20:05
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 25, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1690787231

ℹ️ About Codex in GitHub

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

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

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const modelAliasMatch = url.pathname.match(/^\/api\/providers\/([^/]+)\/model-aliases$/);
if (modelAliasMatch && req.method === "PUT") {
const name = decodeURIComponent(modelAliasMatch[1]!);
if (name === "keys") return null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow model aliases for a provider named keys

When a user has a custom provider named keys—which isValidProviderName and the provider creation route currently allow—this guard returns null for PUT /api/providers/keys/model-aliases. No later handler owns that path, so the management API returns 404 and both ocx alias set keys/<model> ... and ocx alias rm keys/<model> fail. Remove this second guard; only the singular /api/providers/keys/alias path collides with the key-pool rename endpoint.

AGENTS.md reference: src/AGENTS.md:L10-L10

Useful? React with 👍 / 👎.

tarunravi pushed a commit to tarunravi/opencodex that referenced this pull request Sep 14, 2026
…landings (lidge-jun#2614)

Found by the full suite on dev HEAD (36 failures across four files), not by any
of the three PRs' own focused runs - each was green in isolation.

1. rebase-provenance: structuredClone on the whole config threw DataCloneError
   whenever a provider carried a non-cloneable value. A test fixture injects its
   own fetch, and a function is not cloneable, which took down every provider
   probe and both CLI parity suites. Only the top-level provenance key is
   rewritten in that projection, so nothing below the top level needed copying
   at all - a shallow copy is both correct and what the function actually meant.

2. /api/providers/:name/alias swallowed /api/providers/keys/alias. Model routes
   dispatch before oauth-account routes, so the new alias route matched
   name='keys', found no such provider, and 404'd every API-key-pool rename.
   Guarded rather than reordered: the dispatch order is load-bearing elsewhere.

3. The alias command and its two endpoints were missing from the help banner and
   the GUI/CLI parity map. Both sweeps exist to catch exactly this, and both did.

Each repair verified against the failing test, and the full local set of affected
suites is green: provider-api-keys, provider-connection-test, config-user-edits,
config-rebase-provenance-writers, alias-management-api, cli-headless-parity,
cli-registry.
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
…landings (lidge-jun#2614)

Found by the full suite on dev HEAD (36 failures across four files), not by any
of the three PRs' own focused runs - each was green in isolation.

1. rebase-provenance: structuredClone on the whole config threw DataCloneError
   whenever a provider carried a non-cloneable value. A test fixture injects its
   own fetch, and a function is not cloneable, which took down every provider
   probe and both CLI parity suites. Only the top-level provenance key is
   rewritten in that projection, so nothing below the top level needed copying
   at all - a shallow copy is both correct and what the function actually meant.

2. /api/providers/:name/alias swallowed /api/providers/keys/alias. Model routes
   dispatch before oauth-account routes, so the new alias route matched
   name='keys', found no such provider, and 404'd every API-key-pool rename.
   Guarded rather than reordered: the dispatch order is load-bearing elsewhere.

3. The alias command and its two endpoints were missing from the help banner and
   the GUI/CLI parity map. Both sweeps exist to catch exactly this, and both did.

Each repair verified against the failing test, and the full local set of affected
suites is green: provider-api-keys, provider-connection-test, config-user-edits,
config-rebase-provenance-writers, alias-management-api, cli-headless-parity,
cli-registry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant