You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: The PR centralizes
workflow model resolution and adds fallback tests, but introduces a few medium-severity issues regarding custom ACP aliases, backup models in batch processing, and a test script typo on Windows.
Problem:ResolveWorkflowModelForAgent compares agent identity using CanonicalName, which only covers static aliases (claude, agent). It does not treat configured ACP aliases (cfg.ACP.Name) as equivalent
to runtime "acp".
Impact: With default_agent = "<custom ACP alias>", the actual selected agent name is "acp", so the function incorrectly treats it as a “different agent” and skips the default_model.
Suggested fix: Make comparison ACP
-aware (e.g., resolve both sides through GetAvailableWithConfig(...).Name() before comparing, or add ACP-name equivalence in a shared normalization helper). Add tests for configured ACP alias + default_model.
Problem: After backup-agent handling, runSingle now always calls ResolveWorkflowModelForAgent when model == "". If the backup was selected and the backup
model is unset, this can incorrectly apply the workflow/default model to the backup agent.
Impact: Behavioral regression vs. other paths (fix/refine/server/ci_poller) where a selected backup with no backup model keeps its own default model. This can assign an incompatible model to the
backup agent.
Suggested fix: Track usingBackup and skip the fallback ResolveWorkflowModelForAgent call when the backup is selected and no explicit model is set. Add a batch test covering “backup selected + empty backup model” (especially with a configured workflow model).
Problem: The Windows mock script generation for the claude binary contains a copy-paste error ( @internal/prompt/analyze/complexity.txt /b 0\r\n) instead of a valid batch exit command. This will cause the mock binary to fail execution on Windows.
Suggested fix: Change to use a valid batch exit command (e.
g., claudeScript = []byte("@exit /b 0\r\n")).
Verdict: The model-selection refactoring is logically sound, but introduces high-severity syntax and formatting errors in the test mock scripts that will cause compilation and runtime failures.
High
internal/daemon/server_jobs_test.go (
line ~1761)
Problem: Malformed mock script content appears to be a mangled replacement error, which will cause the mock batch script to fail on Windows.
Fix: Change to a valid exit command.
internal/daemon/server_jobs_ test.go (line ~1762)
Problem: Unescaped double quotes inside the string literal fmt.Appendf(nil, " @"%s" %%*\r\n", gitPath) will cause a compilation error.
Fix: Escape the quotes
properly.
internal/daemon/server_jobs_test.go (line ~1765)
Problem: Malformed shell script syntax in fmt.Appendf(nil, "#!/bin/sh\nexec %q \"$ @"n", gitPath ). It improperly formats the arguments variable and is missing a backslash for the newline.
Fix: Correct the string to properly pass arguments.
Verdict: The model-selection logic refactoring is secure and centralizes workflow model fallback resolution, but introduces a high-severity
syntax error in test files that must be corrected.
Problem: Invalid Go syntax and corrupted script contents due to escaping/copy-
paste errors. Unescaped quotes in @"%s", mangled shell variables (\"$ @"n"), and an accidental file path ( @internal/prompt/analyze/complexity.txt) instead of the exit command.
Fix: Correct the string literals to valid Go/
shell syntax:
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
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
default_modelbased on the configured workflow agent when the actual runnable agent differsTesting