Skip to content

fix(models): hide unsupported API models#887

Open
Komzpa wants to merge 9 commits into
mainfrom
fix/model-visibility-supported-in-api
Open

fix(models): hide unsupported API models#887
Komzpa wants to merge 9 commits into
mainfrom
fix/model-visibility-supported-in-api

Conversation

@Komzpa

@Komzpa Komzpa commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Unifies the model catalog compatibility fixes into one PR:

  • hide models marked supported_in_api=false from /api/models, /v1/models, and /backend-api/codex/models
  • preserve API-key allowlist filtering without exposing unsupported models
  • add OpenAI-compatible object: "list" and data fields to /backend-api/codex/models
  • expose upstream speed-tier metadata on /v1/models when upstream provides it

This absorbs #889 and #880. The #880 commits keep @KakatkarAkshay's authorship and contributor credit.

Fixes #876.
Fixes #608.
Fixes #834.

Folded PRs

OpenSpec

  • Existing api-keys public model filtering requirement
  • openspec/changes/add-codex-models-data-alias/
  • openspec/changes/expose-v1-model-speed-tiers/

Changes

  • Centralize public model filtering in is_public_model(...).
  • Keep unsupported models hidden even when an API-key allowlist includes them.
  • Return /backend-api/codex/models in a shape compatible with clients expecting OpenAI-style list/data fields.
  • Preserve codex-faithful model visibility semantics while adding the compatibility alias.
  • Include additional_speed_tiers, service_tiers, and default_service_tier on /v1/models entries only when those fields are present upstream.
  • Add/update regression coverage for hidden Codex models, backend Codex model list shape, and speed-tier metadata.

Validation

uv run pytest tests/unit/test_model_registry.py tests/integration/test_v1_models.py tests/integration/test_api_keys_api.py -k 'model or public_model or supported_in_api or backend_codex_models or speed_tier or allowed_but_unsupported' -q
uv run ruff check app/core/openai/model_registry.py app/modules/proxy/api.py app/modules/proxy/schemas.py tests/unit/test_model_registry.py tests/integration/test_v1_models.py tests/integration/test_api_keys_api.py
uv run ty check app/core/openai/model_registry.py app/modules/proxy/api.py app/modules/proxy/schemas.py
uv run openspec validate add-codex-models-data-alias --strict
uv run openspec validate expose-v1-model-speed-tiers --strict
uv run openspec validate --specs model-catalog-compat
uv run pytest tests/integration/test_path_rewrite_alias.py tests/integration/test_v1_models.py::test_backend_codex_models_returns_format1 tests/integration/test_v1_models.py::test_backend_codex_models_data_keeps_only_list_visible_models tests/integration/test_v1_models.py::test_backend_codex_models_excludes_supported_in_api_false_models -q
uv run ruff check app/modules/proxy/api.py tests/integration/test_path_rewrite_alias.py tests/integration/test_v1_models.py
uv run ty check app/modules/proxy/api.py tests/integration/test_path_rewrite_alias.py

Local result: 51 focused pytest cases passed; the deterministic backend Codex
alias regression pack passed; ruff, ty, and OpenSpec passed.

@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: 919f5ee951

ℹ️ 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".

Comment thread app/core/openai/model_registry.py
@Soju06 Soju06 added 🤖 codex: needs work [@codex review] raised an issue and removed 🤖 codex: needs work [@codex review] raised an issue labels Jun 3, 2026
@Komzpa Komzpa removed the 🤖 codex: needs work [@codex review] raised an issue label Jun 3, 2026
@Komzpa

Komzpa commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@Soju06

Soju06 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ 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".

@Soju06 Soju06 added 🤖 codex: ok [@codex review] says no issues found. and removed 🤖 codex: ok [@codex review] says no issues found. labels Jun 3, 2026
@Komzpa Komzpa force-pushed the fix/model-visibility-supported-in-api branch from ecf52d6 to 9fddbb0 Compare June 4, 2026 17:57
@Soju06

Soju06 commented Jun 4, 2026

Copy link
Copy Markdown
Owner

@codex review

@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: 9fddbb0621

