Skip to content

test(chatview): 锁定 Hub 围栏代码渲染合同(#1971) - #1980

Merged
DeliciousBuding merged 1 commit into
masterfrom
fix/fenced-code-render
Aug 25, 2026
Merged

test(chatview): 锁定 Hub 围栏代码渲染合同(#1971)#1980
DeliciousBuding merged 1 commit into
masterfrom
fix/fenced-code-render

Conversation

@DeliciousBuding

Copy link
Copy Markdown
Collaborator

根因结论

#1971 的失败证据(2026-08-25 真实栈,results-final2.json)采集于 #1978 合并之前。根因与 #1972 同源:Web 会话激活门禁只匹配 session.id,而真实 REST /client/sessions 只携带 session_id,导致历史消息查询未启用——transcript 只能呈现 live runtime 事件/乐观更新的片段(截图里 agent 消息只剩前言气泡、partner 的围栏消息整体缺失)。#1978 已修复门禁与附件透传。

本 PR 在当前 master(80a8fb9)上用真实 REST 形状(snake_case session_id + jsonb {"text": "...fences..."})复验:围栏代码在 Web transcript 正常渲染为代码块(stubbed-hub E2E 通过),并以四层回归测试锁定合同,防止任何一层未来回退。

测试层级

  1. Markdown.test.tsx 基线:fenced 内容经 react-markdown 渲染出代码块且围栏标记被消费。
  2. UserMessage.rendering.test.tsx / AgentGroup.rendering.test.tsx:human/agent 两种 sender 的围栏文本渲染为代码块容器(行为断言,非快照)。
  3. pipeline-integration.test.ts:snake_case REST 消息经 normalizeHubMessagesToTranscriptblocksToTranscriptItems 后围栏结构保留。
  4. web-stubbed-hub-fenced-code.spec.ts(新增,接入 test:e2e:stubbed-hub 门禁):真实形状历史消息在真实 Web app 里渲染出 codeBlockWrapper 代码块,human + agent 双 sender。

不影响纯文本/route_decision/diagnostic 渲染:既有 chatview/transcript/ui 目录 87 文件 1445 测试全绿。无新增用户文案,i18n 不涉及。

验证(独立 worktree 依赖,串行)

  • pnpm exec vitest run shared/src/ui shared/src/chatview shared/src/transcript --no-file-parallelism --maxWorkers=1 — 87 files / 1445 passed
  • pnpm --filter @agenthub/shared typecheck / pnpm --filter agenthub-web typecheck — passed
  • pnpm exec playwright test --project=chromium web-stubbed-hub-fenced-code.spec.ts — 1 passed
  • python scripts/verify/verify-ci-gates.py — ok

real_tested=false:本轮为 L0-L2 合同锁定,未新增 L3 真实栈证据;建议后续在远程 dev 服务器复跑 ui-verify 的 chat-codeblock 项做真实复验(若复验仍失败则重开本 issue 并追查 live 路径)。

Closes #1971

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 408db451-fa96-4ba3-b65b-91f49a05be49

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: Codex <codex@vectorcontrol.tech>
@DeliciousBuding
DeliciousBuding merged commit fb4cab0 into master Aug 25, 2026
40 checks passed
@DeliciousBuding
DeliciousBuding deleted the fix/fenced-code-render branch August 25, 2026 08:22
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.

fix(chatview): Agent 回复中的 fenced 代码块在 Web transcript 不渲染

1 participant