Summary
When a tool returns a large output, the agent turn silently dies with the generic Agent couldn't generate a response message. No size/token error is surfaced anywhere user-visible.
Confirmed reproductions
config.schema.lookup on agents.defaults — returns 25K+ chars of schema. Turn fails silently.
grep invocation returning ~184K chars of matches. Same silent failure.
Both cases: the tool itself succeeds, output is collected, then the next model call to integrate the output fails without an explicit error about size/tokens. The user just sees the generic "couldn't generate a response".
Ask
-
Truncate tool output that exceeds a configurable threshold. Suggest tools.maxOutputChars (or agents.defaults.tools.maxOutputChars), default ~16K. Append a clear marker so the model knows it was truncated:
[truncated: N chars omitted, original was M chars total]
-
Surface oversize/truncation as an explicit log event at user-visible log level so it can actually be debugged. Currently zero signal.
-
Document the limit in the tool docs and in the config.schema entry for the new key.
Why it matters
Discovery is painful. The only debug path today is: guess that output was too big, retry the same tool with head/narrower args, see if it works. This burns hours on what could be a one-line log message.
Version
- 2026.4.23 on Ubuntu 24.04 (LX)
- Local workaround documented (cap tool output preemptively), but the silent-failure mode is the real bug.
Summary
When a tool returns a large output, the agent turn silently dies with the generic
Agent couldn't generate a responsemessage. No size/token error is surfaced anywhere user-visible.Confirmed reproductions
config.schema.lookuponagents.defaults— returns 25K+ chars of schema. Turn fails silently.grepinvocation returning ~184K chars of matches. Same silent failure.Both cases: the tool itself succeeds, output is collected, then the next model call to integrate the output fails without an explicit error about size/tokens. The user just sees the generic "couldn't generate a response".
Ask
Truncate tool output that exceeds a configurable threshold. Suggest
tools.maxOutputChars(oragents.defaults.tools.maxOutputChars), default ~16K. Append a clear marker so the model knows it was truncated:Surface oversize/truncation as an explicit log event at user-visible log level so it can actually be debugged. Currently zero signal.
Document the limit in the tool docs and in the
config.schemaentry for the new key.Why it matters
Discovery is painful. The only debug path today is: guess that output was too big, retry the same tool with
head/narrower args, see if it works. This burns hours on what could be a one-line log message.Version