Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,118 changes: 191 additions & 927 deletions .aoci/baseline.json

Large diffs are not rendered by default.

31 changes: 26 additions & 5 deletions .github/workflows/webui-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
webui:
name: WebUI (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 40
timeout-minutes: ${{ matrix.os == 'macos-latest' && 60 || 40 }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -64,22 +64,42 @@ jobs:
id: browsers
run: pnpm install:webui-browsers
- name: Install FFmpeg
id: ffmpeg
timeout-minutes: 8
shell: bash
run: |
# The native Design media paths run FFmpeg for real: the tests cut a
# real clip, draw a real waveform and persist a real poster. Without
# the binary on PATH they fail on `spawnSync ffmpeg ENOENT` rather
# than on anything about the code under test. The Linux image ships
# one already; the macOS and Windows images do not.
if command -v ffmpeg >/dev/null 2>&1; then
echo "ffmpeg is already present: $(ffmpeg -version | head -1)"
verify_ffmpeg() {
node -e 'require("node:child_process").execFileSync("ffmpeg", ["-version"], { stdio: "inherit" })'
}
if verify_ffmpeg; then
exit 0
elif [ "$RUNNER_OS" = "Linux" ]; then
sudo apt-get update
sudo apt-get install -y ffmpeg
elif [ "$RUNNER_OS" = "macOS" ]; then
brew install ffmpeg
else
choco install ffmpeg -y --no-progress
# Use the Gyan build linked from ffmpeg.org/download.html.
ffmpeg_build="ffmpeg-9.0.2-essentials_build"
ffmpeg_dir="$(mktemp -d "$(cygpath -u "$RUNNER_TEMP")/webui-ffmpeg.XXXXXX")"
archive="$ffmpeg_dir/$ffmpeg_build.zip"
curl --fail --location --retry 3 --retry-max-time 240 --max-time 90 \
--output "$archive" \
"https://github.com/GyanD/codexffmpeg/releases/download/9.0.2/$ffmpeg_build.zip"
echo "60f467265b1e312373dbcd92200c2618a74850f98d3d078e94296bb3fa2047ba $archive" | sha256sum --check
unzip -q "$archive" -d "$ffmpeg_dir"
ffmpeg_bin="$ffmpeg_dir/$ffmpeg_build/bin"
export PATH="$ffmpeg_bin:$PATH"
cygpath -w "$ffmpeg_bin" >> "$GITHUB_PATH"
fi
if ! verify_ffmpeg; then
echo "::error::FFmpeg is unavailable to Node after installation"
exit 1
fi
- name: Install Chromium system dependencies
if: runner.os == 'Linux'
Expand All @@ -89,9 +109,10 @@ jobs:
WEBUI_BROWSER_OUTPUT_DIR: ${{ runner.temp }}/webui-browser-diagnostics/units
run: pnpm test:webui
- name: Test WebUI browser interactions
timeout-minutes: 30
env:
WEBUI_BROWSER_OUTPUT_DIR: ${{ runner.temp }}/webui-browser-diagnostics/browser
if: ${{ !cancelled() && steps.build.outcome == 'success' && steps.browsers.outcome == 'success' }}
if: ${{ !cancelled() && steps.build.outcome == 'success' && steps.browsers.outcome == 'success' && steps.ffmpeg.outcome == 'success' }}
run: pnpm test:webui-browser
- name: Verify WebUI package installation
env:
Expand Down
16 changes: 8 additions & 8 deletions aoci.code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ README_ZH.md[SG4S]: F:Explains MiniMax Code installation, source builds from mai
SECURITY.md[SG4T]: F:Defines security reporting and source, account, and managed-service boundaries. | R:- | A:- | S:-
THIRD_PARTY_NOTICES.md[SG4T]: F:Preserves third-party license and attribution notices, including AI Node Canvas. | R:- | A:- | S:-
package.json[FV5T]: F:Declares workspace dependencies and root scripts for builds, releases, and verification. | R:- | A:- | S:-
playwright.config.mjs[SE4T]: F:Configures Playwright projects and the browser test server. | R:- | A:- | S:-
playwright.config.mjs[FQ4T]: F:Configures WebUI browser gates, fixture server, font environment and output directories. | R:code:packages/webui/test/browser/server.mjs | A:- | S:The Windows workaround replaces the pinned disabled-features switch to retain Playwright defaults.
pnpm-workspace.yaml[SE4T]: F:Declares pnpm workspace package roots. | R:- | A:- | S:-
tsconfig.node.json[SE4T]: F:Configures TypeScript for Node-side code. | R:- | A:- | S:-
tsconfig.standalone.json[SE4L]: F:Configures standalone TypeScript checking and workspace path aliases. | R:- | A:- | S:-
Expand Down Expand Up @@ -109,7 +109,7 @@ sync-issue-to-feishu.yml[FV4M]: F:Defines legacy Feishu notification for eligibl
webui-npm-preview.yml[FV4S]: F:Defines legacy npm preview package verification for the WebUI branch. | R:- | A:- | S:-

===/<repository>/.github/workflows/===
webui-ci.yml[FV4S]: F:Runs WebUI checks on Linux, macOS and Windows for main pushes, pull requests and manual dispatch. | R:code:packages/webui/package.json,code:.github/workflows/update-visual-baselines.yml | A:- | S:Main runs may finish while a newer run waits. Native Design media tests require a real ffmpeg binary.
webui-ci.yml[FV4S]: F:Runs WebUI checks on Linux, macOS and Windows for main pushes, pull requests and manual dispatch. | R:code:packages/webui/package.json,code:.github/workflows/update-visual-baselines.yml | A:- | S:Windows pins and verifies the FFmpeg ZIP, and Node validates it before tests. Separate deadlines preserve artifact upload time.
update-visual-baselines.yml[FV4S]: F:Re-records the per-platform Playwright visual baselines of the named WebUI browser specs on the three CI runners and commits each runner's own pixels. | R:code:.github/workflows/webui-ci.yml | A:- | S:The refresh selects the browser mode the CI compares with — windowed Chromium on macOS — in a step of its own, because a step cannot read back the environment file it writes.

===/<repository>/.plan/browser-use/board/===
Expand Down Expand Up @@ -209,7 +209,7 @@ source-sync.md[SG4T]: F:Defines generation, review, and application of upstream
telemetry.md[SO4T]: F:Documents telemetry controls and the fields sent with usage events. | R:- | A:- | S:-
tui-capabilities.md[SU4M]: F:Catalogues supported TUI behavior including output speed, terminal titles, and notifications. | R:- | A:- | S:-
verification.md[SQ4S]: F:Records repository verification activities and outcomes by date and change. | R:- | A:- | S:-
webui-ci.md[SV4T]: F:Documents active WebUI CI, archived workflows, platform baselines and the manual npm release checklist. | R:code:.github/workflows/webui-ci.yml,code:release/webui-npm/package.json | A:- | S:Verify the exact release directory built with the Chrome store public key.
webui-ci.md[SV4S]: F:Documents WebUI CI coverage, time budgets, diagnostics and manual npm release. | R:code:.github/workflows/webui-ci.yml,code:playwright.config.mjs | A:- | S:Windows tests on Playwright 1.63.0 backport the Chromium TCP port-randomization fix.

===/<repository>/docs/community/===
groups.md[SG4T]: F:Describes community support groups and the public entry point for participation. | R:- | A:- | S:-
Expand Down Expand Up @@ -5418,7 +5418,7 @@ provider-audio.mjs[SE4T]: F:Defines supported audio extensions and prepares prov
provider-upload.mjs[SE4M]: F:Creates the media uploader used by Design providers. | R:- | A:- | S:-
store.d.mts[SE4T]: F:Declares the Design canvas store and normalization interfaces. | R:- | A:- | S:-
store.mjs[PD7L]: F:Normalizes and persists the Design canvas documents, their revisions and their conflicts. | R:code:packages/webui/src/runtime/design/atomic-file.mjs | A:- | S:Every document is written atomically through the retrying helper, and a save based on an older revision is refused as a conflict instead of merged.
templates.ts[SE4T]: F:Reads and saves Design templates. | R:- | A:- | S:-
templates.ts[SE4T]: F:Reads, saves and removes stored Design templates. | R:code:packages/webui/src/runtime/design/design-service.ts | A:- | S:Listing skips templates deleted during the scan and still rejects malformed or non-regular entries.
understand-media.mjs[SE4S]: F:Implements media understanding with configurable limits and tiers. | R:- | A:- | S:-
video-request.mjs[SE4S]: F:Builds video requests for frame and collection input modes. | R:- | A:- | S:-
voices.ts[SE4T]: F:Reads the voices available to native Design. | R:- | A:- | S:-
Expand Down Expand Up @@ -5665,7 +5665,7 @@ tools.mjs[LB6L]: F:Holds the pure Design rules: how a batch is laid out, where t
===/<repository>/packages/webui/test/browser/===
README.md[SE4T]: F:Documents the WebUI browser test suite. | R:- | A:- | S:-
acceptance-record.ts[SE4M]: F:Defines acceptance observations for browser workflow evidence. | R:- | A:- | S:-
account-login.spec.mjs[TU4M]: F:Tests the account login and the subscription display in the browser, including the hover that refreshes the quota. | R:- | A:- | S:The hover's first request is awaited before the requests are counted, so a count read while that request was still on its way does not blame the hover loop.
account-login.spec.mjs[TU4M]: F:Tests account login and subscription quota rendering in the built WebUI. | R:code:packages/webui/src/client/features/account/ui/UserMenu.tsx | A:- | S:The hover test controls the browser clock on both sides of the close grace period so runner input latency cannot reopen the panel.
api-key-feedback.spec.mjs[SE4M]: F:Tests presentation of API key connection feedback. | R:- | A:- | S:-
application-observation.spec.mjs[SE4T]: F:Tests application observation and stale presenter results. | R:- | A:- | S:-
application-performance.mjs[SE4S]: F:Defines application performance measurement thresholds and helpers. | R:- | A:- | S:-
Expand All @@ -5682,7 +5682,7 @@ feedback.spec.mjs[SE4S]: F:Tests accessible field error feedback. | R:- | A:- |
field-contract.spec.mjs[SE4S]: F:Tests that form controls have accessible names. | R:- | A:- | S:-
fixture.mjs[SE4L]: F:Installs the browser fixture transport. | R:- | A:- | S:-
goal-retention.spec.mjs[SE4S]: F:Tests retention of session goal state during a pending refresh. | R:- | A:- | S:-
harness.mjs[SE4M]: F:Provides browser test harness exports and setup. | R:- | A:- | S:-
harness.mjs[TQ4M]: F:Provides built-client browser fixtures, readiness checks and failure artifacts. | R:code:playwright.config.mjs | A:openApp, waitForLocalImages | S:Windows buffer errors trigger a bounded TCP-state census. Image evidence omits URL query parameters.
miniapp-panel.spec.mjs[SE4L]: F:Tests Mini App launcher refresh behavior. | R:- | A:- | S:-
miniapp-standalone-tab.spec.mjs[SE4S]: F:Tests promotion of inline Mini Apps to standalone tabs. | R:- | A:- | S:-
model-picker-interactions.spec.mjs[SE4M]: F:Tests model picker interactions and display of the selected model. | R:- | A:- | S:-
Expand Down Expand Up @@ -5801,7 +5801,7 @@ prepare-source-sync.mjs[SE4S]: F:Prepares an incoming public source synchronizat
publish-cli-release.mjs[SE4T]: F:Publishes CLI release artifacts. | R:- | A:- | S:-
release-cli.mjs[SE4T]: F:Coordinates the CLI release workflow. | R:- | A:- | S:-
run-vitest-suite.mjs[SE4T]: F:Runs a named declared Vitest suite. | R:- | A:- | S:-
run-webui-server.mjs[SE4M]: F:Starts the WebUI server for local verification. | R:- | A:- | S:-
run-webui-server.mjs[EV4M]: F:Boots the WebUI development service, browser bridge and Mini App proxy, and coordinates shutdown. | R:code:packages/webui/src/server/service.ts | A:WEBUI_STARTUP_DIAGNOSTICS | S:Opt-in startup phase labels omit credentials and child output.
source-candidate.mjs[SE4T]: F:Validates an incoming source candidate. | R:- | A:- | S:-
source-inventory.mjs[SE4M]: F:Generates and checks the public source inventory. | R:- | A:- | S:-
verify-cli-release.mjs[SE4T]: F:Verifies packaged CLI release artifacts. | R:- | A:- | S:-
Expand Down Expand Up @@ -5860,7 +5860,7 @@ network-deny.mjs[SE4T]: F:Provides test helpers that deny network access. | R:-
offline-environment.mjs[SE4T]: F:Prepares an offline environment for verification. | R:- | A:- | S:-
public-artifact.test.mjs[SE4T]: F:Checks the contents and contracts of public artifacts. | R:- | A:- | S:-
smoke.test.mjs[SE4M]: F:Runs smoke checks for the public distribution. | R:- | A:- | S:-
source-sync.test.mjs[TV6L]: F:Tests source synchronization, public CI policies and release tooling. | R:code:scripts/lib/acceptance-records.mjs,code:.github/workflows/webui-ci.yml | A:- | S:The public workflow contract permits only WebUI checks and named provisioning steps, protects active main runs from cancellation, and prevents the baseline refresh from publishing.
source-sync.test.mjs[TV6L]: F:Tests source synchronization, public CI policies and release tooling. | R:code:scripts/lib/acceptance-records.mjs,code:.github/workflows/webui-ci.yml | A:- | S:WebUI CI verifies the pinned FFmpeg download before extraction and requires FFmpeg for browser tests. Main runs are protected and artifact time is reserved.
vitest-suites.json[FQ6L]: F:Declares the Vitest files every verification suite runs, per group. | R:- | A:- | S:A new Vitest file is registered in its group here; the Vitest config and the package scripts read this file instead of naming files themselves.
windows-contract.test.mjs[SE4S]: F:Tests Windows-specific distribution and runtime contracts. | R:- | A:- | S:-

Expand Down
14 changes: 14 additions & 0 deletions docs/webui-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ After a successful build and Chromium installation, browser checks still run if
unit tests fail. Package verification also runs after a successful build even if
an earlier test suite failed. Each failure still makes the job fail; this keeps
independent failures visible in one run instead of masking later suites.
The macOS job has a 60-minute budget because its unit and windowed browser
steps can consume the previous 40-minute job budget together. The browser step
has its own 30-minute limit so a stalled test run can still leave artifacts.
The development-server shutdown integration test reports bounded startup
phase timings on timeout or early exit. It omits child output, including the
credential printed by the launcher.
Linux additionally installs Chromium system dependencies. Every platform runs
the browser and package suites. This coverage declaration
does not establish a passing run; platform and visual-baseline failures remain
Expand All @@ -50,6 +56,14 @@ Linux, Windows and local runs remain headless by default. To reproduce
the macOS CI browser mode locally, run `WEBUI_BROWSER_HEADED=1 pnpm test:webui-browser`
after building the client and installing Chromium.

With Playwright 1.63.0, the Windows test browser disables
`TcpPortRandomizationWin` using the fix from
[Playwright #43605](https://github.com/microsoft/playwright/pull/43605).
This addresses intermittent `ERR_NO_BUFFER_SPACE` on local test requests.
It preserves the original disabled-feature list and does not change
production Chromium launches. If that error still occurs, the harness
attaches aggregate TCP state counts to the affected test.

## Active and archived workflows

Two workflows are active in `.github/workflows/`: `webui-ci.yml`, the gate above,
Expand Down
14 changes: 11 additions & 3 deletions packages/webui/src/runtime/design/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ export async function readDesignTemplates(dataDir: string): Promise<DesignTempla
if (!entry.endsWith(".json")) continue;
identifier(entry.slice(0, -5));
const file = path.join(directory, entry);
const info = await lstat(file);
if (!info.isFile() || info.isSymbolicLink()) throw new Error("Design template must be a regular file");
const template = JSON.parse(await readFile(file, "utf8")) as DesignTemplate;
let contents: string;
try {
const info = await lstat(file);
if (!info.isFile() || info.isSymbolicLink()) throw new Error("Design template must be a regular file");
contents = await readFile(file, "utf8");
} catch (error) {
// Another request can remove a template after readdir listed it.
if ((error as NodeJS.ErrnoException).code === "ENOENT") continue;
throw error;
}
const template = JSON.parse(contents) as DesignTemplate;
const error = templateStepsError(template.actions);
if (error) throw new Error(`Invalid stored Design template ${entry}: ${error}`);
own.push({ ...template, id: entry.slice(0, -5), own: true });
Expand Down
27 changes: 14 additions & 13 deletions packages/webui/test/browser/account-login.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,25 @@ test.beforeEach(async ({ page }) => {

for (const theme of ["light", "dark"]) {
test(`usage hover keeps the subscription label stable during refresh (${theme})`, async ({ page }) => {
await page.clock.install();
await page.addInitScript((value) => window.localStorage.setItem("webui-theme", value), theme);
await configureFixture(page, () => window.__fixture.setUsageQuotaResult({ signedIn: true, hasTokenPlan: true, tokenPlanTier: "Explore" }));
await openApp(page);
const trigger = page.getByTestId("sidebar-user-menu-trigger");
const usageRequestCount = () =>
page.evaluate(() => window.__fixture.requests.filter((r) => r.operation === "getUsageQuota").length);
await expect(trigger.locator("small")).toHaveText("Explore");
const requestsAtStartup = await usageRequestCount();
await trigger.click();
const usage = page.getByTestId("user-menu-usage");
await usage.hover();
await expect(trigger.locator("small")).toHaveText("Explore");
await expect.poll(usageRequestCount).toBeGreaterThan(requestsAtStartup);
await expect(page.getByTestId("usage-popover-content")).toBeVisible();
await trigger.evaluate((element) => {
window.__railLabelChanges = [];
new MutationObserver(() => window.__railLabelChanges.push(element.querySelector("small")?.textContent ?? null)).observe(element, { childList: true, subtree: true, characterData: true });
});
// The first hover asks for the quota, and the answer is counted only
// once it has arrived: a count read while that request is still on its
// way reports one request too few, and the case blames the hover loop
// for a request the hover itself made.
await expect
.poll(
() => page.evaluate(() => window.__fixture.requests.filter((r) => r.operation === "getUsageQuota").length),
{ timeout: 10_000 },
)
.toBeGreaterThan(0);
const requestsBefore = await page.evaluate(() => window.__fixture.requests.filter((r) => r.operation === "getUsageQuota").length);
const requestsBefore = await usageRequestCount();
const points = await page.evaluate(() => {
const center = (testId) => {
const element = document.querySelector(`[data-testid="${testId}"]`);
Expand All @@ -67,13 +63,18 @@ test(`usage hover keeps the subscription label stable during refresh (${theme})`
};
return { settings: center("user-menu-settings"), usage: center("user-menu-usage") };
});
// Test a return within the hover grace period independently of runner latency.
await page.clock.pauseAt(await page.evaluate(() => Date.now() + 1_000));
for (let index = 0; index < 12; index += 1) {
await page.mouse.move(points.settings.x, points.settings.y);
await page.clock.runFor(40);
await page.mouse.move(points.usage.x, points.usage.y);
}
expect(await page.evaluate(() => window.__fixture.requests.filter((r) => r.operation === "getUsageQuota").length)).toBe(requestsBefore);
expect(await usageRequestCount()).toBe(requestsBefore);
expect(await page.evaluate(() => window.__railLabelChanges.filter((label) => label !== "Explore"))).toEqual([]);
await page.mouse.move(700, 150);
await page.clock.runFor(250);
await page.clock.resume();
await expect(page.getByTestId("usage-popover")).toHaveCount(0);
await page.evaluate(() => window.__fixture.delayEvery("getUsageQuota", {}));
await usage.hover();
Expand Down
Loading
Loading