Repository navigation
feat(managed): Add live message paging to WebShell - #15865
Conversation
Read bounded current SQL messages for initial and older Managed pages, resume SSE from projection coverage, and export live bodies. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
Current status: see the bilingual R1 addendum below for the pushed fix, independent incremental verification and source-labelled CI results. The original cf7a checkpoint is retained verbatim, including its then-pending gates. 当前状态请见文末R1双语补充:包含已推送修复、独立增量验证及准确来源CI结果。原cf7a检查点(含当时待验门禁)逐字保留。 Independent test-engineer report for
The test engineer imported actual source and edited no product code. Captured source inputs stayed stable during execution and all1153 protected preview compiled assets stayed byte-identical. Builds ran in a separate copy, not the user's5196 preview directory. The last test-only formatting correction has identical non-whitespace TypeScript tokens. API formatting corrections preserve parsed JSON and the generated types exactly. No local Java preparation/version/compilation/Maven/javac/Checkstyle/SpotBugs or Java test ran. The original shared budget remains CLOSED564.787/600 with35.213 forbidden; the separate preview compile/start budget remains CLOSED315.129/600 and authorized0tests. Neither was reused or reset. Eleven source regression cases are shared by H2 and the new real-MySQL test class, with an additional HTTP/API contract extension. Their compilation and runtime result are NOT_RUN locally / PENDING final-head CI. A prior JAR, old-head test or successful TypeScript check does not establish them. Real connected browser/model testing and Windows/Linux local acceptance were NOT_RUN. The oldce2 preview/JAR/H2 database remained untouched and does not demonstrate this feature. New SQL checks must validate actual checkout/tree, read-only MySQL transactions, scope/generation and byte/resource guards before acceptance. 中文说明独立test-engineer报告对应
test-engineer导入实际源码,未编辑产品代码。执行期间捕获的源码输入稳定,1153项受保护预览编译资产逐字未变。构建在独立副本执行,不在用户5196预览目录。最后仅测试排版的改动具有完全相同的非空白TypeScript词法token;API排版修正保留相同解析JSON及生成类型。 本地没有执行任何Java准备/版本检查/编译/Maven/javac/Checkstyle/SpotBugs或Java测试。原共享预算仍为CLOSED564.787/600、35.213禁用;独立预览编译启动预算仍为CLOSED315.129/600,授权测试为0。两项均未复用或重置。11项源码回归由H2与新增真实MySQL测试类共享,另扩展HTTP/API契约测试。编译和运行结果均为本地NOT_RUN/待最终head CI,旧JAR、旧head测试或TypeScript通过不能替代。 未执行真实浏览器/模型连接测试及Windows/Linux本地验收。原ce2预览、JAR和H2数据库保持不变,不展示本功能。新增SQL必须核实实际checkout/tree、MySQL只读事务、scope/代次和字节/资源守卫的有效CI结果,才能完成验收。 R1 addendum: ca8970bThe original cf7a report above is retained verbatim as its initial checkpoint. This addendum supersedes its pending-CI and two-budget statements only with the following source-labelled facts. R1 independently reproduced one Managed smoke failure plus both stale selector failures and four malformed-coverage Provider failures. The fix passes all10 Managed progress scenarios plus the two exact upstream-selector targets (12PASS,0retry/targetskip), the complete changed Provider100PASS and six actual Java-provider hook targets. The other119 hook tests were filtered as unaffected. Existing335-case/frontend and five DOM evidence above remains historical and source-scoped, not a newly repeated whole suite. The original CI smoke12FAIL/3flaky/396PASS is retained. Incremental build36.698s/template1.175s/typecheck14.637s and bundle2.947s pass; the first bundle attempt failed because the private copy omitted an unchanged generated-ui output, then passed after copying that unchanged prerequisite. No product source, timeout or assertion was changed to mask that failure. Scoped lint/format/diff checks and two root/two independent incremental audits pass. The old visuals job had0steps and an explicit cancellation by @yiliang114; it was not rerun. The independent reproduction/verification recorded3 original E2E RED targets (one Managed scenario and two selector cases), plus4 new malformed-coverage unit RED cases; only those were observed before the fix, not all10 Managed scenarios. The after run executes all12 intended E2E targets once. The malformed coverage tests also require exactly one HTTP fetch and preserve the existing positive zero/partial coverage cases. Completed cf7a MySQL job123467700015: actual full checkout cf7a0ed; H2 paging11, real-MySQL paging11, API contract23 and surface4 all zero failures/errors/skips. Unit/H2 totals5978/0failure/0error/19skip; real profile1245/0/0/0; packaging3/0/0/0. Complete log14794890bytes/SHA2565bf9a8e3fd943b5c41964874d7d77cfca42848225fc98e420af6614ee0eb87da. The1379 Java/SDK/POM/workflow/lock/manifest inputs match the new R1 head; these Java slices carry only by unchanged inputs, not as actual new-head execution or whole-workflow acceptance. The parent full run remains11success/1Hostedfault running. SQL IDs are VARBINARY(512) encoded as UTF-8, so their order is raw bytes, not text collation; MySQL ASCII ties and frontend Unicode/case evidence are separate. No original failed result is erased, and no old mixed-code smoke or maintainer-canceled visuals job was rerun. New-head smoke CI and connected real-SQL browser/live-export/model acceptance remain pending/NOT_RUN. Static clean is not whole-PR approval. All three Java budgets remain CLOSED564.787/600,315.129/600,348.204/600; both preview compile/start allowances authorized0tests and no remainder is reused. Preview5197 is still the cf7a394-source compiled JAR (SHA2568ec2f5267520f452bc7c0b5bde912472570f6af773b4e5f773932d4ba6913753), readinessUP/front200 only; it is not new-head or query/model acceptance. Preview5196 and both data directories are unchanged. R1中文说明上方原cf7a报告逐字保留,代表初始检查点;本段仅以下述准确来源事实替代其待CI及两项预算的旧状态。 R1独立复现一项Managed Smoke失败、两项旧选择器失败及四项非法覆盖Provider失败。修后全部10项Managed progress和两项上游选择器目标通过(12PASS、0重试/目标跳过),完整受改Provider100PASS,六项实际Java-provider hook目标通过;其余119个hook用例作为未受影响目标过滤。上述既有335前端及五项DOM证据保持原历史来源,不是本轮重复全跑。原CI Smoke的12FAIL/3flaky/396PASS保留。增量构建36.698秒/模板1.175秒/类型检查14.637秒和bundle2.947秒通过;首轮bundle因独立副本遗漏未变generated-ui产物失败,补拷该未变输入后通过,未改产品源码/超时/断言掩盖失败。增量lint/format/diff检查及根/独立各两轮增量审阅通过。旧visuals job为0steps且annotation明确@yiliang114取消,未重跑。 独立修前真实观察为3项原E2E RED(1项Managed及2项选择器)与4项新增非法覆盖单元RED,未把全部10项Managed说成修前均复跑。修后精确执行12项E2E一次;非法覆盖同时断言仅一次HTTP读取,合法零/部分覆盖的既有正例保持。 完整cf7a MySQL job123467700015的实际checkout为cf7a0edf37d390a58db00901a397286023ce62f5:H2分页11、真实MySQL分页11、API契约23、surface4均零failure/error/skip。总unit/H2为5978/0failure/0error/19skip,真实profile1245/0/0/0,packaging3/0/0/0。完整日志14794890字节,SHA256为5bf9a8e3fd943b5c41964874d7d77cfca42848225fc98e420af6614ee0eb87da。1379项Java/SDK/POM/workflow/lock/manifest输入与R1新head一致,只按未变输入复用这些切片,不冒充新head实际执行或完整workflow通过;父run仍11success/1Hostedfault运行中。SQL身份是UTF-8编码的VARBINARY(512),按原始字节而非文本collation排序;真实MySQL ASCII并列与前端Unicode/大小写验证分别留档。 原失败不删除,旧混合代码失败Smoke和维护者取消visuals未重跑。新head Smoke CI待验,真实SQL浏览器/实时导出/模型连通验收NOT_RUN;静态clean不等于全PR批准。三个Java额度保持CLOSED564.787/600、315.129/600、348.204/600,两次预览编译启动授权测试为0,余量不复用。5197仍运行cf7a的394源码编译JAR,SHA256为8ec2f5267520f452bc7c0b5bde912472570f6af773b4e5f773932d4ba6913753,仅证明readinessUP/前门200,不是新head或查询/模型验收。5196与两个数据目录保持不变。 |
|
Thanks for the PR — this reads as the natural completion of the bounded-read work that landed in #15839 a few hours ago. Template ✓ — every required heading is present, and the design doc is linked in both languages with matching decisions and acceptance criteria. Problem. Real, not theoretical. The snapshot-backed bounded read from #15839 cannot serve a Session that has never published a snapshot, and selecting the newest snapshot still misses everything committed after it. That is a concrete gap in a feature that merged today, not a hypothetical. There is no user-facing reproduction, which is the right shape for a Direction. Aligned. Managed WebShell is in-repo surface, and this lifts the "reconstruct and retain the whole conversation" requirement off the initial load. Upstream's CHANGELOG has no direct analogue (this is server-side infrastructure rather than a CLI feature), but its adjacent entries about bounding transcript reads for very large sessions point the same way. Size. Cross-package ( Approach. One question worth answering before the code review. This leaves two parallel history read paths in the tree — the published-snapshot view and the new live-messages view — with snapshot removal explicitly deferred. The frontend consequently carries three separate mechanisms to stop them double-rendering (the per-Item coverage map, Related, and it turns out to matter: Risk. No elevated signals — none of the changed files match the revert-correlated high-risk paths. Moving on to code review. 🔍 中文说明感谢贡献!这个 PR 看起来是几小时前 #15839 合入的有界读取工作的自然收尾。 模板 ✓ —— 所有必需标题齐全,设计文档中英文双语链接完整,决策与验收标准一致。 问题。 真实存在,不是理论性的。#15839 基于快照的有界读取无法服务从未发布快照的 Session,而选择最新快照仍然会遗漏其后提交的所有消息。这是今天刚合入功能的具体缺口,不是假设。没有面向用户的复现,这对 方向。 对齐。Managed WebShell 是仓库内的产品面,这次改动把「重建并常驻完整会话」的要求从首屏加载中移除。上游 CHANGELOG 没有直接对应项(这是服务端基础设施,不是 CLI 功能),但其中关于超大会话限制 transcript 读取的相邻条目指向同一方向。 规模。 跨包改动( 方案。 有一个问题值得在进入代码审查前先回答。这次改动让仓库里同时存在两条平行的历史读取路径 —— 已发布快照视图和新的实时消息视图 —— 且快照子系统的移除被明确推迟。因此前端需要三套独立机制来防止重复渲染(逐 Item 覆盖表、 相关的一点,而且事后证明确实要紧: 风险。 无升级风险信号 —— 改动文件均未命中与回滚相关的高风险路径。 进入代码审查 🔍 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
Code reviewBlocking: 10 of the 12 hard failures are in
Nothing in this PR touches Two ways to fix, and I would take the second:
Non-blocking.
The handoff this PR introduces, and where it currently breaks: sequenceDiagram
participant P1 as WebShell UI
participant P2 as useManagedSession
participant P3 as Java Provider
participant P4 as Managed Agent Server
participant P5 as SQL ma_message
P1->>P2: open Session
P2->>P3: readTranscript (limit 100)
P3->>P4: POST transcript query (view messages)
P4->>P5: keyset page, newest 100 Items
P5-->>P4: Items plus covered sequence
P4-->>P3: items, events, coveredSequence
Note over P3,P2: lastEventId = coveredSequence (changed here)
P3-->>P2: transcript page
P2->>P4: POST events stream (afterSequence = lastEventId)
P4-->>P2: live events above the projection
Files changed (22 of 22 shown)
CI on the reviewed commit at review time. The finalize job refreshes this region once the remaining legs settle.
TestingThis is an unattended CI run, so no PR code was built or executed here — the evidence below is the PR's own CI, read through the API for the reviewed commit. One required check is red: The Java legs that did finish are green across the board, including Still open at review time, and these matter more than usual for this diff:
Not verified, and why: the new paging SQL against real MySQL (leg still running); the live-export path end to end against a running server (no connected browser/database acceptance exists — the PR body says so itself, which I am recording as the author's own statement, not as evidence); and the scroll/anchor behaviour, which the DOM tests exercise against mocked rows rather than a real browser. Sandboxed verification would settle the part static review cannot: No local real-scenario testing was driven — this run is unattended CI, where PR code is never executed. 中文说明代码审查阻塞项: 12 个硬失败中有 10 个在
本 PR 没有改动 两种修法,我倾向第二种:
非阻塞项。
测试本次为无人值守 CI 运行,因此没有构建或执行任何 PR 代码 —— 以下证据是通过 API 读取的、该 PR 自身在所审 commit 上的 CI 结果。 有一个必需检查是红的: 已完成的 Java leg 全绿,包括 审查时仍未结束的部分,对这个 diff 而言比平常更要紧:
未验证项及原因:新分页 SQL 在真实 MySQL 上的行为(leg 仍在运行);live export 端到端对真实服务端的路径(不存在连通的浏览器/数据库验收 —— PR 正文自己也这么说,我在这里记录的是作者的陈述,不作为证据);以及滚动/锚点行为,DOM 测试用的是模拟行而非真实浏览器。 沙箱化验证可以解决静态审查解决不了的部分: 未驱动本地真实场景测试 —— 本次为无人值守 CI,绝不执行 PR 代码。 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
|
Confidence: 2/5 — the design and the server implementation are sound, but a required check is red with ten failures this PR caused, and the failure mode is a page that retries forever rather than a cosmetic assertion. Requesting changes. Stepping back: I asked in Stage 1 whether retiring the snapshot path was actually tracked, or whether this was quietly making two history subsystems permanent. It is tracked — #15870 ( My own baseline for this problem was essentially what the PR does: page the message table directly with a tenant/session keyset, opt in explicitly so existing clients keep snapshot semantics, and resume SSE at the sequence the page actually included. The server side matches or beats that — the metadata-only byte lookahead before bodies are fetched is a better shape than I would have written first, and running the whole paging suite against real MySQL by subclassing the H2 test is the right way to satisfy the module's evidence rule rather than a token gesture. Every change in the diff earns its place; there is no drive-by refactor or formatting churn, and both design docs are present as the repo requires. What stops me is that the change to the provider's resume point was not carried through to every fixture that serves a transcript response. Two unit-test mocks were updated in this same diff; the E2E mock daemon was not, and it has never returned There is also a sequencing cost worth naming: if this lands with the smoke suite red, #15870 inherits that red as its starting state, and telling the two PRs' breakage apart gets harder for whoever reviews it. Fixing the fixture here is cheaper than debugging it there. Two things I could not settle and would not want waived: the real-MySQL leg ( So: fix the fixture (or add the fallback), get the smoke suite green, let the MySQL leg finish, and I expect this to be a straightforward approve. The substance is good. 中文说明置信度:2/5 —— 设计和服务端实现都是可靠的,但有一个必需检查是红的,其中 10 个失败由本 PR 引起,且失败形态是页面无限重试而非表面的断言不匹配。因此请求修改。 退一步看:我在 Stage 1 问过,下线快照路径是否真有登记,还是这次改动在悄悄把两套历史子系统变成永久状态。答案是有的 —— #15870( 我自己对这个问题的基线方案,基本就是本 PR 的做法:用租户/会话 keyset 直接分页消息表,显式选择开启以让既有客户端保留快照语义,并在页面实际包含的序号处续接 SSE。服务端与我的方案相当甚至更好 —— 取正文之前先做仅元数据的字节预探,比我第一反应会写的形态更好;而通过继承 H2 测试让整套分页用例在真实 MySQL 上跑一遍,是满足本模块证据规则的正确做法,而不是象征性动作。diff 里每处改动都有其必要性,没有顺手重构或格式化噪声,两份设计文档也按仓库要求齐备。 让我停下来的是:provider 续传点的这次变更,没有同步到每一个提供 transcript 响应的夹具。同一份 diff 里两个单元测试 mock 都更新了,E2E mock daemon 没有 —— 而它从来没返回过 还有一个排序上的代价值得点明:如果本 PR 带着红的 smoke 套件合入,#15870 就会以这个红作为起始状态继承下去,届时对审阅者来说,要分清两个 PR 各自造成的破坏会更难。在这里修好夹具,比在那边调试便宜。 有两件事我无法定论,也不希望被放过:真实 MySQL 那条 leg( 所以:修好夹具(或加上兜底),让 smoke 套件转绿,等 MySQL leg 跑完,我预计这会是一次顺利的批准。实质内容是好的。 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
qwen-code-review-bot
left a comment
There was a problem hiding this comment.
@doudouOUC Requesting changes on one blocking item — the rest of the review is in my staged comments above.
web-shell E2E Smoke is red with 12 failures, and 10 of them are in web-shell.managed-progress.spec.ts, all dying in installManagedScenario. Switching the provider's resume point from transcript.lastSequence to transcript.coveredSequence invalidated the E2E mock daemon's /transcript/query reply, which has never included coveredSequence. lastEventId arrives undefined, the load loop spins on while (lastEventId === undefined), and the stream never reaches the sequence the fixture asserts on.
The two unit-test mocks were updated in this diff; the E2E fixture was not. I would prefer the provider-side fallback (transcript.coveredSequence ?? transcript.lastSequence — exactly equivalent in messages view, where the server sets both from page.coveredSequence()) over patching the fixture, since it also removes the silent spin.
Also unresolved rather than rejected: the real-MySQL leg was still running at review time, and it is the only evidence for the new keyset query and the tied-first_sequence ordering.
Design and server implementation look good to me — #15870 behind this answers the "two history paths" question I raised in Stage 1. Expect a straightforward approve once the smoke suite is green and the MySQL leg lands.
中文说明
@doudouOUC 因一项阻塞问题请求修改 —— 其余审查内容在上面的分阶段评论中。
web-shell E2E Smoke 是红的,12 个失败中有 10 个在 web-shell.managed-progress.spec.ts,全部死在 installManagedScenario。把 provider 的续传点从 transcript.lastSequence 改为 transcript.coveredSequence,使 E2E mock daemon 的 /transcript/query 响应失效 —— 它从来没有包含过 coveredSequence。lastEventId 变成 undefined,加载循环在 while (lastEventId === undefined) 上空转,事件流永远到不了夹具断言的序号。
本 diff 里两个单元测试 mock 都更新了,E2E 夹具没有。相比改夹具,我更倾向在 provider 侧兜底(transcript.coveredSequence ?? transcript.lastSequence —— 在 messages 视图下完全等价,服务端把两者都取自 page.coveredSequence()),因为它同时消掉了这个静默空转。
另有一项是未定论而非否定:审查时真实 MySQL 那条 leg 仍在运行,而它是新 keyset 查询和 first_sequence 相同排序的唯一证据。
设计和服务端实现我认为没问题 —— 后续的 #15870 回答了我在 Stage 1 提出的「两条历史路径」疑问。smoke 套件转绿、MySQL leg 落地后,预计可以顺利批准。
— Qwen Code · qwen3.8-max-2026-09-02
|
In response to Stage 1: snapshot retirement is tracked separately in #15870, with the module split in #15871; neither is pulled into this PR. Existing omitted-view defaults remain intact. Fixed in ca8970b: type-check the smoke transcript fixture and reject invalid coverage explicitly. I did not adopt the lastSequence fallback: when coverage is absent, the client cannot establish that another field certifies the projected prefix. Valid zero and partial coverage still resume at S, including when S is below H. 对应Stage 1:快照下线由#15870跟踪,模块拆分由#15871处理,本PR不纳入两项工作,省略view的默认契约保持。ca8970b84b96c6d3cc5f77fc43b577150a0944c8已给Smoke响应加类型检查,并显式拒绝无效覆盖序号;不采用lastSequence兜底,因为覆盖信息缺失时不能证明另一个字段代表已投影前缀。合法零值和部分覆盖仍从S续接,包括S小于H的情况。 |
|
In response to Stage 2: agreed on the fixture regression. Fixed in ca8970b, with the typed coveredSequence fixture plus explicit malformed-coverage rejection instead of an H fallback. The independent baseline trace actually recorded 3453 transcript queries,3459 session reads and zero SSE requests. After the fix all10 original Managed smoke scenarios and both separately reproduced selector cases pass once, without retries or changed timeouts; the selectors are the exact upstream #15860/4dc63d0023749b4546696a9c16cf26b68dd86673 fix. The changed Provider file passes100 cases and six actual Java-provider hook targets pass. New-head CI remains pending. The completed cf7a MySQL job123467700015/run40879717089 explicitly checked out cf7a: H2 paging11, real-MySQL paging11, API23 and surface4 all passed; totals5978 unit/H2 with19 skipped,1245 real-profile with0 skipped, packaging3, all zero failures/errors. SQL identities are VARBINARY(512), encoded as UTF-8 by ManagedSchemaKeys.identity; their ordering is raw bytes, not utf8mb4_bin text collation. Real-MySQL tied ASCII coverage and frontend Unicode/case tests are separate evidence; no connected real-SQL browser/export or MySQL Unicode/case execution is claimed. The1000 limit preserves the default snapshot API, with messages-only100 documented and enforced; conditional-schema refinement and annotation placement are deferred to keep this fix narrow. No guard/timeout is weakened. 对应Stage 2:确认夹具回归,ca8970b84b96c6d3cc5f77fc43b577150a0944c8已补齐并类型检查coveredSequence,同时对非法覆盖显式报错,不回退到H。独立修前trace实际为3453次历史查询、3459次会话读取、0次SSE。修后10项原Managed Smoke及两项独立复现的选择器目标全部一次通过,0重试且超时不变;选择器精确回移主干#15860的两行修复。完整Provider100项和六个实际Java-provider hook目标通过,新head CI仍待验。 cf7a的MySQL完整job已明确核实实际checkout:H2分页11、真实MySQL分页11、API23、surface4通过;总unit/H2为5978项/19跳过,真实profile1245项/0跳过,packaging3项,均零failure/error。SQL身份是UTF-8编码的VARBINARY(512),按字节排序,不使用utf8mb4_bin文本排序;真实MySQL并列ASCII与前端Unicode/大小写验证分别留档,不宣称真实SQL浏览器/导出或MySQL Unicode/大小写验收。默认快照API的1000上限保留,messages专属100已文档化并强制执行;条件schema细化及注解位置建议后置,不扩大此次修复。未削弱守卫或超时。 |
|
In response to Stage 3: fixed in ca8970b. The independent postfix run passes all12 original failing smoke targets with0 retries; malformed coverage is an explicit read error that follows existing backoff, while a typed fixture supplies its actual included sequence. The parent cf7a real-MySQL leg has now passed, with exact-checkout evidence in the updated original test report. The new push must still earn its own smoke CI result; Hosted faults and connected browser/live-export acceptance are not inferred from partial success. The formal CHANGES_REQUESTED review is left intact for reviewer reassessment. 对应Stage 3:ca8970b84b96c6d3cc5f77fc43b577150a0944c8已修复,独立修后12项原失败Smoke目标全部通过、0重试。非法覆盖进入既有读取失败/退避路径,类型化夹具提供实际包含的覆盖序号。父提交cf7a的真实MySQL leg已通过,准确checkout证据同步原独立报告。新提交仍须单独确认Smoke CI;Hosted故障及真实浏览器/实时导出连通验收不由部分通过推断。正式CHANGES_REQUESTED保留,等待审阅者重新判断。 |
|
R1 fixes pushed: ca8970b (parent cf7a0ed). This also responds to the CHANGES_REQUESTED review and Stages1–3; no review state was dismissed.
The old smoke result12FAIL/3flaky/396PASS is preserved. New-head smoke CI and the parent Hosted-fault gate remain pending; connected real-SQL browser/export/model acceptance is NOT_RUN. All three local Java allowances stay CLOSED, and both user previews5196/5197 stay on their original running builds/data. Incremental root and independent reviews each reached two clean passes; this is not whole-PR approval. R1修复已推送:ca8970b84b96c6d3cc5f77fc43b577150a0944c8,父提交cf7a0edf37d390a58db00901a397286023ce62f5;同时回应正式CHANGES_REQUESTED与Stage1–3,未撤销评审状态。
原Smoke结果12FAIL/3flaky/396PASS完整保留。新head Smoke CI和父提交Hosted故障门禁仍待完成,真实SQL浏览器/导出/模型连通验收NOT_RUN。三个本地Java额度保持CLOSED,用户5196/5197预览继续使用原构建与数据。根与独立审阅各两轮增量clean,不等于全PR批准。 |
|
Verdict: ✅ merge-ready — 18/18 scripted assertions passed at head
中文摘要结论:merge-ready(18/18 脚本化断言通过,head A/B 结论(见 04-ab-after-fix.png): 令对端省略 前一轮 finding 状态: 1 号(阻断)fixed,且新守卫两个条件各被 3–4 个用例钉住(移除整数校验 → 3 红,整段移除 → 4 红);2/3/4 号 suggestion stands,均为实测变异存活,不构成合并条件。 未覆盖: 浏览器 Playwright 在本机起不来(缺 Previous-finding status (round 1 at
|
| # | finding | severity | status at ca8970b8 |
evidence |
|---|---|---|---|---|
| 1 | transcript without coveredSequence spins the load loop and opens the stream at 0 |
blocking | fixed | 04-ab-after-fix.png: head now throws, spins=0; the fixture line is load-bearing (removing it re-breaks the condition) |
| 2 | the "delayed fragment" test is not carried by the projectedThrough gate it is named for |
suggestion | stands | 02-mutation-matrix.png M2 row |
| 3 | initial-page coverage map unpinned, and its window is narrower than it looks | suggestion | stands | M4 row still survives 125/125 |
| 4 | resync reset of itemPagesRef is unobservable |
suggestion | stands | M3 row still survives 125/125 |
I agree with the author's choice not to adopt the lastSequence fallback: substituting the event head for an absent coverage would assert a projected prefix nobody vouched for. Failing loudly is the stricter contract and it removes the spinner, which was the actual user-visible harm. The cost is that such a peer now gets a visible read error instead of a degraded page; since the PR already requires a matching Server, that is the right trade.
Central claim and A/B
The PR moves the WebShell history read from published snapshots to a direct page over ma_message, and with it moves the SSE resume point from transcript.lastSequence to transcript.coveredSequence. Instrument: the spec's own /transcript/query reply shape, driven through the real createJavaManagedAgentProvider, evaluating the spec's own poll condition streamCursors.includes(summary.lastSequence). Witnesses: 01-ab-resume-point.png (pre-fix head) and 04-ab-after-fix.png (current head).
| cell | arm | lastEventId |
read outcome | spins | spec condition | expected |
|---|---|---|---|---|---|---|
peer omits coveredSequence |
base 68f181b885 |
3 (lastSequence) |
ok | 0 | true |
pass ✅ |
peer omits coveredSequence |
head before cf7a0edf37 |
undefined |
ok | 3 (4 requests) | false |
red ✅ (control, as predicted) |
peer omits coveredSequence |
head ca8970b84b |
undefined |
throws Invalid message transcript coverage. |
0 | fails loudly | pass ✅ |
peer sends coveredSequence |
base / head | 3 / 3 |
ok | 0 | true |
pass ✅ |
| fixture line removed at head | ca8970b84b |
undefined |
throws | 0 | false |
pass ✅ (the fixture line is load-bearing) |
Findings
1. Blocking at cf7a0edf37 — FIXED at ca8970b84b
The provider now refuses a transcript whose coverage is missing, null, negative or fractional, and the E2E fixture supplies it under satisfies JavaAgentTranscript so the type check keeps it honest. Both halves are pinned:
- The guard's conditions are pinned one at a time. Removing the whole guard kills 4 tests; removing only the
Number.isSafeIntegerhalf kills 3 (missing, null, fractional) whilenegativestill passes — the author wrote one input per condition rather than one input violating two. - The fixture line is load-bearing. Deleting
coveredSequence: summary.lastSequencefrom the spec and re-running the provider probe restoresspecCondition=false, so the green depends on that line and not on something else.
I could not verify the claim that the 12 smoke targets now pass: browsers do not launch in this environment (see Not covered). That claim rests on the author's run and on the CI check at the new head.
2. Suggestion — the "delayed fragment" test is not carried by the gate it is named for
Removing the entire projectedThrough gate leaves ignores only delayed fragments already covered by an older Item page green. Its assertion happens to be satisfied by withoutReplacedItemEvents on the following loadOlder, so the test names a mechanism it does not pin.
3. Suggestion — the initial-page coverage map has no test
Instrumented at head (03-gate-decision.png): an assistant_delta for item old at id 12 sees cov: [["old",10]], projectedThrough: 10. So the write is observable in principle — but no committed test fails when it is removed (M4, 125/125 green). Note also that the hook drops every frame with id <= lastEventId before the gate runs, so the exclusion only bites for a frame above lastEventId whose item coverage sits below it.
4. Suggestion — the resync reset of itemPagesRef is unobservable
M3 survives 125/125 because the resync path re-enters snapshot() immediately and re-derives the flag. Not dead in principle, but nothing distinguishes it today.
Measured and fine
- WebShell changed surface at
ca8970b8: 322/322 across the four touched files (provider 100, session messages 79, export 18, hook 125). - Guard matrix at
ca8970b8: 2 pinned, 2 survived, in-file control red, baselines green before and after (02-mutation-matrix.png). - Server (H2) at
cf7a0edf37:ManagedMessagePagingTest11/11 andManagedAgentApiContractTest23/23, measured here in one invocation. The Java files are identical between the two heads (git diff cf7a0edf37..ca8970b84btouches only design docs and web-shell), so these carry over by input closure. The author's update agrees and adds the real-MySQL figures from that same job (real-MySQL paging 11, API surface 4, zero failures), which I did not reproduce. - The two non-managed smoke failures were real; the author backported the selector fix from
main(test(web-shell): follow the renamed workspace copy in two e2e specs #15860) instead of changing behaviour.
Not covered
- Browser E2E. Playwright cannot launch here:
chrome-headless-shell: error while loading shared libraries: libatk-1.0.so.0. Every browser-level statement is the spec's contract replayed through the real provider, not the spec executing. The A/A control is base, which passes the same replay. - Real MySQL leg. Not run: the local container route needs an interactive credential this round did not use. The author reports
cf7a's MySQL leg passed (run 40879717089: H2 paging 11 / real-MySQL paging 11 / API 23 / surface 4); I did not reproduce it, so tied-first_sequenceordering is evidenced on H2 only here. - Convergence on the
projectedThroughgate. Two of my synthetic probes disagreed with the author's scenario. I did not reach a clean account of the second, so Findings 2–3 rest on instrumented gate values and mutation results rather than end-to-end probes. Recorded as unreached, not resolved. - Java 11/17 matrix, hosted/fault gates, connected model acceptance — not run.
Methodology
Local maintainer round on the workstation. head-tree at ca8970b84b and base-tree at 68f181b885 (the PR's target tip), each with a real copy (cp -r; / and tmp/ are ext4 without reflink, so hardlinks would write through) of the root and per-package node_modules, with node_modules/@qwen-code/* re-pointed per arm — readlink -f and inode checks confirm independence. Both arms built with the repo's own root npm run build. Java verified with JDK 21 after installing sdk-java from this tree. Harnesses and raw logs live in harness/ and beside it (unit-*.log, mutations-new.log, java-paging-head.log, gate-instrumented.log).
Evidence images (assets branch assets/pr15865-validation)
A/B, before the fix — 01-ab-resume-point.png: the spec's own /transcript/query reply, driven through the real provider. Base resumes at 3 and satisfies the spec's poll; head cf7a0edf37 yields undefined, spins 3 extra requests, and records afterSequence = 0.
A/B, at ca8970b84b — 06-ab-after-fix.png: an omitted coverage now fails loudly with spins=0; a present one still resumes at 3 on both arms.
Mutation matrix at ca8970b84b — 05-mutation-matrix-ca8970b8.png: in-file control red, baselines green before and after, withoutReplacedItemEvents pinned, the projectedThrough gate and the initial coverage map unpinned, and the new coverage guard pinned condition by condition.
Instrumented gate at head — 03-gate-decision.png: a live assistant_delta for an item the page already covered arrives with cov: [["old",10]] and projectedThrough: 10, so the initial-site map is reachable — it simply has no test.
— DeepSeek-V4.1-Flash-1017@fda99a87 via Qwen Code /verify-pr (v0.26.4; skill 87f6e765e630)
yiliang114
left a comment
There was a problem hiding this comment.
LGTM. No P0/P1 findings — the implementation is well-structured with thorough cursor validation, byte-budget enforcement, CSI guard, consistent SQL/JS item ordering, and extensive tests across Java and TypeScript layers. Two minor non-blocking observations:
P2 (non-blocking): No formal fixes/closes/resolves #N linkage in the PR body — the PR references #15839 as "Follow-up to" and #13184 as "Related context," but neither is formally linked. Consider linking #15839 with Fixes or a closing note.
P2 (non-blocking): Three E2E files contain incidental selector/label corrections (Add Workspace → Add workspace, Project → Workspaces) unrelated to the message-paging feature. These are correct fixes but bundled scope drift — prefer separating UI-copy corrections from feature PRs in the future.
|
|
Released in v0.26.5. |




What this PR does
Managed WebShell reads the latest 100 materialized Items directly from SQL, including conversations without a published snapshot and messages newer than the last snapshot. Scrolling upward requests an older page; live messages continue through the existing event stream. Export reads these live pages with a finite membership range and allows bodies/statuses to change between pages.
The new behavior is explicitly selected by the Java Provider. Existing clients that omit the selection retain the snapshot/event defaults. The Provider rejects invalid projection coverage as a read failure rather than substituting the event head or spinning on an undefined resume position. The API contract advances from 1.96.0 to 1.97.0 and the WebShell types are regenerated. No new routes or database migrations are introduced.
Why it's needed
The bounded query API merged in #15839 reads published snapshots. Selecting the newest snapshot does not include later messages or support a Session that has never published one, and the existing Java WebShell bootstrap can still read a full snapshot. Direct message queries let the screen load a bounded recent page without reconstructing or retaining the complete conversation.
Reviewer Test Plan
How to verify
Use matching Server and WebShell builds in Managed mode with local H2 and Hosted MySQL. Check a Session without any published snapshot and one whose published snapshot is behind its message projection. Initial loading should return at most 100 Items, older pages should contain no repeated or skipped identities even when sequence numbers tie, and scrolling should preserve the visible anchor.
Continue a Turn while loading an older page in both event-arrival orders. Complete Item text and already-covered delayed stream fragments should appear once; later fragments and unrelated Items must remain visible. A stream-gap resync should reset the Item window and older cursor together. Test a projection behind the event head: the stream must resume from the projection's included sequence, preserving the unprojected tail. A projection below the retained event floor must return retryable 503 rather than skip events.
Export while the conversation continues. The operation should finish within its original membership range, may observe newer bodies/statuses for those Items, and should label the output as a live export. An initially lagging projection must return retryable 503. Verify cursor scope/direction/generation errors, actor/tenant isolation, private-CSI refusal, resource integrity, oversized-page admission, and unchanged omitted-selection snapshot behavior.
Evidence (Before & After)
Independent report: test-engineer evidence. Parent cf7a0ed SDK Java CI was requested once. Its completed MySQL job explicitly checked out that parent: H2 paging11, real-MySQL paging11, API contract23 and surface4 pass; totals5978 unit/H2 with19 skipped,1245 real-profile with0 skipped and packaging3, all zero failures/errors. The1379 Java/SDK/POM/workflow/lock/manifest inputs are unchanged by R1 at ca8970b; only these slices carry forward, not actual new-head execution or whole-workflow qualification. The parent Hosted-fault gate is still running; new-head smoke CI remains pending.
Before: two actual source-Provider HTTP-transport assertions failed on main because transcript/export requests did not select direct messages. Both pass after the change; six additional handoff checks pass, including a projection at sequence 40 with an event head of 400. These are injected transport probes, not server HTTP execution.
Independent review reproduced four real frontend failures: three tied-identity ordering variants and a delayed-SSE duplicate. After correction, the two affected files pass 204/204. At the initial cf7a checkpoint, the five-file inventory had335 distinct cases with passing evidence across incremental runs, plus five separate scroll/anchor DOM cases. Original failures and fixture corrections remain in the independent report. This is not a fresh 340-case full-suite run. The DOM tests use mocked rows and inspected parent/hook wiring; no connected real-browser/database acceptance or screenshots are claimed.
An isolated full TypeScript build passed before the review fixes. After the fixes, the affected WebShell/template builds, WebShell typecheck, four integration-workspace typechecks, integration-test typecheck and final bundle passed. The initial full typecheck failed because the isolated copy omitted four integration-local dependency directories and resolved Node 20 types instead of the original Node 22 types; after restoring the matching links, the affected checks passed. Scoped formatting/lint and API generation consistency pass. Root and independent reviews each reached two clean incremental passes.
R1 independently reproduced one Managed smoke failure plus both stale selector failures and four malformed-coverage Provider failures. The fix passes all10 Managed progress scenarios plus the two exact upstream-selector targets (12PASS,0retry/targetskip), the complete changed Provider100PASS and six actual Java-provider hook targets. The other119 hook tests were filtered as unaffected. Existing335-case/frontend and five DOM evidence above remains historical and source-scoped, not a newly repeated whole suite. The original CI smoke12FAIL/3flaky/396PASS is retained. Incremental build36.698s/template1.175s/typecheck14.637s and bundle2.947s pass; the first bundle attempt failed because the private copy omitted an unchanged generated-ui output, then passed after copying that unchanged prerequisite. No product source, timeout or assertion was changed to mask that failure. Scoped lint/format/diff checks and two root/two independent incremental audits pass. The old visuals job had0steps and an explicit cancellation by @yiliang114; it was not rerun.
Tested on
Environment (optional)
macOS, Node26.12.1, Vitest3.2.7 and the pinned Playwright Chromium runtime. Application builds and smoke ran in a fresh private copy; both user previews5196/5197, their JARs, served assets and H2 data remained untouched. Frontend smoke uses a real browser with mocked daemon/Java HTTP, while the SQL evidence comes separately from CI.
Risk & Scope
Design: English · 简体中文. Both versions include the same decisions, limits, acceptance criteria and deferred work.
Linked Issues
Follow-up to #15839. Related context: #13184; this PR does not close it.
中文说明
What this PR does
Managed WebShell直接从SQL读取最近100个已投影Item,覆盖尚未发布快照的会话和最后快照之后的新消息。向上滚动请求更早的一页,实时消息继续通过既有事件流接收。导出读取这些实时页面,固定有限成员范围,允许页间正文和状态更新。
Java Provider显式选择新行为;省略该选择的既有客户端保留快照/事件默认语义。Provider把非法投影覆盖视为读取失败,不以事件head兜底,也不在undefined续传位置上空转。API契约从1.96.0升至1.97.0,并重新生成WebShell类型。不新增路由或数据库迁移。
Why it's needed
#15839合入的有界查询API读取已发布快照。选择最新快照既不包含其后的消息,也不能覆盖从未发布快照的Session,而原Java WebShell首屏仍可能读取完整快照。直接查询消息可以有界加载最近一页,避免重建或常驻完整会话。
Reviewer Test Plan
How to verify
使用匹配的Server与WebShell构建,在本地H2和Hosted MySQL的Managed模式验证。检查完全没有已发布快照的Session,以及已发布快照落后于消息投影的Session。首屏应最多返回100个Item;即使序号相同,历史翻页也不能重复或遗漏身份;滚动加载应保持可见锚点。
在加载更早页面时继续执行Turn,并覆盖事件先到和页面先到两种顺序。完整Item文本及已被页面包含的延迟流帧只出现一次,更晚的流帧和无关Item仍须显示。事件流gap重同步应同时重置Item窗口和历史游标。验证投影落后于事件head时,事件流从页面实际包含的投影序号继续,保留未投影尾部;投影低于保留事件floor时,应明确返回可重试503,不能跳过事件。
持续对话时执行导出。导出应在原成员范围内结束,可以读取该范围Item更新后的正文/状态,并标注实时导出。首个请求若投影滞后,应返回可重试503。验证游标scope/方向/代次错误、actor/租户隔离、私有CSI拒绝、资源完整性、页面字节准入,以及省略选择时保持原快照行为。
Evidence (Before & After)
独立报告:test-engineer验证证据。父提交cf7a0edf37d390a58db00901a397286023ce62f5的SDK Java CI仅派发一次。其已完成MySQL job明确核实实际checkout为该父提交:H2分页11、真实MySQL分页11、API契约23及surface4通过;总unit/H2为5978项/19跳过,真实profile1245项/0跳过,packaging3项,均零failure/error。R1提交ca8970b84b96c6d3cc5f77fc43b577150a0944c8未改变1379项Java/SDK/POM/workflow/lock/manifest输入,只复用这些切片,不冒充新head执行或完整workflow资格。父提交Hosted故障门禁仍在运行,新head Smoke CI待验。
修前:在main上,通过实际源码Provider执行的两个HTTP传输注入断言失败,因为transcript/导出请求未选择直接消息读取。修后相同两项通过,另外六项交接检查通过,包括投影序号40而事件head为400的情况。这些是传输注入探针,不是服务端HTTP执行。
独立审阅复现四个真实前端失败:三个同序号身份排序变体和一个延迟SSE重复。修后完整两文件204/204通过。初始cf7a检查点的五文件335个不同用例通过增量执行及适用证据复用均有通过证据,另有五项滚动/锚点DOM测试通过。独立报告保留原失败和夹具修正;这不是重新全跑340项。DOM测试使用模拟行并另行审阅父页面/hook接线,不宣称已完成真实浏览器与数据库端到端验收,也不提供未经验证的截图。
独立目录中的完整TypeScript构建在审阅修复前通过。修复后,受影响WebShell/模板构建、WebShell类型检查、四个integration workspace类型检查、integration-tests类型检查及最终bundle通过。第一次完整类型检查失败,是因为隔离副本遗漏四处integration局部依赖目录,错误解析到Node 20类型而非原Node 22类型;恢复匹配链接后,受影响检查通过。增量格式/lint及API生成一致性检查通过。根代理和独立审阅均达到两轮增量clean。
R1独立复现一项Managed Smoke失败、两项旧选择器失败及四项非法覆盖Provider失败。修后全部10项Managed progress和两项上游选择器目标通过(12PASS、0重试/目标跳过),完整受改Provider100PASS,六项实际Java-provider hook目标通过;其余119个hook用例作为未受影响目标过滤。上述既有335前端及五项DOM证据保持原历史来源,不是本轮重复全跑。原CI Smoke的12FAIL/3flaky/396PASS保留。增量构建36.698秒/模板1.175秒/类型检查14.637秒和bundle2.947秒通过;首轮bundle因独立副本遗漏未变generated-ui产物失败,补拷该未变输入后通过,未改产品源码/超时/断言掩盖失败。增量lint/format/diff检查及根/独立各两轮增量审阅通过。旧visuals job为0steps且annotation明确@yiliang114取消,未重跑。
Tested on
Environment (optional)
macOS、Node26.12.1、Vitest3.2.7及固定的Playwright Chromium运行时。应用构建和Smoke在新的独立副本中执行,用户5196/5197两个预览、JAR、运行资产及H2数据均保持不变。前端Smoke使用真实浏览器与模拟daemon/Java HTTP,SQL证据另来自CI。
Risk & Scope
设计:English · 简体中文。两份设计均包含相同的决策、限制、验收标准和后置事项。
Linked Issues
#15839的后续工作。相关背景:#13184;本PR不关闭该issue。