mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-06 16:04:24 +00:00
computeGeminiTextDelta returned seen+incoming for each incremental chunk, so a long thinking, text or tool-argument block copied its whole prefix per chunk and grew quadratically. Keep the emitted text in a strings.Builder per block. Only storage changes: the cumulative, duplicate/rewind and delta decisions and the returned deltas are identical, verified against the previous implementation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>