mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
fix(gateway): respect GOOSE_MAX_TURNS in gateway sessions (#9354)
Signed-off-by: fresh3nough <anonwurcod@proton.me>
This commit is contained in:
@@ -232,6 +232,7 @@ These variables control how goose manages conversation sessions and context.
|
||||
|----------|---------|---------|---------|
|
||||
| `GOOSE_CONTEXT_STRATEGY` | Controls how goose handles context limit exceeded situations | "summarize", "truncate", "clear", "prompt" | "prompt" (interactive), "summarize" (headless) |
|
||||
| `GOOSE_MAX_TURNS` | [Maximum number of turns](/docs/guides/sessions/smart-context-management#maximum-turns) allowed without user input | Integer (e.g., 10, 50, 100) | 1000 |
|
||||
| `GOOSE_GATEWAY_MAX_TURNS` | Maximum number of turns for gateway sessions (e.g., Telegram). Overrides `GOOSE_MAX_TURNS` for gateway traffic only, so chat platforms can keep a stricter cap than CLI/desktop sessions. | Integer (e.g., 5, 10, 25) | Falls back to `GOOSE_MAX_TURNS`, then 5 |
|
||||
| `GOOSE_SUBAGENT_MAX_TURNS` | Sets the maximum turns allowed for a [subagent](/docs/guides/context-engineering/subagents) to complete before timeout. Can be overridden by [`settings.max_turns`](/docs/guides/recipes/recipe-reference#settings) in recipes or subagent tool calls. | Integer (e.g., 25) | 25 |
|
||||
| `GOOSE_MAX_BACKGROUND_TASKS` | Sets the maximum number of concurrent background [subagent](/docs/guides/context-engineering/subagents) tasks goose can run at once | Integer (e.g., 1, 5, 10) | 5 |
|
||||
| `CONTEXT_FILE_NAMES` | Specifies custom filenames for [hint/context files](/docs/guides/context-engineering/using-goosehints#custom-context-files) | JSON array of strings (e.g., `["CLAUDE.md", ".goosehints"]`) | `[".goosehints"]` |
|
||||
@@ -268,6 +269,10 @@ export GOOSE_MAX_TURNS=25
|
||||
# Set a reasonable limit for production
|
||||
export GOOSE_MAX_TURNS=100
|
||||
|
||||
# Raise the per-gateway cap without changing CLI/desktop limits
|
||||
# (applies to Telegram and other gateway sessions only)
|
||||
export GOOSE_GATEWAY_MAX_TURNS=15
|
||||
|
||||
# Customize the default subagent turn limit
|
||||
# Note: This can be overridden per-recipe or per-subagent using the max_turns setting
|
||||
export GOOSE_SUBAGENT_MAX_TURNS=50
|
||||
|
||||
Reference in New Issue
Block a user