Skip to content

Conversation

@stefandevo
Copy link
Collaborator

@stefandevo stefandevo commented Jan 22, 2026

Summary

  • Fixes model alias resolution bug in generateBacklogPlan() when using explicit model overrides
  • Previously, passing model: "sonnet" would fail because the API expects full model IDs like claude-sonnet-4-20250514

Problem

In apps/server/src/routes/backlog-plan/generate-plan.ts, when an explicit model override was provided, the code only fetched credentials:

if (effectiveModel) {
  // Use explicit override - just get credentials
  credentials = await settingsService?.getCredentials();
}

The other code branches correctly called resolvePhaseModel():

  • else if (settingsService) - ✅ Calls resolvePhaseModel(phaseResult.phaseModel)
  • else - ✅ Calls resolvePhaseModel(DEFAULT_PHASE_MODELS.backlogPlanningModel)

But the explicit override branch was missing this, causing API calls to fail when using model aliases.

Solution

Added the missing resolvePhaseModel() call to the explicit override branch:

if (effectiveModel) {
  // Use explicit override - resolve model alias and get credentials
  const resolved = resolvePhaseModel({ model: effectiveModel });
  effectiveModel = resolved.model;
  thinkingLevel = resolved.thinkingLevel;
  credentials = await settingsService?.getCredentials();
}

Test plan

  • Server build passes
  • All 1332 server unit tests pass
  • Manual test: Call backlog plan endpoint with explicit model override using an alias (e.g., model: "sonnet") and verify the plan generates successfully

Summary by CodeRabbit

  • Bug Fixes
    • Fixed model override handling to properly resolve model aliases and apply thinking level settings when a custom model is specified.

✏️ Tip: You can customize this high-level summary in your review settings.

When a user explicitly passes a model override (e.g., model: "sonnet"),
the code was only fetching credentials without resolving the model alias.
This caused API calls to fail because the Claude API expects full model
strings like "claude-sonnet-4-20250514", not aliases like "sonnet".

The other code branches (settings-based and fallback) correctly called
resolvePhaseModel(), but the explicit override branch was missing this.

This fix adds the resolvePhaseModel() call to ensure model aliases are
properly resolved before being sent to the API.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @stefandevo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical bug in the backlog plan generation process where explicitly provided model aliases were not correctly resolved to their full model identifiers. By integrating the model resolution logic into the explicit override path, the change ensures that API calls using aliases now succeed, improving the robustness and flexibility of model selection.

Highlights

  • Model Alias Resolution: Corrected an issue where explicit model overrides in generateBacklogPlan() failed to resolve model aliases (e.g., "sonnet") to their full API-expected IDs, leading to API call failures.
  • generateBacklogPlan Logic Update: Integrated the resolvePhaseModel() function into the explicit model override branch within generateBacklogPlan.ts to ensure proper alias resolution and extraction of thinkingLevel.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

The change modifies the generateBacklogPlan function to resolve model aliases and assign thinking level before retrieving credentials when an explicit model override is provided, rather than only fetching credentials without first resolving the alias.

Changes

Cohort / File(s) Change Summary
Model Alias Resolution in Backlog Plan Generation
apps/server/src/routes/backlog-plan/generate-plan.ts
When an explicit model override is detected, the code now resolves the model alias via resolvePhaseModel, updates effectiveModel with the resolved value, and assigns thinkingLevel before credential retrieval. Previously skipped alias resolution in this code path.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

Poem

🐰 A model needs a proper name,
Before its secrets we can claim,
Resolve the alias, set the thought,
Then credentials are carefully sought,
The rabbit hops with newfound grace! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: resolving model aliases in the explicit override branch of the backlog plan generation function.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request effectively resolves the model alias resolution bug in generateBacklogPlan() when an explicit model override is used. By introducing the resolvePhaseModel() call, the code now correctly handles model aliases and ensures that the full model IDs are used for API calls, aligning this branch with the logic in other model resolution paths. The change is well-explained and directly addresses the problem, improving the robustness of model selection.

@stefandevo stefandevo merged commit 0155da0 into v0.14.0rc Jan 22, 2026
7 checks passed
@stefandevo stefandevo deleted the fix/generate-plan branch January 22, 2026 11:58
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.

2 participants