Skip to content

fix(discovery): name the invalid model row and the static-list workaround - #7990

Merged
lidge-jun merged 3 commits into
devfrom
fix/discovery-invalid-row-diag-7910
Oct 30, 2026
Merged

lidge-jun merged 3 commits into
devfrom
fix/discovery-invalid-row-diag-7910

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

A gateway's /v1/models returned 29 rows whose first id was an empty string (#7910). Discovery rejects the whole list on any invalid row, which is an intended contract, but the operator only saw unexpected shape / malformed 2xx data, while a newly added provider's model selection stayed pending and its models stayed hidden.

Acceptance rules are unchanged. For generic OpenAI-style /models envelopes the discovery result now carries a safe diagnostic naming the failing row index and reason (for example row 0 has an empty id) without echoing row contents. The catalog warning and the management connection-test error append it and explain that a newly added API-key provider's selection can stay pending while discovery fails (login connections have no pending selection), pointing at a static models list with liveModels: false for gateways that publish invalid rows. structure/providers-and-adapters.md records the diagnostic.

Closes #7910

Verification

Bun 1.4.4; focused because the shared host is under load (AGENTS.md resource exception; breadth left to PR CI).

  • Red→green: with the three src/ changes reverted, bun test tests/providers/provider-model-discovery-contract.test.ts tests/oauth/anthropic2-discovery-ownership.test.ts → 4 fail (row index/reason missing from the discovery result, catalog warning and connection-test error); with them, pass.
  • bun test tests/providers/provider-model-discovery-contract.test.ts tests/oauth/anthropic2-discovery-ownership.test.ts tests/providers/provider-live-models.test.ts tests/providers/initial-model-selection.test.ts → 107 pass / 0 fail.
  • bun run typecheck (2,248 files, 0 errors), bun run structure:check, bun run privacy:scan pass. src/server/management/provider-routes.ts grows by one line to 1,992 (2,000 default).
  • NOT RUN locally: bun run test:changed and the full suite (host at critical load); PR CI covers them.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed (structure contract; no existing docs-site discovery troubleshooting page).
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults (diagnostic names only an index and a reason class, never row contents).

…ound

Invalid upstream model rows still reject the whole discovery response, but the
diagnostic now names the failing row index and reason without its contents.
The catalog warning and the connection-test error explain that a new
provider's selection stays pending and point at a static models list with
liveModels: false.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 30, 2026 11:41
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 27 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4fc8700 and a06dfac.

Files selected for processing: 7
  • src/codex/catalog/provider-models.ts
  • src/providers/model-discovery-diagnostic.ts
  • src/providers/model-discovery.ts
  • src/server/management/provider-routes.ts
  • structure/providers-and-adapters.md
  • tests/oauth/anthropic2-discovery-ownership.test.ts
  • tests/providers/provider-model-discovery-contract.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 30, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer integration into dev (MAINTAINERS.md maintainer-integration exception; not a self-approval or independent review). Closes #7910.

  • Exact head: a06dfacf6c428aa26a1ba0f2702b1720dfbc9f0f
  • Exact-head CI: Cross-platform CI run 41050161981 — gates, test changed, structure gate and the ci aggregate success; all 27 checks pass on this head. The first test changed attempt failed only in tests/clients/client-connect.test.ts (Desktop copy coherence … protected Desktop edits block destructive disconnect, a 5 s timeout in a file this PR does not touch; the same file passed 53/53 locally on this head), so the failed job was re-run once and passed.
  • Independent review: three fresh-reviewer rounds. Round 1 found the pending-selection hint wrong for login connections; round 2 found the structure doc overstated diagnostics (WorkBuddy has none) and the description still had old wording; all fixed; round 3 PASS.
  • Local (Bun 1.4.4, focused under the shared-host load exception): with the three src/ changes reverted the discovery-contract and Anthropic2 ownership tests fail 4; with them, 107 pass / 0 fail across four discovery files; typecheck, structure:check, privacy:scan pass.
  • Union check vs current origin/dev eea1454782: clean merge; src/server/management/provider-routes.ts 1,992 lines (2,000 default); one small new helper module; no union or count change.

@lidge-jun
lidge-jun merged commit 1eca7a3 into dev Oct 30, 2026
48 of 52 checks passed
@lidge-jun
lidge-jun deleted the fix/discovery-invalid-row-diag-7910 branch October 30, 2026 12:20
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