ℹ️ 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".

Comment thread app/modules/proxy/api.py Outdated
@Soju06 Soju06 added 🤖 codex: needs work [@codex review] raised an issue and removed 🤖 codex: needs work [@codex review] raised an issue labels Jun 4, 2026
@Soju06

Soju06 commented Jun 4, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ 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".

@Soju06 Soju06 added 🤖 codex: ok [@codex review] says no issues found. and removed 🤖 codex: ok [@codex review] says no issues found. labels Jun 4, 2026
Soju06 pushed a commit that referenced this pull request Jun 7, 2026
## Summary
- Wire the existing per-account probe backend endpoint (`POST /api/accounts/{accountId}/probe`) into the Accounts dashboard.
- Add the frontend schema/client method, mutation, and MSW handler coverage for force-probe.
- Add a Force probe button to the account detail action surface while preserving the newer routing policy, Trusted Access, limit warm-up, and upstream proxy controls from current `main`.
- Refresh account list, account trends, per-account trend detail, and dashboard queries after a successful force-probe.
- Keep Force probe disabled for paused, deactivated, and re-auth-required accounts that the backend rejects.

## Stack relationship
- Remains separate from #892 because this is a dashboard/account-control feature, while #892 is the Responses HTTP bridge admission/stream contract bundle.
- Remains separate from #887 because this does not touch model catalog visibility or public model metadata.
- Does not absorb or supersede another open PR.

Closes #677

## Validation
- `uv run openspec validate add-account-probe-endpoint --strict`
- `cd frontend && bun run test src/features/accounts/components/account-actions.test.tsx src/features/accounts/components/account-detail.test.tsx src/features/accounts/hooks/use-accounts.test.ts src/features/accounts/schemas.test.ts src/test/mocks/handler-coverage.test.ts`
- `cd frontend && bun run test src/features/accounts/components/accounts-page.test.tsx`
- `cd frontend && bun run test:coverage`
- `cd frontend && bun run typecheck`
- `cd frontend && bun run lint`

Current head: `6aec65730b15f4a934db0daf6c3ed5e14a4d8fb4`
GitHub CI: pending on current head after the test-fixture fix push.
@Komzpa Komzpa force-pushed the fix/model-visibility-supported-in-api branch from ff55b5b to 174d5bb Compare June 11, 2026 01:26
@Soju06

Soju06 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

@codex review

@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: 174d5bb9da

ℹ️ 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".

Comment thread app/core/openai/model_registry.py
@Soju06 Soju06 added 🤖 codex: needs work [@codex review] raised an issue and removed 🤖 codex: needs work [@codex review] raised an issue labels Jun 11, 2026
@Soju06

Soju06 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ 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".

@Soju06 Soju06 added 🤖 codex: ok [@codex review] says no issues found. and removed 🤖 codex: ok [@codex review] says no issues found. labels Jun 11, 2026
@Komzpa Komzpa force-pushed the fix/model-visibility-supported-in-api branch from 599d873 to 3b534e4 Compare June 11, 2026 06:09
@Soju06

Soju06 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ 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".

@Soju06 Soju06 added 🤖 codex: ok [@codex review] says no issues found. and removed 🤖 codex: ok [@codex review] says no issues found. labels Jun 11, 2026
@Komzpa Komzpa force-pushed the fix/model-visibility-supported-in-api branch from 3b534e4 to 52eb83c Compare June 15, 2026 02:57
@Soju06

Soju06 commented Jun 15, 2026

Copy link
Copy Markdown
Owner

@codex review

1 similar comment
@Komzpa

Komzpa commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 52eb83c353

ℹ️ 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".

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has had no activity for 7 days.

It will be closed in 23 more days unless there is new activity.

If this is still relevant, please:

  • Rebase or push an update if the branch drifted
  • Address pending review feedback if there is any
  • Leave a short comment confirming it is still being worked on

Thanks for the contribution 🙏

@github-actions github-actions Bot added the stale No response from reporter; scheduled for close label Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 codex: ok [@codex review] says no issues found. stale No response from reporter; scheduled for close

Projects

None yet

3 participants