zmuxuny opened a new pull request, #7113:
URL: https://github.com/apache/rocketmq-dashboard/pull/7113

   ### Which Issue(s) This PR Fixes
   
   Fixes #7109
   
   ### Brief Description
   
   Reopening a running conversation loads its persisted assistant prefix and 
attaches after the loaded cursor. Rendering those two halves as separate 
answers breaks Markdown at the cursor and leaves a tool's original card Running 
beside a second completed card with unavailable arguments.
   
   - Carry the owning run id into persisted assistant bubbles and through the 
live transcript props.
   - Continue only the matching unfinished run: coalesce adjacent text and 
same-source thinking, and reconcile an orphaned live tool result with its 
persisted start while retaining the arguments.
   - Preserve other runs, genuinely new tool starts (including reused call 
ids), and terminal history. A continuation does not count as an extra unread 
answer.
   
   The stream hooks, attach request, replay cursor, backend protocol, and 
dependencies are unchanged.
   
   ### How Did You Test This Change?
   
   Two real routed AiPage regressions fail against the original production 
code: a split code fence renders two text blocks, and a tool result renders two 
cards instead of completing the original. Both use the real timeline/stream 
hooks and renderers with controlled API responses.
   
   Additional controls cover:
   
   - Every attach boundary in six live/replay scenarios, with immutable 
prefix/suffix inputs.
   - Matching tool errors followed by success, preserving arguments and 
clearing the old error.
   - Reused tool ids within and across runs, unidentified/different live runs, 
and terminal-history isolation.
   - The final run-finished/refetch handoff: an observer of committed DOM 
changes continues to see exactly one text block.
   - No extra unread message or forced scrolling for the same answer's 
continuation.
   
   From `web/`, on the final tree:
   
   ```sh
   npx vitest run src/pages/ai --pool=threads --maxWorkers=1
   # 22 files, 290 tests passed
   npx tsc -b
   
   files=(
     src/pages/ai/__tests__/AiPage.test.tsx
     src/pages/ai/components/BubbleList.tsx
     src/pages/ai/components/ChatThread.tsx
     src/pages/ai/components/__tests__/ChatThread.test.tsx
     src/pages/ai/hooks/useConversationTimeline.test.ts
     src/pages/ai/index.tsx
     src/pages/ai/render/blocks.ts
     src/pages/ai/render/equivalence.test.ts
     src/pages/ai/render/foldTimeline.ts
   )
   npx eslint "${files[@]}"
   npx prettier --check "${files[@]}"
   git diff --check
   ```
   
   All checks passed. The final AiPage test file was also copied unchanged into 
a separate baseline worktree at `127c47b06a268cc74224d5f34c56ec7c36ac0d55`; 
running `npx vitest run src/pages/ai/__tests__/AiPage.test.tsx --pool=threads 
--maxWorkers=1 -t 'continuesAttachedMarkdown|completesAnAttachedTool'` there 
produces the same two expected failures (expected one text block/tool card, 
received two).
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits
   - [x] Added regression tests use `...Test` names
   - [x] No new UI strings or source files; existing ASF headers retained
   - [x] Independent production diff review completed
   - [ ] Backend architecture suite (`mvn test`), not run for this 
frontend-only change
   
   AI assistance was used to investigate the reconnect rendering boundary, 
implement the fix and regressions, review the diff, and execute the checks. No 
live provider or cluster was contacted.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to