Skip to content

fix(browser): stop 500ing every request on Node 24; update stale codex model test - #169

Merged
cryptolir merged 2 commits into
mainfrom
fix/ci-node-test-failures
Sep 29, 2026
Merged

cryptolir merged 2 commits into
mainfrom
fix/ci-node-test-failures

Conversation

@cryptolir

Copy link
Copy Markdown
Owner

Problem

checks (node, test) on main has 20 real test failures in 6 files. This is not the random heap OOM: each failure is printed. Seen on #168 (run 36471996299, job 109096808770), whose diff is only docker-compose.yml and STATUS.md. Main's own push CI never ran these tests, because check was red on STATUS.md formatting until #168.

Cause 1: a real code bug (19 failures, 5 files)

Files: src/browser/bridge-server.auth.test.ts, server.agent-contract-form-layout-act-commands.test.ts, server.agent-contract-snapshot-endpoints.test.ts, server.evaluate-disabled-does-not-block-storage.test.ts, server.post-tabs-open-profile-unknown-returns-404.test.ts.

Every request got HTTP 500 (an Express HTML error page, hence the "<!DOCTYPE "... is not valid JSON errors).

Node 24 added IncomingMessage#signal as a getter-only property. installBrowserCommonMiddleware did req.signal = ctrl.signal, which throws in strict mode, on every request:

v22.23.3  no descriptor         -> assign ok
v24.20.0  get,set=undefined     -> Cannot set property signal of #<IncomingMessage> which has only a getter

CI and the Dockerfile moved to Node 24 in #154 (2026-09-06). The DevAgents host runs Node 22, which is why plain vitest run there is green. Every gateway image built since #154 has this bug (live social-bob gateway reports v24.20.0). It hits the Express browser servers: the sandbox browser bridge and the gateway browser control server.

Fix: Object.defineProperty(req, "signal", { value: ctrl.signal, configurable: true }). An own property shadows Node's getter. It keeps the same meaning as before: abort only when the client disconnects. Readers (routes/agent.act.ts, routes/dispatcher.ts) are unchanged.

Cause 2: a stale test (1 failure)

model.test.ts › "keeps unknown-model errors for non-gpt-5 openai-codex ids". #156 made any unknown openai-codex id resolve through codex forward-compat, on purpose. The test now asserts that new contract: gpt-4.1-mini resolves with api: openai-codex-responses, and no error.

Validation

  • Before: the failing files reproduce on node:24-bookworm (Docker on DevAgents) with the same 500s.
  • After: vitest run src/browser src/agents/pi-embedded-runner/model.test.ts → 36 files, 260 tests green on node:24 and on node 22.
  • Full CI command (pnpm canvas:a2ui:bundle && pnpm test) on node:24: main suite 802/803. The one left is src/plugins/discovery.test.ts (uid-mismatch), which trips because the test ran as root in Docker; it passes in CI. The extensions suite had missing per-extension node_modules in my worktree (e.g. Cannot find package 'nostr-tools'), which is a setup gap, not code; CI passes those 122 files.
  • oxfmt --check and oxlint clean on the changed files. tsc shows no errors in them (only pre-existing errors in files this PR does not touch).
  • The pre-commit hook passed.

Not fixed here

The fleet needs a new gateway image for the browser fix to reach agents. That is an owner decision (build-and-push.sh → deploy.sh).

Known red baseline to ignore: install-smoke, label, label-issues, checks (bun, test), checks-windows (node, test).

🤖 Generated with Claude Code

Liran Peretz and others added 2 commits September 28, 2026 21:13
…x model test

Node 24 defines IncomingMessage#signal as a getter-only property, so the
browser Express middleware assignment req.signal = ctrl.signal threw and
every request to the browser control server / sandbox bridge got HTTP 500.
Shadow it with an own property instead. This was 19 of the 20 real
checks (node, test) failures on main since #154 moved CI to Node 24.

The 20th: #156 made any unknown openai-codex id resolve via forward-compat,
so the test that expected gpt-4.1-mini to error now asserts it resolves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cryptolir
cryptolir merged commit 3cd0aca into main Sep 29, 2026
19 of 24 checks passed
@cryptolir
cryptolir deleted the fix/ci-node-test-failures branch September 29, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant