Found while investigating billion-context-pi #336 (PR #225, closed).
Bug: rewriteCompressText/parseCallText in src/hide-consumed.ts JSON.parse the compress tool-call text starting at index 0. When the adapter message carries a leading metadata tag (pi appends <acp ...>mNNNNN</acp> tags to message text), the parse fails, the call is treated as unparseable, and live compress anchors keep their full summary args forever — the summary text is duplicated in every request (measured 21.6K tokens of duplicated args in session 01a07b3c).
Fix: locate the JSON by scanning for the first { before parsing (as done in the closed PR #225). Independent of any reasoning feature — worth shipping on its own.
Found while investigating billion-context-pi #336 (PR #225, closed).
Bug:
rewriteCompressText/parseCallTextin src/hide-consumed.ts JSON.parse the compress tool-call text starting at index 0. When the adapter message carries a leading metadata tag (pi appends<acp ...>mNNNNN</acp>tags to message text), the parse fails, the call is treated as unparseable, and live compress anchors keep their full summary args forever — the summary text is duplicated in every request (measured 21.6K tokens of duplicated args in session 01a07b3c).Fix: locate the JSON by scanning for the first
{before parsing (as done in the closed PR #225). Independent of any reasoning feature — worth shipping on its own.