-
Notifications
You must be signed in to change notification settings - Fork 68
Description
Summary
roborev refine passes the refine/fix agent to the branch review enqueue call, causing the server to use the wrong agent for the review step.
Root Cause
In cmd/roborev/refine.go, the branch review is enqueued with resolvedAgent (resolved via the "refine" workflow):
resolvedAgent := config.ResolveAgentForWorkflow(opts.agentName, repoPath, cfg, "refine", resolvedReasoning)
// ...
jobID, err = client.EnqueueReview(repoPath, rangeRef, resolvedAgent)On the server side, ResolveAgentForWorkflow treats a non-empty cli argument as an explicit override and returns it immediately, bypassing the workflow-specific config:
func ResolveAgentForWorkflow(cli, repoPath string, globalCfg *Config, workflow, level string) string {
if s := strings.TrimSpace(cli); s != "" {
return s // short-circuits — never consults review_agent config
}
// ...
}The server resolves the agent via the "review" workflow but receives "claude-code" (the refine agent) as the cli argument, so review_agent config is ignored. However, the model is resolved via the "review" workflow, picking up review_model. This creates a mismatch — e.g., claude-code paired with gpt-5.4.
Reproduction
Config:
review_agent = 'codex'
review_model = 'gpt-5.4'
refine_agent = 'claude-code'
refine_model = 'claude-opus-4-6'Run roborev refine on a feature branch. The branch review job fails with:
agent: claude-code failed
stream: stream errors: There's an issue with the selected model (gpt-5.4).
Fix
Pass empty string for the agent in the branch review enqueue call so the server resolves it via the "review" workflow config:
jobID, err = client.EnqueueReview(repoPath, rangeRef, "")