replay: a sentence that finishes after a mid-sentence tool call splits live but not after a reload

Open
#9,370 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript

Research direction

Read the implementation of postToolSplit, the live continuation split, and the replay layout that uses splits: [{at, toolUseId}] on response history entries; the issue also points to PR #9024 and rule #4999. Trace when a later streamed delta accepts a sentence boundary and compare that with the recorded tool offsets. Done means replay splits at the same boundary as live without restoring the duplication or loss cases from #9024.

Written by the indexing model from the issue text.

Description

bug from-review priority: low

Summary

After #9024, a reload lays a reply's text out around its tool cards using the split points the server records at each tool_start (splits: [{at, toolUseId}] on the response history entry). The layout applies the same sentence rule (postToolSplit, #4999) that the live continuation split uses, but it evaluates the rule only at the recorded tool offsets.

Live, the rule is re-checked on every later delta while a tool card sits below the reply's bubble. So in a turn that streams "Let me", then calls a tool, then streams " finish." and " Next.", live renders "Let me finish." above the card and " Next." below it. After a reload, all of "Let me finish. Next." renders above the card. The text is complete and appears once; only where it splits differs from live.

Desired

A replayed reply splits where the live client split it, including a split that the sentence rule accepted on a delta after a mid-sentence tool call. One option: the server records the first sentence-ending delta boundary after a rejected split point, so the client can split there. The fix must keep the live and replay layouts on the one shared rule and must not reintroduce the #9024 duplication or loss cases.

Source

Codex review finding 5 and reviewer A on the #9024 PR (accepted limitation).

Dominant language
JavaScript
Stars
7
Forks
1
Avg merge
2h 3m
Merged PRs (30d)
333

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blamechris/chroxy

All issues in blamechris/chroxy

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.