Skip to content

fix(chat): replies before a mid-turn steer stay shown - #564

Open
vaakx-dev wants to merge 1 commit into
mainfrom
sand/transcript-reply-grouping
Open

vaakx-dev wants to merge 1 commit into
mainfrom
sand/transcript-reply-grouping

Conversation

@vaakx-dev

Copy link
Copy Markdown
Owner

A reply the agent wrote before a notification or steer arrived mid-turn now stays in the transcript instead of folding into the turn's "working" steps.

What

  • The turn fold treats every text that ends where a pinned item (a user message, steer or notification) comes next, or where the turn ends, as a reply. Before, only the turn's final text counted.
  • Tests cover a notification and a steer arriving after a reply, a notice between them, and narration followed by more work, which still folds.

Why

  • A notification that reaches a bot while its turn is still running joins that turn as a steer, so it doesn't start a new turn. The bot's reply before it was then the turn's middle text, and the fold hid it with the tool calls. It also lost its copy and menu buttons.
  • The same thing happened to any reply followed by a user steer.

Verification

  • bun test plugins/ui/chat/chat/test plugins/ui/chat/transcript: all pass. The two new reply cases fail on the old fold.
  • bunx tsc, vrui-check, scripts/deps.ts and scripts/comments.ts pass.

@github-actions

Copy link
Copy Markdown

Performance: ✅ every row is within its limit

Main f56922c against this PR 5050fea, both measured in the same job, medians of 5 runs. Times, memory and CPU fail when the PR is more than 15% worse, bytes when they grow more than 5%; changes under 20 ms or 2 KB never fail. Logs

main PR change
Phone (4× slower CPU, 150 ms, 9 Mbit/s link)
open a chat: shows 291 ms 298 ms +2.4% ✅
open a chat: usable 320 ms 308 ms -3.7% ✅
first visit with an empty cache: usable 1.97 s 1.96 s -0.6% ✅
open a long chat: usable 336 ms 302 ms -10.1% ✅
send: your message shows 61 ms 55 ms -9.8% ✅
send: first reply text shows 310 ms 301 ms -2.9% ✅
main thread blocked over these steps 735 ms 698 ms -5.0% ✅
data on first visit 928.5 KB 928.4 KB -0.0% ✅
data per chat opened 49.5 KB 49.5 KB -0.0% ✅
data while idle for 20 s 220 B 220 B 0% ✅
app code a phone downloads 1.6 MB 1.6 MB +0.0% ✅
Main pages (same phone and link)
Settings: time to open 78 ms 70 ms -9.6% ✅
Settings: data to open 0 B 0 B 0% ✅
Settings: data per minute left open 600 B 600 B 0% ✅
Add-ons: time to open 93 ms 94 ms +0.8% ✅
Add-ons: data to open 100 B 100 B 0% ✅
Add-ons: data per minute left open 600 B 600 B 0% ✅
Usage: time to open 67 ms 63 ms -5.9% ✅
Usage: data to open 16.4 KB 16.4 KB 0% ✅
Usage: data per minute left open 600 B 600 B 0% ✅
Search: time to open 70 ms 72 ms +3.6% ✅
Search: data to open 0 B 0 B 0% ✅
Search: data per minute left open 600 B 600 B 0% ✅
Performance: time to open 439 ms 439 ms -0.0% ✅
Performance: data to open 830 B 691 B -16.7% ✅
Performance: data per minute left open 1.9 KB 1.9 KB -2.4% ✅
PC side
start-up until ready 4.02 s 4.02 s -0.1% ✅
memory while idle 236.4 MB 236.9 MB +0.2% ✅
CPU used over 60 s idle 330 ms 310 ms -6.1% ✅
memory after 100 scripted chat turns 273.4 MB 273.4 MB -0.0% ✅
CPU for one reply 47 ms 46 ms -2.1% ✅
search time on 100k messages 101 ms 106 ms +5.5% ✅
database size per 10k messages 19.8 MB 19.8 MB +0.0% ✅
worktree list with sizes on 40 worktrees 788 ms 786 ms -0.2% ✅
slowest other reply during a worktree list 53 ms 56 ms +6.4% ✅

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant