Skip to content

fix(autohand): forward role-specific model config to the Autohand CLI#2993

Merged
Vaibhaav-Tiwari merged 1 commit into
AgentWrapper:mainfrom
krishrathi1:fix/autohand-model-config
Jul 23, 2026
Merged

fix(autohand): forward role-specific model config to the Autohand CLI#2993
Vaibhaav-Tiwari merged 1 commit into
AgentWrapper:mainfrom
krishrathi1:fix/autohand-model-config

Conversation

@krishrathi1

Copy link
Copy Markdown
Contributor

Summary

The Autohand adapter's GetLaunchCommand and GetRestoreCommand never read cfg.Config.Model, so a project's per-role agentConfig.model was 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 --model flag when a model is configured, and advertise the field via GetConfigSpec so it shows up in project config UI/validation.

Fixes #2889

Changes

  • backend/internal/adapters/agent/autohand/autohand.go: add an appendModelFlag helper, call it from GetLaunchCommand and GetRestoreCommand, and override GetConfigSpec to advertise the model field (previously inherited the empty default from agentbase.Base). --model is accepted on both the main invocation and the resume subcommand, 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-stale TestGetConfigSpecHasNoCustomFieldsYet with TestGetConfigSpecReportsModelField, 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 ./... passes
  • go vet ./internal/adapters/agent/autohand/... passes
  • go test ./internal/adapters/agent/autohand/... — all tests pass (no pre-existing failures in this package)

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
@krishrathi1

Copy link
Copy Markdown
Contributor Author

@Vaibhaav-Tiwari please review this

@Vaibhaav-Tiwari
Vaibhaav-Tiwari merged commit 55f093d into AgentWrapper:main Jul 23, 2026
9 checks passed
@krishrathi1
krishrathi1 deleted the fix/autohand-model-config branch July 23, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autohand ignores role-specific model config on launch

2 participants