fix(autohand): forward role-specific model config to the Autohand CLI#2993
Merged
Vaibhaav-Tiwari merged 1 commit intoJul 23, 2026
Merged
Conversation
GetLaunchCommand and GetRestoreCommand never read cfg.Config.Model, so a project's per-role agentConfig.model was silently dropped and Autohand always launched on its own global default model instead of the configured one. --model is accepted on both the main invocation and the resume subcommand, so both argv builders now forward it. Mirrors the pattern used by the Codex (AgentWrapper#2869), Cline (AgentWrapper#2894), and Goose (AgentWrapper#2885) adapters: append a trimmed --model flag when configured, and advertise the field via GetConfigSpec. Fixes AgentWrapper#2889
Contributor
Author
|
@Vaibhaav-Tiwari please review this |
3 tasks
Vaibhaav-Tiwari
approved these changes
Jul 23, 2026
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 Autohand adapter's
GetLaunchCommandandGetRestoreCommandnever readcfg.Config.Model, so a project's per-roleagentConfig.modelwas silently dropped and Autohand workers/orchestrators always launched on Autohand's own global default model instead of the configured one.This mirrors the pattern already applied to the Codex (#2869), Cline (#2894, #2953), and Goose (#2885, #2956) adapters: append a trimmed
--modelflag when a model is configured, and advertise the field viaGetConfigSpecso it shows up in project config UI/validation.Fixes #2889
Changes
backend/internal/adapters/agent/autohand/autohand.go: add anappendModelFlaghelper, call it fromGetLaunchCommandandGetRestoreCommand, and overrideGetConfigSpecto advertise themodelfield (previously inherited the empty default fromagentbase.Base).--modelis accepted on both the main invocation and theresumesubcommand, so both argv builders forward it, and the stale doc comment claiming resume "only accepts workspace path and session id" is updated accordingly.backend/internal/adapters/agent/autohand/autohand_test.go: replace the now-staleTestGetConfigSpecHasNoCustomFieldsYetwithTestGetConfigSpecReportsModelField, 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/autohand/...passesgo test ./internal/adapters/agent/autohand/...— all tests pass (no pre-existing failures in this package)