agents: preserve indexed Pydantic text replacements - #966
Conversation
|
Warning Review limit reached
Next review available in: 54 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (41)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffa659a17c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- namespace part indexes per model-request node stream in iter mode so a post-tool response cannot replace already-spoken text and silence the turn - allocate fresh parts for v1 one-arg graph events (stream boundaries are undetectable there) sharing one run-scoped counter with v2 streams - reconstruct fallback transcripts with part semantics so TEXT_REPLACE journal records are honored by debugger and bundle tooling - update the shared wiring test helper for the new replacement cutoff field - clear playback suppression when a spoken application turn is admitted - refresh the perf benchmark baseline hook, turn-commit and complexity ratchets, and the journal record catalog snapshot Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Problem
PR #961 restored initial PydanticAI
TextPartcontent, but the bridge stillnormalized every part start as an append-only
text_deltaand discardedPartStartEvent.index. PydanticAI may emit another start for the same index asa replacement, so consumers could retain stale text or append duplicate text.
What changed
AgentBridgeEventwith indexed text events and atext_replacekindsame-index starts and graph-local index namespaces
and voice consumers so transcripts and history preserve replacement semantics
AgentDeltaand journal recordsis admitted, cancel and clear stale playback and suppress further TTS for the
turn while allowing the corrected transcript and history to complete
buffering, playback cutoff, graph streams, and consumer history
Impact
Ordinary unindexed
text_deltastreams remain append-only. Indexed bridges mustuse indexed deltas consistently within a turn. A divergent replacement after
TTS admission fails closed instead of replaying corrected text over speech the
caller may already have heard.
Verification
368 passedacross the focused bridge, PydanticAI, stage, session consumer,event, and lifecycle suites
just guard-contracts(218 passed).venv/bin/ruff check src tests.venv/bin/ruff format --check src tests.venv/bin/mypy src/easycat(289 source files)Follow-up to #961.