Cap customer messages at 2000 characters

main
No checks reported

Commit

Jaxson Sprinkles1mo ago

run_agent now truncates messages longer than MAX_MESSAGE_CHARS (2000) before sending them to the model, and emits a WARNING-level JSON log line (event "message_truncated") with the original and max lengths. The message text itself is never logged. The warning shows at the default log level and is silenced at LOG_LEVEL=ERROR or above.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Entire-Checkpoint: 01M4KJK6EVYNM9SCKB1ETM0ZNJ