Skip to content

fix(server): use configured model for one-shot text-gen fallback - #12905

Open
macodev00 wants to merge 1 commit into
pingdotgg:mainfrom
macodev00:cursor/text-gen-fallback-model-3f9e
Open

macodev00 wants to merge 1 commit into
pingdotgg:mainfrom
macodev00:cursor/text-gen-fallback-model-3f9e

Conversation

@macodev00

@macodev00 macodev00 commented Sep 21, 2026

Copy link
Copy Markdown

What

  • One-shot text generation fallback now uses the provider instance’s configured defaultModelSelection or first custom model instead of always hardcoding claude-haiku-4-5.

Why

Fixes #12651

Redo of closed #12732 addressing Macroscope Not-approved (product-default model selection): change stays local to the fallback model pick on the existing instance path; product slugs remain last-resort when nothing is configured.

UI

No UI. Server one-shot commit/PR/branch/title generation model selection only.

Checklist

  • I read CONTRIBUTING.md and kept this small / bug-only
  • What + why explained above
  • Followed AGENTS.md documentation rules (no new docs)
  • No unrelated changes
  • CLA / AI-reviewed standing override for macodev00 auto-contrib

Summary by CodeRabbit

  • Bug Fixes
    • Improved text-generation fallback behavior when a provider instance is disabled.
    • Fallbacks now honor configured instance defaults, custom model settings, and legacy custom model configurations.
    • Ensures the appropriate configured model is selected instead of an unintended default.

When the stored text-generation selection is unusable, fall back to the
enabled instance's defaultModelSelection or custom model instead of a
hardcoded slug such as claude-haiku-4-5.

Co-authored-by: maco <macodev00@users.noreply.github.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 21, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 9fe1e58

Macroscope's review found this PR approvable — This is a localized server bug fix that makes one-shot text generation respect existing configured model selections and custom models, with targeted regression coverage. Existing fallback defaults remain intact when no configured model is available.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 47468ebf-7239-452a-9e3c-f84588be5426

📥 Commits

Reviewing files that changed from the base of the PR and between 1de563c and 9fe1e58.

📒 Files selected for processing (2)
  • apps/server/src/serverSettings.test.ts
  • apps/server/src/serverSettings.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The server now resolves text-generation fallbacks from matching default selections and configured custom models before using provider defaults. Tests cover instance and legacy custom model configurations.

Changes

Text generation fallback

Layer / File(s) Summary
Fallback resolution logic
apps/server/src/serverSettings.ts
The fallback resolver reuses a matching defaultModelSelection, checks instance and legacy custom models, and then uses the existing default model maps.
Fallback behavior tests
apps/server/src/serverSettings.test.ts
Tests verify fallback selection for a configured default model, an instance custom model, and a legacy custom model. They also verify the resolved claude-haiku-4-5 model in the disabled-provider case.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: juliusmarminge

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description explains the change, motivation, scope, and checklist status. It covers the required template content, although some section headings differ slightly from the template.
Title check ✅ Passed The title clearly and concisely describes the main change: using a configured model for one-shot text-generation fallback.
Linked Issues check ✅ Passed The PR implements the fallback requirement in [#12651] and [#12732]. fallbackTextGenerationProvider first uses the matching defaultModelSelection, then the first configured custom model from the p…
Out of Scope Changes check ✅ Passed The reviewed changes are limited to apps/server/src/serverSettings.ts and its tests. They change fallback model selection and add regression coverage for the linked issue. No unrelated UI or product…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

1 participant