Agent-System-Frontend: review fixes for chat-process-split-r1 (symlink, live interleaving, artifact process) #18

Merged
weichen merged 6 commits from feature/chat-process-split-r1 into main 2026-09-30 16:15:20 +00:00
Owner

Review fixes for chat-process-split-r1: untrack node_modules symlink; per-turn live parts; tool-driven process marking.

Why: 642299d 误提交 node_modules 符号链接(指向本机绝对路径);liveToMessage 先文本后工具与落库穿插序不一致,多轮对账重排;解说要等下一桶才改标 process。
Evidence: 22a8723 untrack 符号链接并将 .gitignore 改为 node_modules(目录与链接同拦);754ce83 LiveState 改为到达序 items 流(纯函数),liveToMessage 与落库轮次穿插序同构,文本段 process 由段内工具判定(tool.call 一到即改标),折叠谓词 showProcessInline 可测,长回复摘要加 100 字摘句;合入 main(PR #15/#16)归一:保留 groupParts 原位分块与真实 callId,恢复 phase 驱动折叠;vitest 33/33、tsc 0 错、make test 退出码 0。
Impact: 流式不再跨轮重排/对账跳变;新克隆不含机器路径符号链接。残余:静默纯工具轮归属上一段(live.ts 注释)。Refs: feature/chat-process-split-r1 复审(2026-09-30)。

Review fixes for chat-process-split-r1: untrack node_modules symlink; per-turn live parts; tool-driven process marking. Why: 642299d 误提交 node_modules 符号链接(指向本机绝对路径);liveToMessage 先文本后工具与落库穿插序不一致,多轮对账重排;解说要等下一桶才改标 process。 Evidence: 22a8723 untrack 符号链接并将 .gitignore 改为 node_modules(目录与链接同拦);754ce83 LiveState 改为到达序 items 流(纯函数),liveToMessage 与落库轮次穿插序同构,文本段 process 由段内工具判定(tool.call 一到即改标),折叠谓词 showProcessInline 可测,长回复摘要加 100 字摘句;合入 main(PR #15/#16)归一:保留 groupParts 原位分块与真实 callId,恢复 phase 驱动折叠;vitest 33/33、tsc 0 错、make test 退出码 0。 Impact: 流式不再跨轮重排/对账跳变;新克隆不含机器路径符号链接。残余:静默纯工具轮归属上一段(live.ts 注释)。Refs: feature/chat-process-split-r1 复审(2026-09-30)。
weichen added 5 commits 2026-09-30 16:13:46 +00:00
Why: 流式期间思考/工具/中间轮解说与最终回复混排在中栏,用户难以扫读答复;参考 Cursor:回复开始输出时过程即时折叠,可手动展开回看。
Evidence: npx tsc --noEmit 通过;npx vitest run 20/20(新增 test/live.test.ts:分桶、除末桶外 process 标记、终态同构)。
Impact: LiveState.text 改为按 delta index 分桶的 texts;responding 阶段过程折叠、acting 重展开;终态新增 >800 字长回复折叠(CF0);无契约变更。
Refs: 任务卡 feature/chat-process-split-r1;配套 backend 提交 0e76f59(工具轮文本 process=true)。
Why: 642299d committed node_modules as a symlink pointing at the absolute
path /home/weichen/projects/Agent-System-Dev/modules/frontend/node_modules.
The .gitignore rule "node_modules/" only matches directories, not symlinks,
so the link slipped through and other clones would receive this machine's
path while normal installs get bypassed.

Evidence: git ls-tree HEAD node_modules => mode 120000 blob before this
commit; git check-ignore -v node_modules exits 0 with rule
".gitignore:2:node_modules" after unstaging the link.

Impact: fresh clones no longer carry a machine-specific symlink; local
installs work normally. No code changes.

Refs: code review of feature/chat-process-split-r1 (2026-09-30)
Why: liveToMessage emitted all text buckets then all tools, while the
persisted message interleaves per turn (thinking, text, calls), so parts
reordered on reconcile with 2+ tool turns. Commentary stayed in the reply
area until the next turn's text bucket appeared, because the process flag
was positional (i < length - 1) instead of tool-driven.

Evidence: LiveState now holds an arrival-ordered items stream
(thinking/text deltas merge into their last segment; tools land in place),
so event order - which matches the backend's per-turn append order - maps
1:1 onto persisted parts. A text segment is process iff a tool.call lands
before the next thinking/text segment, aligning with the backend's
Process: len(calls) > 0; the collapse predicate moved to testable
showProcessInline. Long replies (>800 chars) now show a 100-char excerpt
and label the count as Markdown source length. vitest 27/27 pass (was 5
live cases, now 12 incl. multi-turn order, immediate process marking,
collapse predicate); tsc -b clean.

Impact: streaming UI no longer reshuffles parts across turns or on final
reconcile; tool-turn commentary folds into the process area as soon as the
tool call arrives. Residual edge (documented in live.ts): a silent
tool-only turn with no text and no thinking attributes its call to the
previous text segment.

Refs: code review of feature/chat-process-split-r1 (2026-09-30)
Why: main advanced with PR #15/#16 (part-order preservation, artifact
downloads, cross-session UI); task-sync requires the branch to carry it.

Evidence: resolution keeps the arrival-ordered items stream from this
branch (tool-driven process marking, pure/testable logic in live.ts) and
adopts main's rendering and ids: groupParts in-place process blocks,
real tool callIds on live tool parts, messageparts utilities, and the
restored phase-driven showProcessInline predicate alongside the CF0
long-reply excerpt that main's rewrite had dropped. vitest 32/32
(includes main's messageparts suite and this branch's 12 live cases);
tsc -b clean.

Impact: single coherent live pipeline - items accumulate in event order,
liveToMessage projects Parts with tool-driven process marks, rendering
folds consecutive process blocks in place; responding still collapses
the process area (Cursor-style) as originally reviewed.

Refs: feature/chat-process-split-r1
Why: the merge commit left tsc broken in two spots - an artifact.created
handler still pushing to the removed LiveState.parts, and main's newer ui
icons not yet checked out in this worktree; also Part was imported unused.

Evidence: artifact.created now appends an artifact LiveItem (process=true,
matching the backend's ae8e5d0) projected to artifact_ref by
liveToMessage; new test asserts it lands after its tool call. tsc -b exit
0 after initializing the ui submodule checkout; vitest 33/33.

Impact: live artifact chips render inside the process stream and fold on
reconcile; no functional change elsewhere.

Refs: feature/chat-process-split-r1
weichen added 1 commit 2026-09-30 16:15:11 +00:00
weichen merged commit b067b57975 into main 2026-09-30 16:15:20 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Frontend#18