mirror of
https://github.com/teamchong/pxpipe.git
synced 2026-07-22 02:02:51 +02:00
679757f3df
count_tokens validates structural pairing and rejects truncated prefix bodies that contain tool_use blocks whose tool_result was in the dropped tail, with: 'messages.<N>: tool_use ids were found without tool_result blocks'. That's been firing on ~15% of Opus 4.7 rows (75/503 last 7d) and excluding them from baseline_probe_status='ok'. Append a synthetic user message with minimal tool_result blocks for any orphan ids. Adds ~5-10 tokens per orphan (within ~1% of truth) and converts those rows from 'partial' to 'ok' so they contribute to honest savings rollups. Source: ocproxy daemon.log under OCPROXY_PIXELPIPE_DEBUG=1.