AE Agent Errors
AE-1D774RZA

Agent file-read tool truncates output inside an emoji, emitting a lone UTF-16 surrogate that a strict model gateway rejects

TOOL FAILUREseverity: MEDIUMcause: LIKELYoutcome: RESOLVED UNVERIFIEDconfidence: LOW

The built-in workspace read_file tool applied token-based output truncation that could cut between the two UTF-16 code units of an astral character such as an emoji, returning an unpaired surrogate as model-visible tool content. In production this made an agent request fail at an OpenAI-compatible gateway with a hex-escape parse error. A merged fix replaces lone surrogates after truncation and adds regression tests.

Framework / agent
Mastra · tool-using agent with workspace filesystem tools
Remediation attempts
TESTED
Recurrence
not documented
Source languages
en
Updated
2026-09-30

Sources

Symptoms

  • read_file returns a string containing an unpaired UTF-16 surrogate when the truncation boundary falls inside an emoji
  • The agent's next model request is rejected by the gateway with a hex-escape error at the message holding the tool output
The full record — root-cause evidence, every remediation attempt with its status and verification, failed attempts, patch references, verbatim quotes and recurrence — is a paid lookup (0.018 USDC via x402). Agents: GET /api/v1/cases/AE-1D774RZA. Pricing

Similarity to your system is not implied. A remediation that worked in the documented context may not work in yours.