Skip to content

feat: make tool output size limit configurable via GOOSE_MAX_TOOL_RESPONSE_SIZE#9256

Open
DOsinga wants to merge 1 commit into
mainfrom
fix/7027-configurable-tool-output-limit
Open

feat: make tool output size limit configurable via GOOSE_MAX_TOOL_RESPONSE_SIZE#9256
DOsinga wants to merge 1 commit into
mainfrom
fix/7027-configurable-tool-output-limit

Conversation

@DOsinga
Copy link
Copy Markdown
Collaborator

@DOsinga DOsinga commented May 15, 2026

Reads GOOSE_MAX_TOOL_RESPONSE_SIZE from config, defaulting to the existing 200,000 character threshold. Users with smaller-context models can lower this to keep large tool outputs from degrading performance.

Uses the same Config::global().get_param pattern as GOOSE_TOOL_CALL_CUTOFF.

Fixes #7027

…PONSE_SIZE

Read GOOSE_MAX_TOOL_RESPONSE_SIZE from config (same pattern as
GOOSE_TOOL_CALL_CUTOFF), defaulting to the existing 200,000 character
limit. Users with smaller-context models can lower this to avoid
degraded performance from large tool outputs.

Fixes #7027

Signed-off-by: Douwe Osinga <douwe@squareup.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f839528b3b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +9 to +12
fn large_text_threshold() -> usize {
Config::global()
.get_param::<usize>("GOOSE_MAX_TOOL_RESPONSE_SIZE")
.unwrap_or(DEFAULT_LARGE_TEXT_THRESHOLD)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Cache configured response-size limit

Avoid reading GOOSE_MAX_TOOL_RESPONSE_SIZE from Config on every tool result. process_tool_response runs for each tool call, and large_text_threshold() now calls Config::global().get_param(...), which falls through to config-file loading/parsing when the env var is unset. That introduces synchronous filesystem/config-deserialization work on a hot path and can add noticeable latency in tool-heavy sessions compared to the previous constant-time check.

Useful? React with 👍 / 👎.

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.

Configure maximum tool output length

1 participant