test(chatview): 锁定 Hub 围栏代码渲染合同(#1971) - #1980
Merged
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
DeliciousBuding
force-pushed
the
fix/fenced-code-render
branch
from
August 25, 2026 08:01
bc79e6d to
742598b
Compare
Co-authored-by: Codex <codex@vectorcontrol.tech>
DeliciousBuding
force-pushed
the
fix/fenced-code-render
branch
from
August 25, 2026 08:14
742598b to
cbe62cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根因结论
#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 通过),并以四层回归测试锁定合同,防止任何一层未来回退。测试层级
Markdown.test.tsx基线:fenced 内容经 react-markdown 渲染出代码块且围栏标记被消费。UserMessage.rendering.test.tsx/AgentGroup.rendering.test.tsx:human/agent 两种 sender 的围栏文本渲染为代码块容器(行为断言,非快照)。pipeline-integration.test.ts:snake_case REST 消息经normalizeHubMessagesToTranscript→blocksToTranscriptItems后围栏结构保留。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 passedpnpm --filter @agenthub/shared typecheck/pnpm --filter agenthub-web typecheck— passedpnpm exec playwright test --project=chromium web-stubbed-hub-fenced-code.spec.ts— 1 passedpython scripts/verify/verify-ci-gates.py— okreal_tested=false:本轮为 L0-L2 合同锁定,未新增 L3 真实栈证据;建议后续在远程 dev 服务器复跑 ui-verify 的chat-codeblock项做真实复验(若复验仍失败则重开本 issue 并追查 live 路径)。Closes #1971