Expand description
Output limits to prevent unbounded memory growth. Output truncation limits inspired by OpenAI Codex multi-tier truncation. Prevents OOM with three independent size limits. Reference: https://openai.com/index/unrolling-the-codex-agent-loop/
Constants§
- DEFAULT_
MESSAGE_ LIMIT - Default message count limit for history.
- ERROR_
LOG_ BUFFER_ SIZE_ LIMIT_ BYTES - Maximum retained error-log payload bytes in the in-memory collector (10 MiB).
- MAX_
AGENT_ MESSAGES_ SIZE - Maximum size for single agent message payloads (bytes) - 4 MB.
- MAX_
ALL_ MESSAGES_ SIZE - Maximum size for entire message history payloads (bytes) - 24 MB.
- MAX_
LINE_ LENGTH - Maximum size per line (bytes) - 256 KB. Prevents OOM on malformed output with very long lines.
- MAX_
MESSAGE_ LIMIT - Maximum message count limit.
- TINY_
PREVIEW_ BYPASS_ BYTES - Legacy small-preview threshold retained for API compatibility. Per-result limiting no longer needs a separate verifier reserve.
- TURN_
PREVIEW_ BUDGET_ BYTES - Maximum fallback preview size for one execution result (64 KiB). Historical names are retained for API compatibility; these are per-result limits, never an aggregate allowance. History compaction bounds accumulated context without disabling tools or hiding subsequent evidence.
- TURN_
PREVIEW_ BUDGET_ BYTES_ PLANNING - Maximum fallback preview size for one planning result (96 KiB).
- TURN_
TINY_ PREVIEW_ BUDGET_ BYTES - Legacy verifier reserve retained for API compatibility; no longer enforced.
Functions§
- turn_
preview_ budget_ bytes - Effective per-result preview limit for the active workflow mode.