fix(runs): disable playwright traces by default, bump to 1.16.1

- default PLAYWRIGHT_TRACE_MODE to off since traces often reach ~10 MB
  per run; traces can still be enabled per run or via the setting
This commit is contained in:
ars9 committed 2026-09-30 18:35:26 +03:00
1 parent ff83b6c7da
commit 84dba6d670
10 files changed
+40 -23

No files matched your search

+2 -1
View File
@@ -17,4 +17,5 @@ SESSION_IDLE_TIMEOUT_MINUTES=30
SESSION_DELETE_CLOSED_DAYS=7
# Playwright trace recording for scenario runs: on | retain-on-failure | off
PLAYWRIGHT_TRACE_MODE=on
# (traces often reach ~10 MB per run; can be overridden per run in the run modal)
PLAYWRIGHT_TRACE_MODE=off
+8
View File
@@ -2,6 +2,14 @@
All notable changes to this project will be documented in this file.
## 1.16.1 - 2026-09-30
Changes since 1.16.0:
### Changed
- Playwright traces are now off by default (`PLAYWRIGHT_TRACE_MODE` defaults to `off`), since a trace often reaches ~10 MB per run. Traces can still be enabled per run in the run modal, via `traceMode` in `POST /scenarios/:id/run`, or for all runs by setting `PLAYWRIGHT_TRACE_MODE`.
## 1.16.0 - 2026-09-30
Changes since 1.15.0:
@@ -82,7 +82,7 @@ export function ScenarioDetailPage() {
const [runVersions, setRunVersions] = useState<ScenarioVersion[]>([]);
// null = latest
const [runVersion, setRunVersion] = useState<number | null>(null);
const traceMode = traceModeOverride ?? runDefaults?.traceMode ?? 'on';
const traceMode = traceModeOverride ?? runDefaults?.traceMode ?? 'off';
const [envs, setEnvs] = useState<Environment[]>([]);
const [selectedEnvId, setSelectedEnvId] = useState('');
const envInitRef = useRef(false);
+1 -1
View File
@@ -56,7 +56,7 @@ export function ScenariosPage() {
const [runVersions, setRunVersions] = useState<ScenarioVersion[]>([]);
// null = latest
const [runVersion, setRunVersion] = useState<number | null>(null);
const traceMode = traceModeOverride ?? runDefaults?.traceMode ?? 'on';
const traceMode = traceModeOverride ?? runDefaults?.traceMode ?? 'off';
const [envs, setEnvs] = useState<Environment[]>([]);
const [selectedEnvId, setSelectedEnvId] = useState('');
+5 -3
View File
@@ -63,13 +63,15 @@ Exports hold exactly one version and always include its `version` number (the la
## Playwright traces
Each run records a [Playwright trace](https://playwright.dev/docs/trace-viewer) of its browser context (screenshots and DOM snapshots). When the run finishes, the trace is uploaded to the run's files as `trace.zip`. Download it from the run detail page, then open it with `npx playwright show-trace trace.zip` or at https://trace.playwright.dev.
A run can record a [Playwright trace](https://playwright.dev/docs/trace-viewer) of its browser context (screenshots and DOM snapshots). When the run finishes, the trace is uploaded to the run's files as `trace.zip`. Download it from the run detail page, then open it with `npx playwright show-trace trace.zip` or at https://trace.playwright.dev.
The trace mode is chosen per run: the run modal in the UI, the `traceMode` field of `POST /scenarios/:id/run`, and the `traceMode` argument of the `run_scenario` MCP tool all accept one of the values below. When it is omitted, the server's `PLAYWRIGHT_TRACE_MODE` setting is used (exposed via `GET /scenarios/run-defaults`). "Repeat run" reuses the original run's mode.
- `on` (default): keep the trace of every run
- `on`: keep the trace of every run
- `retain-on-failure`: keep traces only for runs that failed
- `off`: do not record traces
- `off` (default): do not record traces
Traces are off by default because they often reach ~10 MB per run.
Traces are run artifacts, so they expire after `FILE_RUN_EXPIRATION_DAYS` like other run files.
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "liqa",
"version": "1.16.0",
"version": "1.16.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "liqa",
"version": "1.16.0",
"version": "1.16.1",
"workspaces": [
"server",
"client"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "liqa",
"version": "1.16.0",
"version": "1.16.1",
"private": true,
"workspaces": [
"server",
+2 -1
View File
@@ -56,7 +56,8 @@ export class AppConfig {
FILE_CLEANUP_CRON: string = "0 3 * * *";
@IsEnum(TraceMode)
PLAYWRIGHT_TRACE_MODE: TraceMode = TraceMode.On;
// Off by default: traces with screenshots and snapshots easily reach ~10 MB per run
PLAYWRIGHT_TRACE_MODE: TraceMode = TraceMode.Off;
}
export function validateAppConfig(config: Record<string, unknown>): AppConfig {
+2 -6
View File
@@ -593,12 +593,8 @@ describe("McpController", () => {
total: number;
};
// The script's artifact plus the run's Playwright trace
expect(list.total).toBe(2);
expect(list.items.map((f) => f.name).sort()).toEqual([
"artifact.bin",
"trace.zip",
]);
// Traces are off by default, so the script's artifact is the only file
expect(list.total).toBe(1);
const artifact = list.items.find((f) => f.name === "artifact.bin")!;
expect(artifact.mimeType).toBe("application/octet-stream");
expect(artifact.expiresAt).not.toBeNull();
+16 -7
View File
@@ -111,14 +111,17 @@ describe("ScenarioSchedulerService Playwright traces", () => {
expect(await traceArtifacts(runId)).toHaveLength(0);
});
it("stores the configured default trace mode when none is given", async () => {
const runId = await runScenario("trace-default", "return 1;");
it("stores the configured default trace mode (off) when none is given", async () => {
const runId = await runScenario(
"trace-default",
"throw new Error('boom');",
);
const [row] = await dataSource.query(
`SELECT traceMode FROM scenario_runs WHERE id = ?`,
[runId],
);
expect(row.traceMode).toBe("on");
expect(await traceArtifacts(runId)).toHaveLength(1);
expect(row.traceMode).toBe("off");
expect(await traceArtifacts(runId)).toHaveLength(0);
});
it("falls back to the configured mode for runs without a stored trace mode", async () => {
@@ -128,7 +131,13 @@ describe("ScenarioSchedulerService Playwright traces", () => {
const env = await envRepo.save(
envRepo.create({ name: "trace-null-mode-env", data: {} }),
);
const run = await scenarioService.createRun(sc.id, env.id);
const run = await scenarioService.createRun(
sc.id,
env.id,
false,
TraceMode.On,
);
// Legacy runs have no stored mode; they must use the configured default (off)
await dataSource.query(
`UPDATE scenario_runs SET traceMode = NULL WHERE id = ?`,
[run.id],
@@ -141,7 +150,7 @@ describe("ScenarioSchedulerService Playwright traces", () => {
while (activeRuns.has(run.id) && Date.now() < deadline) {
await new Promise((r) => setTimeout(r, 20));
}
expect(await traceArtifacts(run.id)).toHaveLength(1);
expect(await traceArtifacts(run.id)).toHaveLength(0);
});
describe("HTTP", () => {
@@ -150,7 +159,7 @@ describe("ScenarioSchedulerService Playwright traces", () => {
"/scenarios/run-defaults",
);
expect(res.status).toBe(200);
expect(res.body).toEqual({ traceMode: "on" });
expect(res.body).toEqual({ traceMode: "off" });
});
it("POST /scenarios/:id/run stores the requested trace mode", async () => {