fix(agent): Explore and claude-code-guide no longer hard-code model=haiku#154
Merged
tjb-tech merged 1 commit intoHKUDS:mainfrom Apr 17, 2026
Merged
Conversation
…aiku Both built-in agents previously set model="haiku", which caused subprocess spawning to fail for users running any non-Anthropic provider (OpenAI, Bedrock, custom base URLs, etc.) because the literal string "haiku" is not a valid model on those APIs. Changes: - Explore and claude-code-guide now use model="inherit", consistent with the existing Plan and verification built-in agents. - build_inherited_cli_flags now skips the --model flag when the value is "inherit", so the subprocess inherits the parent model via the OPENHARNESS_MODEL env var that build_inherited_env_vars already forwards. Previously "inherit" was passed verbatim as a model name, which would have also broken Plan and verification agents. Tests added: - build_inherited_cli_flags: model="inherit" and model=None produce no --model flag; a real model name is included as expected. - Builtin agent definitions: Explore and claude-code-guide must not reference Anthropic-only model aliases; Plan, verification, Explore, and claude-code-guide must all use None or "inherit". Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes subprocess-spawned built-in agents failing on non-Anthropic providers by removing hard-coded Anthropic model aliases and correctly implementing the "inherit" model sentinel so child agents inherit the parent model via OPENHARNESS_MODEL.
Changes:
- Updated built-in
Exploreandclaude-code-guideagent definitions to usemodel="inherit"instead ofmodel="haiku". - Updated
build_inherited_cli_flagsto omit--modelwhen the model is"inherit". - Added regression tests covering model flag inheritance/omission behavior and guarding against provider-specific model aliases in built-ins.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/openharness/coordinator/agent_definitions.py |
Switches built-in agents to provider-agnostic model inheritance ("inherit"). |
src/openharness/swarm/spawn_utils.py |
Skips emitting --model when the model is the "inherit" sentinel. |
tests/test_swarm/test_spawn_utils.py |
Adds tests asserting correct --model flag inclusion/exclusion behavior. |
tests/test_coordinator/test_agent_definitions.py |
Adds tests ensuring provider-agnostic built-ins don’t hard-code Anthropic-only aliases. |
CHANGELOG.md |
Documents the bugfix and the inheritance behavior change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+145
to
147
| # "inherit" means use the parent's model via the OPENHARNESS_MODEL env var. | ||
| if model and model != "inherit": | ||
| flags.extend(["--model", shlex.quote(model)]) |
| @@ -26,6 +26,8 @@ The format is based on Keep a Changelog, and this project currently tracks chang | |||
|
|
|||
| - `todo_write` tool now updates an existing unchecked item in-place when `checked=True` instead of appending a duplicate `[x]` line. | |||
|
|
|||
arik08
pushed a commit
to arik08/MyHarness
that referenced
this pull request
Apr 26, 2026
…aiku (HKUDS#154) Both built-in agents previously set model="haiku", which caused subprocess spawning to fail for users running any non-Anthropic provider (OpenAI, Bedrock, custom base URLs, etc.) because the literal string "haiku" is not a valid model on those APIs. Changes: - Explore and claude-code-guide now use model="inherit", consistent with the existing Plan and verification built-in agents. - build_inherited_cli_flags now skips the --model flag when the value is "inherit", so the subprocess inherits the parent model via the OPENHARNESS_MODEL env var that build_inherited_env_vars already forwards. Previously "inherit" was passed verbatim as a model name, which would have also broken Plan and verification agents. Tests added: - build_inherited_cli_flags: model="inherit" and model=None produce no --model flag; a real model name is included as expected. - Builtin agent definitions: Explore and claude-code-guide must not reference Anthropic-only model aliases; Plan, verification, Explore, and claude-code-guide must all use None or "inherit". Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Problem
The built-in
Exploreandclaude-code-guideagent definitions both hard-codemodel="haiku". When these agents are spawned as subprocesses (via theagenttool), the child process receives--model 'haiku'on its command line. This causes an immediate API error for any user whose session is backed by a non-Anthropic provider — OpenAI-compatible endpoints, AWS Bedrock, Google Vertex, or any custombase_url— because"haiku"is not a valid model name on those APIs.A secondary bug:
build_inherited_cli_flagsdid not special-case the sentinel value"inherit". Agents that already usedmodel="inherit"(Plan,verification) would therefore pass the literal string--model 'inherit'to the subprocess instead of omitting the flag and letting theOPENHARNESS_MODELenv var (already forwarded bybuild_inherited_env_vars) do its job.Fixes #153.
Changes
src/openharness/coordinator/agent_definitions.py— Changedmodel="haiku"→model="inherit"forExploreandclaude-code-guide, consistent with the existingPlanandverificationbuilt-in agents.src/openharness/swarm/spawn_utils.py—build_inherited_cli_flagsnow skips the--modelflag when the value is"inherit"so the subprocess correctly inherits the parent model viaOPENHARNESS_MODEL.Testing
New tests added and all pass (
uv run pytest -q):tests/test_swarm/test_spawn_utils.pytest_build_inherited_cli_flags_explicit_model_included— a real model name produces--model <name>in the flag list.test_build_inherited_cli_flags_inherit_model_excluded—"inherit"produces no--modelflag.test_build_inherited_cli_flags_none_model_excluded—Noneproduces no--modelflag.test_build_inherited_cli_flags_empty_string_model_excluded— empty string produces no--modelflag.tests/test_coordinator/test_agent_definitions.pytest_builtin_explore_does_not_hardcode_provider_model—Exploremust not reference an Anthropic-only model alias.test_builtin_claude_code_guide_does_not_hardcode_provider_model— same guard forclaude-code-guide.test_builtin_provider_agnostic_agents_use_inherit_or_none— asserts all four provider-agnostic built-in agents (Plan,verification,Explore,claude-code-guide) useNoneor"inherit".Full suite result: 727 passed, 6 skipped (3 pre-existing
BashToolmacOSscript -ffailures unrelated to this change).