Skip to content

docs: rename aliases to virtual models and regenerate API reference#427

Merged
SantiagoDePolonia merged 3 commits into
mainfrom
docs/virtual-models
Jun 25, 2026
Merged

docs: rename aliases to virtual models and regenerate API reference#427
SantiagoDePolonia merged 3 commits into
mainfrom
docs/virtual-models

Conversation

@SantiagoDePolonia

@SantiagoDePolonia SantiagoDePolonia commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What & why

Aliases and access overrides were unified into virtual models (ADR-0008, #423/#424). This brings the user-facing docs and the generated API reference in line with that change and moves the feature page to its new URL.

User-visible impact

  • The Aliases docs page is now Virtual Models at /features/virtual-models (redirect from /features/aliases added in docs.json, so existing links keep working). The screenshot moves with it.
  • The page explains the two kinds of virtual model: redirects (aliases, with a target) and access policies (no target — gate/disable a selector by user_path).
  • API reference now documents GET/PUT/DELETE /admin/virtual-models instead of the removed /admin/model-overrides.

Changes

  • Docs: rewrite the feature page; update related terminology in user-path, audio-api, anthropic-messages-api, responses-api, and azure.
  • API reference: regenerate docs/openapi.json + cmd/gomodel/docs/docs.go/admin/model-overrides/admin/virtual-models, modeloverrides.*virtualmodels.* schemas.
  • Unbreak swagger generation: make swagger was failing on main. Two pre-existing causes fixed:
    • internal/anthropicapi uses goccy/go-json, which swag can't special-case like the stdlib, so its json.RawMessage fields failed to resolve. Added swaggertype:"object" tags (matching the existing internal/core convention — swag-only, no runtime effect).
    • tools/openapi-postprocess.mjs still referenced the removed model-overrides admin schemas; pointed it at the new virtual-models schemas/endpoint.

Notes

  • No public API or runtime behavior change — docs + generated reference + a swag-only struct tag.
  • make swagger now succeeds and the regenerated artifacts are included.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Introduced virtual models for stable model routing and model access policies.
    • Added admin virtual-models API (GET/PUT/DELETE) to manage them.
  • Documentation

    • Updated advanced and feature docs, dashboard instructions, and navigation to use virtual models instead of aliases/model overrides.
    • Removed the legacy aliases feature page and updated redirect/docs links.
  • Bug Fixes

    • Refined OpenAPI/Swagger schemas, required-field validation rules, and admin response/error documentation (including DELETE behavior).
  • Tests

    • Updated end-to-end release scenarios and curl matrix to use the admin virtual-models API.

Aliases and access overrides were unified into "virtual models"
(ADR-0008, #423/#424). Bring the user-facing docs and the generated API
reference in line, and move the feature page to its new URL.

- Rewrite the feature page as Virtual Models (redirects/aliases plus
  access policies); move /features/aliases -> /features/virtual-models
  with a docs.json redirect and rename the screenshot alongside it.
- Update related terminology in user-path, audio, anthropic-messages,
  responses, and azure docs.
- Regenerate docs/openapi.json and cmd/gomodel/docs/docs.go:
  /admin/model-overrides -> /admin/virtual-models, and
  modeloverrides.* -> virtualmodels.* schemas.
- Unbreak swagger generation: add swaggertype tags to the goccy/go-json
  json.RawMessage fields in internal/anthropicapi (matching the
  internal/core convention) and point tools/openapi-postprocess.mjs at
  the new virtual-models admin schemas and endpoint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates generated OpenAPI artifacts, docs, tooling, and release E2E scenarios to replace admin model-overrides and alias wording with virtual-models. It also changes Anthropic Swagger metadata and OpenAPI post-processing rules for object-shaped fields and new request bounds.

Changes

Virtual model contract and docs

Layer / File(s) Summary
Swagger generation inputs
internal/anthropicapi/types.go, tools/openapi-postprocess.mjs
Anthropic json.RawMessage fields gain swaggertype:"object" tags, and OpenAPI post-processing now enforces required fields and array bounds for virtual-model and pricing override admin schemas.
Admin Swagger source
cmd/gomodel/docs/docs.go, internal/admin/handler_virtualmodels.go
The generated Swagger source removes /admin/model-overrides, adds /admin/virtual-models, and updates the admin request, response, schema, and handler annotation definitions to use virtualmodels.*.
Published OpenAPI snapshot
docs/openapi.json
The published OpenAPI document removes /admin/model-overrides, adds /admin/virtual-models, completes /admin/usage/user-paths, and mirrors the virtual-model schema replacements.
Docs site updates
docs/docs.json, docs/features/*, docs/advanced/*.mdx, docs/providers/azure.mdx
Documentation navigation, feature pages, and API overviews rename aliases and access overrides to virtual models and add the new virtual-model feature page.
Release E2E scenarios
tests/e2e/release-e2e-scenarios.md
The release E2E scenarios switch admin alias setup, listing, and cleanup requests to /admin/virtual-models and update redirect assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • ENTERPILOT/GoModel#423 — Also updates generated Swagger/OpenAPI docs for the virtual-model admin contract.

Poem

I hopped through docs where aliases used to be,
and virtual models waved back at me.
The API trails now twinkle bright,
with redirects bouncing left and right.
I nibble a carrot; all feels right.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: renaming aliases to virtual models and regenerating the API reference.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/virtual-models

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.

@mintlify

mintlify Bot commented Jun 25, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
gomodel 🟢 Ready View Preview Jun 25, 2026, 9:02 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Migrate the release e2e alias scenarios to the unified virtual-models
admin endpoint and its request/response shape (source instead of name,
provider-qualified target_model, redirect kind/targets assertions),
following the aliases -> virtual models change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

The generated API reference rename is largely consistent, with one response-code documentation gap around virtual-model store failures.

  • The docs and generated OpenAPI artifacts align with the virtual-model terminology and route rename.
  • The remaining issue is limited to documenting a reachable bad-gateway response for virtual-model write/delete failures, which can affect generated clients but does not indicate a runtime behavior change.

docs/openapi.json

T-Rex T-Rex Logs

What T-Rex did

  • Captured the baseline virtual models contract state, which shows no /admin/virtual-models but retains /admin/model-overrides and the modeloverrides schemas.
  • Captured the post-change virtual models contract state, which shows /admin/virtual-models with delete, get, and put, no /admin/model-overrides, and the virtualmodels schemas present; modeloverrides schemas are absent.
  • Attempted to run make swagger after the change, but the command failed with make: go: No such file or directory.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "test(e2e): use /admin/virtual-models in ..." | Re-trigger Greptile

Comment thread docs/openapi.json Outdated
Comment on lines +1959 to +1968
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/core.GatewayError"
}
}
}
},

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 Bad-Gateway Response Missing

When a virtual-model store write fails, the admin handler returns 502, but the new PUT /admin/virtual-models schema only documents 500 and 503. Clients generated from this reference can treat a reachable store-failure response as undocumented; the same 502 response should also be documented for the delete path.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tools/openapi-postprocess.mjs`:
- Around line 435-442: The schema fixes added in the OpenAPI postprocess step
are only affecting the OpenAPI artifact, so mirror the same required-field and
array-bound updates in the Swagger 2 generation path. Update the schema-building
logic that feeds cmd/gomodel/docs/docs.go, specifically the pieces behind
admin.upsertModelPricingOverrideRequest,
admin.deleteModelPricingOverrideRequest, admin.upsertVirtualModelRequest, and
core.ResponsesConversationRef, so selector, pricing, source, and id are marked
required there too and admin.upsertVirtualModelRequest.user_paths gets the same
maxItems cap. Use the same helpers or equivalent schema mutations in the Swagger
2 pipeline as in applyBudgetKeySchemaConstraints, ensureRequiredProperty, and
applyStringArrayPropertyBounds.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9ba6450f-2308-4c65-8d57-1c6762b96dd7

📥 Commits

Reviewing files that changed from the base of the PR and between b113cab and 81017e9.

⛔ Files ignored due to path filters (1)
  • docs/features/virtual-models.png is excluded by !**/*.png
📒 Files selected for processing (13)
  • cmd/gomodel/docs/docs.go
  • docs/advanced/anthropic-messages-api.mdx
  • docs/advanced/audio-api.mdx
  • docs/advanced/responses-api.mdx
  • docs/docs.json
  • docs/features/aliases.mdx
  • docs/features/user-path.mdx
  • docs/features/virtual-models.mdx
  • docs/openapi.json
  • docs/providers/azure.mdx
  • internal/anthropicapi/types.go
  • tests/e2e/release-e2e-scenarios.md
  • tools/openapi-postprocess.mjs
💤 Files with no reviewable changes (1)
  • docs/features/aliases.mdx

Comment thread tools/openapi-postprocess.mjs
…2 spec

Address PR review feedback:

- /admin/virtual-models PUT and DELETE return 502 (StatusBadGateway) on store
  write failures via virtualModelWriteError, but the annotations omitted it
  (PUT documented 500, which the handler never returns). Document 502 on both,
  matching the model-pricing-overrides handler.
- Mirror the virtual-models required-field and array bounds into
  swagger-postprocess.mjs so the embedded Swagger 2 spec (cmd/gomodel/docs/docs.go)
  matches the published OpenAPI: source required on upsert/delete, user_paths
  maxItems, and the /admin/virtual-models listing maxItems cap.

Regenerated docs/openapi.json and cmd/gomodel/docs/docs.go.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/admin/handler_virtualmodels.go`:
- Line 60: The Swagger annotation for UpsertVirtualModel is missing the
reachable 204 No Content success path, so update the OpenAPI comments on the
UpsertVirtualModel handler to document that response alongside the existing 200
success. Make sure the response annotations around findVirtualModelView and the
successful write path include the 204 outcome when the virtual model is created
or upserted but no content is returned.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c351f6d4-2ba8-4fad-8312-15bb30e0b6fb

📥 Commits

Reviewing files that changed from the base of the PR and between 81017e9 and 4ca9f4f.

📒 Files selected for processing (4)
  • cmd/gomodel/docs/docs.go
  • docs/openapi.json
  • internal/admin/handler_virtualmodels.go
  • tools/swagger-postprocess.mjs

// @Failure 400 {object} core.GatewayError
// @Failure 401 {object} core.GatewayError
// @Failure 500 {object} core.GatewayError
// @Failure 502 {object} core.GatewayError

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Document the 204 success path for UpsertVirtualModel.

This annotation block still only advertises a 200 success, but the handler returns 204 No Content on Lines 85-88 when findVirtualModelView misses after a successful write. That leaves the generated Swagger/OpenAPI contract incomplete for a reachable response path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/admin/handler_virtualmodels.go` at line 60, The Swagger annotation
for UpsertVirtualModel is missing the reachable 204 No Content success path, so
update the OpenAPI comments on the UpsertVirtualModel handler to document that
response alongside the existing 200 success. Make sure the response annotations
around findVirtualModelView and the successful write path include the 204
outcome when the virtual model is created or upserted but no content is
returned.

@SantiagoDePolonia SantiagoDePolonia merged commit 2662963 into main Jun 25, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants