fix(subagents): let recipe settings outrank GOOSE_SUBAGENT_MODEL/PROVIDER (#12070)

This commit is contained in:
Hugues Clouâtre
2026-09-16 12:38:55 +00:00
committed by GitHub
parent 2e488b3359
commit 9222d9685c
4 changed files with 95 additions and 42 deletions
@@ -293,7 +293,7 @@ You can override any default by including the setting in your natural language r
"Use a research subagent with 30 turns and 20-minute timeout to investigate quantum computing trends"
```
**Environment variable:** Set `GOOSE_SUBAGENT_MAX_TURNS` to change the default max turns for all subagents.
**Environment variable:** Set `GOOSE_SUBAGENT_MAX_TURNS` to change the default max turns for all subagents. Similarly, `GOOSE_SUBAGENT_MODEL` and `GOOSE_SUBAGENT_PROVIDER` set defaults for the subagent model and provider; recipe [`settings`](/docs/guides/recipes/recipe-reference#settings) take precedence over both.
### Extension Control
@@ -157,6 +157,8 @@ These variables control how goose manages conversation sessions and context.
| `GOOSE_MOIM_MESSAGE_TEXT` | Injects persistent text into goose's [working memory](/docs/guides/context-engineering/using-persistent-instructions) every turn. Useful for behavioral guardrails or persistent reminders. | Any text string | Not set |
| `GOOSE_MOIM_MESSAGE_FILE` | Path to a file whose contents are injected into goose's [working memory](/docs/guides/context-engineering/using-persistent-instructions) every turn. Supports `~/`. Max 64 KB per file. | File path | Not set |
For subagents, recipe [`settings.goose_provider` and `settings.goose_model`](/docs/guides/recipes/recipe-reference#settings) take precedence over the `GOOSE_SUBAGENT_PROVIDER` and `GOOSE_SUBAGENT_MODEL` environment variables.
**Examples**
```bash
@@ -514,6 +514,8 @@ The `max_turns` setting controls how many iterations an agent can perform before
**Common use cases:** Limit execution time for automated workflows, prevent runaway subagents, control resource usage in scheduled jobs.
For subagents, `goose_provider` and `goose_model` in `settings` take precedence over the `GOOSE_SUBAGENT_PROVIDER` and `GOOSE_SUBAGENT_MODEL` environment variables.
#### Example Settings Configuration
```yaml