fix(grok): forward role-specific model config to the Grok Build CLI#3004
Open
krishrathi1 wants to merge 2 commits into
Open
fix(grok): forward role-specific model config to the Grok Build CLI#3004krishrathi1 wants to merge 2 commits into
krishrathi1 wants to merge 2 commits into
Conversation
GetLaunchCommand and GetRestoreCommand never read cfg.Config.Model, so a project's per-role agentConfig.model was silently dropped and Grok Build always launched on its own global default model instead of the configured one. Mirrors the pattern used by the Codex (AgentWrapper#2869), Cline (AgentWrapper#2894), Goose (AgentWrapper#2885), and Autohand (AgentWrapper#2889) adapters: append a trimmed --model flag on both the launch and restore argv, and advertise the field via GetConfigSpec. Fixes AgentWrapper#2886
Contributor
Author
|
@Vaibhaav-Tiwari broo look for this changes |
Pulkit7070
reviewed
Jul 23, 2026
Collaborator
|
Thanks for contributing to Agent Orchestrator. This PR is being picked up by the current external contributor on-call pair: If someone is already working on this, please continue as usual. For faster context or live questions, you can also join the AO Discord. Join the session here: Come by if you want to see what is being built, ask questions, or just hang around with the community. |
Review feedback on AgentWrapper#3004 pointed out --model had no citation, unlike the --permission-mode flags above it which cite `grok -h`. The only source for --model was a third-party CLI cheat sheet. docs.x.ai/build/overview documents -m as the flag to "pick the model in headless mode or in the TUI" (`grok -p "Hello" -m my-model`), with no --model long form mentioned. Switch to the officially documented flag and cite the source in the doc comment.
Contributor
Author
|
@Vaibhaav-Tiwari please review these changes ....!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Grok Build adapter's
GetLaunchCommandandGetRestoreCommandnever readcfg.Config.Model, so a project's per-roleagentConfig.modelwas silently dropped and Grok Build workers/orchestrators always launched on Grok's own global default model instead of the configured one.This mirrors the pattern already applied to the Codex (#2869), Cline (#2894, #2953), Goose (#2885, #2956), and Autohand (#2889, #2993) adapters: append a trimmed
--modelflag on both the launch and restore argv when a model is configured, and advertise the field viaGetConfigSpecso it shows up in project config UI/validation.Fixes #2886
Changes
backend/internal/adapters/agent/grok/grok.go: add anappendModelFlaghelper, call it fromGetLaunchCommandandGetRestoreCommand(right after the approval-mode flags), and overrideGetConfigSpecto advertise themodelfield (previously inherited the empty default fromagentbase.Base).backend/internal/adapters/agent/grok/grok_test.go: replace the now-staleTestGetConfigSpecEmptywithTestGetConfigSpecReportsModelField, and add regression tests for: trimmed model appended on launch, blank model omitted on launch, and trimmed model appended on restore.Test plan
go build ./...passesgo vet ./internal/adapters/agent/grok/...passesgo test ./internal/adapters/agent/grok/...— all new/updated tests pass (pre-existing unrelated failures on this Windows dev box:TestGrokLocalAuthStatusAuthorizedWithAuthFile/TestGrokLocalAuthStatusUnauthorizedWithEmptyAuthFile, both failing identically onmainbefore this change due to a localHOME/config-path environment quirk, not this change)