fix(git): use user-selected model for auto-generated commit messages#1168
fix(git): use user-selected model for auto-generated commit messages#1168seifalmotaz wants to merge 1 commit intopingdotgg:mainfrom
Conversation
The auto-generated commit messages and PR content were using a hardcoded model (gpt-5.3-codex) instead of respecting the model selected in the chat UI. - Add optional model parameter to TextGeneration input interfaces - Pass model from GitRunStackedActionInput through GitManager to text generation - Wire model selection from ChatView through ChatHeader to GitActionsControl - Propagate model for branch name generation in ProviderCommandReactor - Fall back to default model when no model is specified Fixes pingdotgg#1165
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can enforce grammar and style rules using `languagetool`.Configure the |
There was a problem hiding this comment.
i don't think this is the correct solution. i wouldn't wanna use gpt-5.4 xhigh to generate a commit message for me, way too slow and it will overthink it.
what we should fix:
- not using a model the user doesn't have access to (same as we do for gpt 5.3 spark)
- make it configurable (probably a knob in settings, we really need to do #1033 to have server authorative settings)
|
Thanks for the feedback! I understand now - my previous PR was wrong. . Sensible default: Use a fast, appropriate model (like gpt-5.3-codex) for commit messages, NOT the user's chat model selection |
can be client side for now yes. default can probably be the newly released |
|
I will draft this PR as it's the wrong approach, and will create new PR with new approach, i will make it as soon as i test it and make sure it's in good place (very soon). |
What Changed
This PR fixes the auto-generated commit messages, PR content, and branch names to use the model selected by the user in the chat UI model picker, instead of the hardcoded
gpt-5.3-codexconstant.Changes:
Contracts (
packages/contracts/src/git.ts)modelfield toGitRunStackedActionInputschemaServer - TextGeneration (
apps/server/src/git/Services/TextGeneration.ts)modelparameter toCommitMessageGenerationInput,PrContentGenerationInput, andBranchNameGenerationInputinterfacesServer - CodexTextGeneration (
apps/server/src/git/Layers/CodexTextGeneration.ts)CODEX_MODELtoDEFAULT_CODEX_MODELas fallbackmodelparameter torunCodexJsonfunctionServer - GitManager (
apps/server/src/git/Layers/GitManager.ts)modelparameter throughrunFeatureBranchStep,runCommitStep,runPrStep, andresolveCommitAndBranchSuggestionServer - ProviderCommandReactor (
apps/server/src/orchestration/Layers/ProviderCommandReactor.ts)modelfromthread.turn-start-requestedevent to branch name generationWeb - gitReactQuery (
apps/web/src/lib/gitReactQuery.ts)modelparameter togitRunStackedActionMutationOptionsWeb - GitActionsControl (
apps/web/src/components/GitActionsControl.tsx)selectedModelprop and passes it to the mutationWeb - ChatHeader (
apps/web/src/components/chat/ChatHeader.tsx)selectedModelprop and passes it toGitActionsControlWeb - ChatView (
apps/web/src/components/ChatView.tsx)selectedModeltoChatHeaderWhy
Previously, when a user selected a specific model (e.g.,
gpt-5.2-codex) in the chat UI model picker and then triggered a Git action like "Auto Commit" or "Commit & Push", the app would ignore that selection and use the hardcodedgpt-5.3-codexmodel. This was problematic because:The fix propagates the user-selected model through the entire chain from the UI to the Codex CLI text generation calls, while maintaining backward compatibility with a sensible default fallback.
UI Changes
No visible UI changes. The behavior is now consistent with user expectations - the selected model is used for all AI-powered operations including commit message generation.
Checklist
Fixes #1165
Note
Pass user-selected model to auto-generated commit messages, branch names, and PR content
modelfield to theGitRunStackedActionInputcontract and threads it throughGitManagerinto all text generation calls (generateCommitMessage,generateBranchName,generatePrContent).CodexTextGenerationnow accepts amodeloverride in each generation handler and passes it to thecodex --modelflag, falling back toDEFAULT_CODEX_MODELwhen not supplied.ChatView, passes it viaChatHeadertoGitActionsControl, and includes it in therunImmediateGitActionMutationpayload.ProviderCommandReactoralso receives the model from the event payload.Macroscope summarized 5a884a7.