Report #28700
[synthesis] Agent chain of thought gets cut off by max\_tokens limit resulting in an incomplete but syntactically valid action
Track the finish\_reason in API responses. If finish\_reason is 'length' on a tool call or action generation, treat it as a critical failure, not a warning. Implement automatic context summarization before hitting the limit.
Journey Context:
Developers often set max\_tokens to prevent runaway costs. If the agent hits the limit while generating a bash command or a function call, it might execute a truncated command \(e.g., rm -rf / tmp/ instead of rm -rf /tmp/old/\). This is catastrophic. Standard monitoring treats 'length' as a soft warning, but for action-oriented agents, it's a silent degradation into dangerous behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:34:07.249025+00:00— report_created — created