feat(mothership): let the worker choose models when the model picker is off - #8669
waleedlatif1 wants to merge 3 commits into
Conversation
…is off With the picker off, chats sent the hidden hosted default selection (GPT-6 Astra), which the worker treats as an explicit pick for both the main agent and subagents. No selection is sent now, so the worker routes every model role itself. A stale client selection is still cleared at admission. Picker-on chats and the Sim Chat block are unchanged.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
When the Mothership model picker is off, as it is on hosted prod, chats no longer send a hidden model selection. The worker now routes every model role itself.
Paired worker PR: simstudioai/mothership#601. With it, the worker runs the main agent on GPT-6 Astra and subagents on GPT-6 Sol by default. Merge waits on an end-to-end benchmark. A small paired sample showed correctness 66.7% → 75.0% with 0 losses, cost −21% and wall time −23.5%. Both PRs merge only if a larger run confirms that.
Why
resolveMothershipModelSettingsattached{gpt-6-astra, fastMode:false}to every non-assistant chat when the picker was off. The worker treats any selection as the user's explicit pick and runs both the main agent and subagents on it, so the server's role models (COPILOT_SUBAGENT_MODEL, and on self-hostCOPILOT_MODEL) never applied. This is the same problem that ledwithEnterpriseByokKeyto remove the hidden default for BYOK workspaces. Server-side model routing is a Mothership rule, so a selection should only travel when someone made one.Changes
resolveMothershipModelSettings. With the picker off it returnsmodelSelection: undefined. The effort clamps are unchanged. The key is still present, soObject.assign(body, …)at admission clears any stale selection a client sends.normalizeModelSelection. The Opus 5 → 5.5 and no-Fast-for-Opus normalization moved into its own function, which the store and the picker-on path both use.Unchanged
Compatibility
COPILOT_MODELfor the main agent andCOPILOT_SUBAGENT_MODEL ?? COPILOT_MODELfor subagents, which is Astra/Astra today. Hosted behavior does not change.Tests
post.test.ts: the picker-off case serializes the request that admission hands to the stream lifecycle (the body sent to the worker). It asserts the request has nomodelSelection, even when the client sent a Sol selection, and that it carries the clamped effort. Onstagingall 6 effort cases fail with the hidden{ model: 'gpt-6-astra', fastMode: false }.Gate
bun run lint,type-check,check:audits,docs-manifest:checkand the block-registry check all pass.bun run test: 34772 pass. Four unrelated files failed under machine load:remark-plain-text,html-parser,copilot-route-inventory(60s timeout) andsso-trust. They pass when rerun together withlib/mothershipandstores/mothership-effort: 2697 tests pass.