Repository navigation
feat(chat): run Chat on the model and effort picked in the menu (W4-03) - #2032
Merged
Merged
Conversation
# Conflicts: # server/src/lib/brand-access-policies.test.js # supabase/schema.sql # web/src/lib/chat/schema.test.ts # web/src/types/supabase.ts
… tone, never a price (W4-01) - The daily price sync keeps each model's supported parameters and context length (00462). - The API server answers GET /api/internal/chat/models with the offered models' multiplier labels, a tone (green under 1x, amber from 3x), whether the price moves by the hour, whether the catalog dropped a model, the count of chat models that can call tools and the last sync. CRON_SECRET only, not counted by the per-IP limiter. - The web offers Claude's three tested models (lib/chat/models.ts, Wave 4 decision 1 B) and answers GET /api/chat/models, with "Your key" on the own key's models; it still lists them when the API server doesn't answer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…4-02) - The model button opens the menu: Auto (Default, Haiku 5.5 reads, Sonnet 5.5 writes, 1x), the offered models with their multipliers (green under 1x, amber from 3x), "Prices from OpenRouter, updated today. 1x = Auto.", Effort (Normal, High, Max), the own-key row, the month's AI usage with its reset, and the plan. No dollar anywhere. - The pick goes with each message of the chat and is kept on its run; a chat opens on its latest run's pick, a new one on Auto. - The server checks it again as the run starts: an offered model only, and Auto at Normal in the free trial (Wave 4 decision 2 B). - Help: help/chat/models.md (approved: false). Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A Claude model picked in the menu reads and writes on an Anthropic key; Auto keeps Haiku reading and Sonnet writing. A model through OpenRouter (none offered yet) runs in one phase on OPENROUTER_API_KEY, and without it the run takes Auto. Another provider's own key keeps its model. - Effort is Claude's own setting (Normal: the model's default; High: one level up; Max: max), with 1.5x / 2x room to write, and the reads' budget as before. - The run's pick is checked again as it opens: the plan (Auto in the free trial), and once against the catalog: a dropped model runs Auto, with one "Ran on Auto" step. - An agent's saved model and effort run the same way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nu (W4-03) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…un, Opus 5.5 hidden for now (W4-01) Each model Chat may run is listed with `tested`; only tested ones are offered in the menu, asked of the price catalog, or accepted by the engine, and a chat or agent that picked one not tested runs Auto. At launch that is Haiku 5.5 and Sonnet 5.5; Opus 5.5 waits for its run of the test set (owner, 2026-11-02). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Opus 5.5 hidden until tested: a pick of a model not offered, kept from before, now runs Auto instead of being refused. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Opus 5.5 hidden until tested: a saved pick of it (an agent's, or a chat's) runs Auto, with no catalog check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…their own mounts (W4-01) Co-Authored-By: Claude Opus 5.5 <[email protected]>
8 of 13 tasks
…ature/chat-model-catalog Co-Authored-By: Claude Opus 5.5 <[email protected]>
…talog, keeping the branch's tree The squash's tree equals feature/chat-wave4-db's final head, merged just before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…at-model-menu Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # web/src/components/chat/composer/chat-composer.tsx # web/src/lib/chat/engine.ts
…engine-model Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk
previously approved these changes
Nov 3, 2026
8 of 13 tasks
8 of 13 tasks
…menu # Conflicts: # web/src/app/api/chat/models/route.test.ts # web/src/app/api/chat/models/route.ts # web/src/components/chat/composer/chat-composer.tsx # web/src/lib/chat/engine.ts # web/src/lib/chat/model-menu.test.ts # web/src/lib/chat/models.ts
# Conflicts: # web/src/lib/chat/agent-driver.ts # web/src/lib/chat/engine.test.ts # web/src/lib/chat/engine.ts
…-model # Conflicts: # web/src/lib/chat/engine.test.ts # web/src/lib/chat/engine.ts
This was referenced Nov 4, 2026
gkhngyk
pushed a commit
that referenced
this pull request
Nov 5, 2026
The Agent Center article had "Let an agent publish on its own" twice, from two pull requests. Merge them into one section that keeps both sections' facts: publishing new pages on Webflow, WordPress and Wix as well as CMS drafts, the two switches with Full auto, the Manager's read-only switch, At most a day (1 to 20, 5 by default), the reasons a page still waits for a click, and the reset after a change. Add that it needs Growth and up and only shows where the workspace has it. "On your own AI key" said every agent runs on the workspace's own key. Since agents run on their own model (#2032) and a picked model runs on its provider's key, then the OpenRouter key, then the AI limit (#2033), that holds for agents on Auto only: say so. Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9 Co-authored-by: Claude <[email protected]>
gkhngyk
pushed a commit
that referenced
this pull request
Nov 5, 2026
The Model step of the agent form (Agent Center > new or edit agent) said
"Runs on your {provider} key" from Auto's key alone. Since #2032 an agent
runs on its own model, and since #2033 a picked model runs on the key for
its provider, then the workspace's OpenRouter key, then Ansvisor's key on
the monthly AI limit. So an agent on Fast or Best writing in a workspace
whose own key is OpenAI ran on the AI limit while the form said OpenAI.
The line and Max per run's note now follow the model the form has chosen,
as the engine picks its key:
- Auto: the key Auto runs on, else the monthly AI limit;
- a picked model: the own key for its provider, else the OpenRouter key,
else the monthly AI limit;
- the free trial, and a model no longer offered, run Auto: Auto's key.
The order lives in one place: pickedModelKeyOrder and pickedModelOwnKey
(lib/chat/models.ts, safe in the browser). resolvePickedModelKey loops
over pickedModelKeyOrder, the model menu's "Your key" uses
pickedModelOwnKey, and the form's modelKeyProvider uses it with
runChoiceOf. The form's setup carries the providers of the own keys for
Chat (ownChatKeyProviders, no key decrypted) and whether the plan runs a
picked model (modelChoiceOpen).
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
Co-authored-by: Claude <[email protected]>
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.
Summary
Chat's engine runs on the model and effort picked in the model menu (CHAT-16 items 5, 12 and 23; Wave 4 plan W4-03). Until now it always picked Auto's models (
agent-driver.tssaid so).engine-model.ts):OPENROUTER_API_KEY. None is offered at launch (decision 1 B); without the key the run takes Auto, and the menu leaves such models out.effortsetting.high, orxhighon Sonnet.max.readBudget).reasoningEffort.runModelChoice):runChoiceOf);selected). A dropped model runs Auto, and the run says so in one step: "Ran on Auto · The model this chat used is no longer available". If the check can't be read, the model is kept.chat_runsbyagent-driver.ts) now run the same way, under the same plan check.engine.tsgets only the thin connection:runModelChoice, the one step, and the choice passed toresolveChatModels.Stacked on #2031. Merges together with W4-01 and W4-02.
Related issue
None. Chat Wave 4 plan, W4-03.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd web && yarn vitest run src/lib/chat/engine-model.test.ts src/lib/chat/engine.test.ts -t "model".Opus 5.5 is hidden (
tested: false, W4-01) until a real run of Chat's test set passes (W4-35); an agent or chat saved on it runs Auto, with no catalog check.No migration. Optional new web environment variable:
OPENROUTER_API_KEY. No offered model uses it at launch.Checklist
yarn lintpassesyarn typecheckpassesyarn format:checkpasseshelp/(or no user-visible change)CI passed on this branch (1d3a2cc), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41525031207): schema is up to date; web
format:check, lint, typecheck, all tests andyarn buildpass; server lint,format:checkand all tests pass.🤖 Generated with Claude Code