Skip to content

feat(mothership): let the worker choose models when the model picker is off - #8669

Open
waleedlatif1 wants to merge 3 commits into
stagingfrom
feat/mothership-omit-hidden-model-default
Open

waleedlatif1 wants to merge 3 commits into
stagingfrom
feat/mothership-omit-hidden-model-default

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

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

resolveMothershipModelSettings attached {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-host COPILOT_MODEL) never applied. This is the same problem that led withEnterpriseByokKey to 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 returns modelSelection: undefined. The effort clamps are unchanged. The key is still present, so Object.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.
  • Model selector. Shows the model controls when a selection exists, which happens only with the picker on.

Unchanged

  • Picker-on chats, including one that has never been changed and is shown as Astra.
  • The Sim Chat block, which has its own visible model field.
  • Assistant/Search chats.
  • BYOK handling.

Compatibility

  • New Sim with old worker. The worker uses COPILOT_MODEL for the main agent and COPILOT_SUBAGENT_MODEL ?? COPILOT_MODEL for subagents, which is Astra/Astra today. Hosted behavior does not change.
  • Old Sim with new worker. The hidden selection still arrives as an explicit Astra pick, so behavior is Astra/Astra as today.
  • Both new. Astra main agent with Sol subagents.

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 no modelSelection, even when the client sent a Sol selection, and that it carries the clamped effort. On staging all 6 effort cases fail with the hidden { model: 'gpt-6-astra', fastMode: false }.

Gate

bun run lint, type-check, check:audits, docs-manifest:check and 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) and sso-trust. They pass when rerun together with lib/mothership and stores/mothership-effort: 2697 tests pass.

…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.
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 6, 2026 6:43am UTC

Request Review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai 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.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes how model selection flows when the picker is disabled.

No outstanding review finding blocks merging.

Summary

The PR omits hidden model selections when the picker is off, allowing the worker to choose models by role. It also separates model normalization for stored selections and updates the selector and admission test. The two previous test-rule findings are resolved.

Reviews (3) · Last reviewed commit: "test(mothership): read the serialized re..."

Comment thread apps/sim/lib/mothership/chat/post.test.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai 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.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

Comment thread apps/sim/lib/mothership/chat/post.test.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai 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.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

This branch was previously deployed

1 inactive deployment
Preview — d5c53d19 Deployed Oct 6, 2026 by vercel[bot]
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.

1 participant