perf(agents): native reasoning delta fast path avoids O(n²) rescans (…

perf(agents): native reasoning delta fast path avoids O(n²) rescans (#123120)

Record append facts at native reasoning mutation owners and consume them only
while previous and current authoritative snapshots match. Reuse the existing
trim projector and one emission path, preserving queued snapshots, redaction,
whitespace, reentrant partial callbacks, and public event/SDK contracts.

Retire facts at block and stream completion so historical messages do not
retain an extra previous reasoning string. Remove the original index-only
accumulator and its separate emitted-length baseline.

The actual native producer-to-subscription fixture emits 4096 correct updates
without repeated prefix comparisons; the baseline compared 536739840 prefix
characters. Real Bedrock SDK decoder fixtures cover incremental replacement
and redaction before buffered events are consumed. Related: #112698 describes
the separate Codex runtime.

Co-authored-by: Robert <281851922+nierob-cmd@users.noreply.github.com>
Co-authored-by: root 
Co-authored-by: Peter Steinberger 
添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论