Files
PaperClipAI/packages/paperclip-runner/devtools/browser/playwright.config.ts
T
DottaandClaude Opus 5 cda1fb03ab fix(runner): preserve phase 4b request terminal and goal semantics
Five protocol corrections from the CTO review of the Phase 4b work.

Canonical runtime request outcome. The real driver emitted `resolution`
while the scripted driver and browser read `action`, so a real resolved
card reported an unknown outcome. `harnessRuntimeRequestOutcome` is now
the one payload every driver emits for a terminal `runtime_request.*`
fact, carrying `requestId`, `requestKind`, `turnId`, and `itemId` in the
payload as well as the event binding.

Decoded request identities. Path segments are split before they are
decoded, so a percent-encoded reserved character stays inside the segment
the browser meant it for; malformed encoding fails with 400.

Resolution shapes validated by request kind.
`parseHarnessRuntimeRequestResolution` requires `answers` for a
`user_input` submit and `content` for an elicitation submit, and rejects
a mismatched body instead of accepting it as an empty response. Both
drivers and the browser transport run it, and the request card now sends
elicitation answers as `content`.

One terminal fact per reconnect. The demo server snapshots after the
close rather than before it, so requests the close already cancelled are
not replayed into the driver's stale-request recovery path and reported
terminal a second time. Reading afterwards also carries the closing
events' source sequence into the resumed session.

Goal support retired only on a provider denial. A transport or protocol
failure during `thread/goal/get` said nothing about what the build
supports but still set `goals: false`. `CodexRpcError` now carries the
JSON-RPC code, and the capability is retired only when the provider
answers that it will not serve the method.

Three defects surfaced while verifying the above are fixed here too: a
same-origin `EventSource` GET sends no `Origin`, so requiring one on
`/stream` rejected the console's own subscription and no live-console
test could connect; the browser payload redactor covered only
`.paperclip` paths and leaked the app-server's `~/.codex/memories`; and
the browser suite shares one server across 19 sessions against an
interactive cap of 16, now sized through `PAPERCLIP_PHASE4B_MAX_SESSIONS`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 06:04:03 +00:00

30 lines
963 B
TypeScript

import { defineConfig } from "@playwright/test";
export default defineConfig({
testDir: ".",
testMatch: ["static-replay.spec.ts", "live-console.spec.ts"],
fullyParallel: false,
workers: 1,
reporter: "line",
use: {
baseURL: "http://127.0.0.1:4179",
viewport: { width: 1440, height: 1000 },
},
webServer: {
command:
"pnpm exec vite preview --config vite.config.ts --host 127.0.0.1 --port 4179",
env: {
// Keep streamed chunks slow enough that interrupt races are reachable
// from a test, and fast enough that the suite stays quick.
PAPERCLIP_PHASE4B_CHUNK_DELAY_MS: "60",
// One server serves the whole suite, and every test leaves its session
// behind when its page closes, so the interactive default of 16 is
// exhausted partway through.
PAPERCLIP_PHASE4B_MAX_SESSIONS: "64",
},
url: "http://127.0.0.1:4179",
reuseExistingServer: false,
timeout: 30_000,
},
});