Conversation
…dels Model autosync keeps a provider's `models` map fresh but never exposes those models as routable aliases, so newly discovered models don't appear in GET /v1/models and can't be routed by bare name — operators must hand-create an alias per model. Add an opt-in `model_autosync.createAliases` flag. When enabled, after autosync inserts newly discovered models into the provider's `models` map it also creates a passthrough alias (slug === model id) for each new model that has no existing alias. Existing aliases are never overwritten. - New `model_autosync_create_aliases` column (sqlite + postgres) - Scheduler creates missing passthrough aliases and fires the models-changed callback when aliases or models were added - OpenAPI ProviderConfig documents the flag; asset regenerated - Admin UI: "Auto-create model aliases" checkbox in the Advanced editor - Tests: scheduler create/skip-existing/off/callback + DB round-trip Also set an explicit `Connection: keep-alive` header on MCP SSE responses instead of relying on a runtime-implicit header, fixing a pre-existing mcp-routes SSE test that fails under Bun's inject harness. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
|
Why not simply using the direct/ prefix? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
model_autosynckeeps a provider'smodelsmap current, but those models are not routable: inference resolves the requestmodelagainst aliases only (Router.resolveCandidates/resolve→findAlias, which readsconfig.models), andGET /v1/modelsenumerates aliases only. So a newly-discovered provider model never appears in/v1/modelsand can't be called by bare name until an operator hand-creates an alias for it. Autosync fills half the gap (the providermodelsmap) but not the half clients actually use.Change
Add an opt-in
model_autosync.createAliasesflag (defaultfalse). When enabled, after autosync inserts newly-discovered models into the provider'smodelsmap, the scheduler also creates a passthrough alias (slug === model id) for each new model that has no existing alias:{ "priority": "api_match", "sticky_session": true, "target_groups": [ { "name": "<provider>", "selector": "random", "targets": [{ "provider": "<provider>", "model": "<id>", "enabled": true }] } ] }preferred_apiis intentionally omitted so the model family determines the default surface.Details
model_autosync_create_aliasescolumn (sqlite + postgres schema). Migrations not committed per repo workflow — CI regenerates on merge.ModelAutosyncScheduler.createMissingAliases()+ wiring inrunSyncNow().ProviderConfig.model_autosync.createAliasesdocumented; asset regenerated.Drive-by fix
Set an explicit
Connection: keep-aliveheader on MCP SSE responses instead of relying on a runtime-implicit header. This fixes a pre-existingmcp-routesSSE test (expect(response.headers.connection).toBe('keep-alive')) that fails under Bun'sinject/light-my-request harness, where the implicit header isn't synthesized. Needed to get a greenbun run testlocally.Test plan
bun run typecheck— all workspaces passbun run test— full backend suite green (incl. new scheduler + DB tests)/v1/modelsand routes an inference call to it end-to-end.🤖 Generated with Claude Code