e65f6ace84
agent_log::format::format_log_entry_as_text was truncating long tool_result strings via the naive byte slice `&content_str[..500]`. When byte 500 fell inside a multi-byte UTF-8 codepoint (box-drawing chars like '─', smart quotes, emoji), the slice panicked, propagating up through the MCP get_agent_output dispatcher and surfacing as an internal-error response. This blocked any diagnostic readout of a coder's session that had emitted tool output containing those chars. Walk back to the nearest char boundary with `is_char_boundary` before slicing. Regression test asserts the formatter doesn't panic on a 599-byte string with a 3-byte '─' straddling byte 500. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>