fix(server): commit and title generation use your custom model when no text model is set #19386
main fromrefs/pull/19386/head·merged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubWhen no usable text generation model is set, the server falls back to a hard-coded model per provider (claude-haiku-5-5 for Claude). A Claude instance behind a backend that only serves custom models (for example OpenRouter with guardrails) refuses that model, so commit, PR, branch, and title generation all fail even though the user's thread model works.
Now the fallback uses the thread default model, with its options, when that model is one of the fallback instance's custom models. A custom model usually means a backend that may refuse the built-in default, and the thread default is known to work there. Built-in thread defaults keep the cheap fallback (Haiku), so normal Claude users do not move to a more expensive model. Both the machine-level and project-scoped fallbacks use this.
Per provider: the change is in the shared fallback, so it applies the same way to every provider that can be a text generation fallback (Codex, Claude, Cursor, Grok, Muse, Pi, OpenCode, Antigravity). Each has customModels and each one's text generation reads the model and its options from the selection. Nothing changes for a provider when the thread default is not one of its custom models.
Proof: a new test in apps/server/src/serverSettings.test.ts fails on main (gets claude-haiku-5-5) and passes with the fix. It also checks that a built-in thread default still gets Haiku. Related test files, typecheck, and lint for packages/shared and apps/server pass.
Refs #12651. Part 2 of the issue (a failed Claude CLI run shows stderr instead of the JSON error on stdout) is out of scope here.
Reviewed with sol-loop: 1 round with GPT-6.1 Sol.
Model and harness: Claude Opus 5.5 in Claude Code via T3 Code.
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
juliusmarminge added labelsmacroscope-review
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
6e2bda7f-4448-496f-965e-12bf574895ce
📥 Commits
-
Reviewing files that changed from the base of the PR and between f5b5f9dd7be29c4f55f4687dda15e4105cf966fc and 41d8b1253817955f3ecdac2565995d050e88c390.
📒 Files selected for processing: 4
-
apps/server/src/serverSettings.test.tsapps/server/src/serverSettings.tspackages/shared/src/projectSettings.tspackages/shared/src/serverSettings.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
📝 Walkthrough
-
Fallback selection now accepts a default model selection and preserves it when it matches a configured custom model on the chosen enabled instance. Server and project settings pass their defaults into the fallback function.
Changes: Text-generation model fallback
Layer / File(s) Summary Custom-model-aware fallback selection
packages/shared/src/serverSettings.tsThe fallback function accepts an optional default model selection. It returns that selection when its instance is the chosen enabled instance and its model matches a configured custom model. Otherwise, it uses the driver’s default model. Pass defaults into fallback selection
apps/server/src/serverSettings.ts,packages/shared/src/projectSettings.ts,apps/server/src/serverSettings.test.tsServer settings and project settings pass their effective default model selection to fallback selection. The test checks that a configured Claude Agent custom model retains its selection and options, while a built-in model falls back to claude-haiku-5-5.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
41d8b-
Text-generation fallback now keeps the thread default when it is a custom model on the chosen instance, and otherwise keeps the built-in fallback. No merge-blocking risk was identified.
Pre-merge checks:
4-
Passed checks: 4 passed-
Check name Status Explanation Title check The title clearly describes the primary change: using a custom model for commit and title generation when no text model is set. Description check The description explains the problem, the fallback behavior, affected provider scope, verification results, issue reference, out-of-scope work, and agent details. It provides specific test evidence an… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
-
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 5.0 KiB +7 B (+0.1%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB +7 B (+0.6%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 0 (0.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB +24 B (+0.5%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB +24 B (+2.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB +41 B (+0.2%) 29.3 KiB ✅ Claude Live turn messages 1 2 +1 (+100.0%) 8 ✅ Baseline:
f5b5f9d· PR result:41d8b12· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Approvability#
Verdict: Not approved
Macroscope's review found this PR not approvable — This changes the server’s automatic text-generation fallback, causing commit, title, branch, and pull-request generation to use a configured custom model in qualifying cases instead of the existing provider default. The change is narrowly implemented and tested, but its product-default behavior warrants human review.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).