#2931

fix(web): admin Coming soon no longer lists retired and delisted hidden models

OpenDanielButler1wants to merge intofrom

https://entire.com/gh/phaseoteam/-/trails/164/changes/Phaseo/164

What changed

For admins, the models page Coming soon filter and the site search now list only unreleased draft models. Before, they listed every hidden model.

  • apps/web-api/src/routes/account/models.ts: GET /api/account/models/hidden accepts ?staged=true, which adds status = 'draft' to the query. Without the flag the response is unchanged.
  • apps/web/src/lib/query/stagedModels.ts: requests ?staged=true and also keeps only status === "draft" rows itself, so it is correct whichever app deploys first.
  • Tests cover both sides, plus a patch changeset for @phaseo/web and @phaseo/web-api.

Why

An admin reported that many models marked End of life appeared under the Coming soon toggle. fetchAdminStagedModels (from the staged-models change on 10-09) set gateway_status: "coming_soon" on every hidden = true model. Most hidden rows are not upcoming:

Hidden models in prod (10-29)Count
active / available (delisted, e.g. old dated snapshots)142
retired (shown as "End of life" cards)45
deprecated12
disabled (withheld / unknown / retired)11
active / unknown5
draft (really upcoming)7

These counts come from a read-only query on prod v2_models, grouped by status and catalogue_status.

How

The filter lives on the server, so admins no longer download ~210 rows they don't need. The client keeps a matching guard. The admin chat picker (fetchServerAdminChatModels, ?includeRoutes=true) still needs hidden non-draft internal models, so it does not send the flag and is unaffected.

Before and after

MetricBeforeAfterChange
Models under admin Coming soon (prod data, 10-29)2217−214
Retired "End of life" cards under Coming soon460−46
Rows returned to the staged overlay2217−97%

Method: the "before" figures are the prod counts of hidden = true models, which the old code tagged as coming soon. The "after" figures count hidden = true and status = 'draft'. I worked these out from the data; I didn't measure them in a browser.

Verification

  • node node_modules/jest/bin/jest.js --runTestsByPath src/lib/query/stagedModels.test.ts src/lib/query/models.test.ts (apps/web): 11 passed. The new case checks that retired, deprecated, delisted and withheld rows are excluded.
  • pnpm exec vitest run src/routes/account/models.test.ts (apps/web-api): 37 passed. A new case checks that staged=true sends status=eq.draft, and the existing case checks that no status filter is sent without the flag.
  • pnpm exec tsc --noEmit (apps/web-api): clean.
  • Not run: the full web typecheck and a visual check in the browser.

Model: Claude Opus 5.5 (effort unknown) · Harness: Claude Code in T3 Code

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Admins now see only unreleased draft models in “Coming soon.” Retired, deprecated, delisted, active, and disabled hidden models no longer appear there.

Activity

6
vercel[bot]1d ago

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated
phaseo ReadyPreviewOct 29, 2026 4:21pm UTC

chatgpt-codex-connector[bot]1d ago

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code Review✅ Completed 2026-10-29T16:17:36.342831Z6ae6c6ePR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

github-actions[bot]1d ago

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None
coderabbitai[bot]1d ago

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ed307aa7-1f40-4d43-b210-8b5b555d19b7
Commits

Reviewing files that changed from the base of the PR and between 7cf419141310a9d6876ab025b88f9c92a1efed21 and 6ae6c6e3849dbbff91d1ce0914c4ce7b34fcfd48.

Files selected for processing: 6
  • .changeset/admin-coming-soon-staged-only.md
  • apps/web-api/src/routes/account/models.test.ts
  • apps/web-api/src/routes/account/models.ts
  • apps/web/src/lib/query/models.test.ts
  • apps/web/src/lib/query/stagedModels.test.ts
  • apps/web/src/lib/query/stagedModels.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The hidden-model endpoint now supports filtering for drafts. The admin staged-model query requests that filter and returns only hidden draft models.

Changes: Admin staged model filtering

Layer / File(s)Summary
Add staged filtering to the hidden-model endpoint
apps/web-api/src/routes/account/models.ts, apps/web-api/src/routes/account/models.test.ts
The endpoint adds a status = "draft" filter when staged=true. Tests check the staged filter and confirm that the default request has no status filter.
Request and retain hidden draft models
apps/web/src/lib/query/stagedModels.ts, apps/web/src/lib/query/stagedModels.test.ts, apps/web/src/lib/query/models.test.ts, .changeset/admin-coming-soon-staged-only.md
The admin query requests staged=true and keeps only hidden draft models. Fixtures and tests cover model statuses. The changeset declares patch releases for @phaseo/web and @phaseo/web-api.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested labels: Impact: Low Risk

Merge Risk: Minimal · up to 6ae6c

The staged-model filtering change is mergeable with no established blocking risk.

Pre-merge checks: 5
Check nameStatusExplanation
Description CheckCheck skipped - CodeRabbit’s high-level summary is enabled.
Title checkThe title clearly and concisely describes the main change: preventing retired and delisted hidden models from appearing in the admin Coming soon list.
Docstring CoverageDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues checkCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkCheck skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 5 files. (1 skipped: 1 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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.