test(web-shell): remove fixed transcript bundle size ceiling (#14703)

Co-authored-by: 钉萁 <[email protected]>
This commit is contained in:
ytahdnand钉萁 authored and GitHub committed 2026-10-19 20:36:40 +08:00
1 parent fa1120ee5a
commit c7b2d6b685
2 files changed
+2 -58

No files matched your search

@@ -478,62 +478,6 @@ describe('build artifact — transcript entry (#11031)', () => {
expect(js).not.toContain('vaul');
});
it('keeps the transcript entry a fraction of the interactive entry', () => {
// The daemon hook runtime is NOT absent from this entry — MessageList
// renders McpStatusMessage, TasksStatusMessage and the artifact turn
// outputs, and those call the strict useDaemonActions /
// useDaemonWorkspace hooks, so the provider guards ship. Asserting their
// absence would assert something this entry does not deliver (see the
// docblock in client/transcript.ts and #11100).
//
// What the entry does deliver is a bounded payload, so bound it. The JS
// remainder measured 1,298,657 UTF-16 code units on main at fa4a4c92 and
// 1,300,341 here after adding author attribution for multi-agent
// transcripts. O3 result summaries bring it to 1,306,052, and
// session-agent replies (status, steps, token usage, squad labels) to
// 1,315,297 at e951f96; that rendering is intentional transcript UI.
// main grew the same entry in parallel — 1,309,207 at 1aba19c878, plus
// 3,033 for table fullscreen and Shadow DOM keyboard handling, reaching
// 1,312,240. Merging the two measures 1,320,366 in CI at d4304811. The W2
// managed cwd slice (#13760) adds its strings to the shared i18n table
// every entry ships — no interactive cwd code enters this graph — and
// measured 1,323,120 before main's host-status copy. After rebasing onto
// c34b8423, main measures 1,321,586 and this branch 1,324,022; substituting
// main's i18n table yields an identical JS remainder. The selection-copy
// menu strings (#13833) land in that same shared table — the menu itself
// stays stubbed out of this entry — and measure 1,325,251. The
// action-reminder help copy (#13832) entered that same table only after
// the 1,325,251 measurement was taken, so the entry was already past the
// 1,326,500 ceiling at that re-measure's own merge commit (#13964); the
// Managed task panel's copy (#13936) stays stubbed out of this entry.
// At 008c0de7 the remainder measures 1,327,531. The read-only Excel
// preview puts its ten excel.* strings into that same shared table in
// both locales; its parser, worker and markup stay inside the lazily
// imported SpreadsheetPreview chunk, so only the copy enters this graph.
// Merging 6212189f with this PR measures 1,330,011 UTF-16 code units.
// The 1,331,500 ceiling from main leaves 1,489 units of margin.
// File-tree mutation actions are excluded from the transcript build.
// At 31e02ace main measures 1,330,293; the read-only artifact hook with
// those actions excluded measures 1,330,497, below the same ceiling.
// Managed home, Workspace creation, approval and model/context copy also
// enter the shared table. With main 17d5f774 this branch measures
// 1,334,173 UTF-16 units; the unchanged 1,336,000 ceiling retains 1,827
// units of margin. Managed interactive code remains excluded here.
// Approval-policy copy (#14323) measures 1,336,282 at ebf1607d8f,
// versus 1,334,735 at its main parent 87de74860b. The 1,547-unit
// increase is shared i18n copy; substituting main's table restores the
// baseline. A 1,338,000 ceiling retains 1,718 units of margin.
// ReadFile hints, the shared detail loader and attachment recovery copy
// stay in this entry; interactive detail HTTP transport stays excluded.
// Keep the measured remainder below 1,341,000 UTF-16 units.
// Re-measure and lower it if the entry gets leaner.
const js = readTranscriptBundle().replace(
/^const __qwenWebShellCss=[^\n]*\n/,
'',
);
expect(js.length).toBeLessThan(1_341_000);
});
it('keeps Managed tool-detail transport out of the transcript entry', () => {
expect(readPackageJavascript()).toContain('/tool-details/get');
expect(readTranscriptBundle()).not.toContain('/tool-details/get');
+2 -2
View File
@@ -17,8 +17,8 @@
* renders `McpStatusMessage`, `TasksStatusMessage` and the artifact turn
* outputs, and those call the strict `useDaemonActions` / `useDaemonWorkspace`
* hooks, so their provider guards are in `dist/transcript.js`. Decoupling them
* is #11100. `client/build-artifact.test.ts` therefore bounds this entry's size
* rather than asserting a symbol is absent.
* is #11100. Artifact tests enforce specific package boundaries rather than
* asserting that the daemon runtime is absent.
*
* Do not rely on importing the package root or incidental tree shaking to
* keep this payload small; see