base red: web-lint check:fixed-waits from #35206 + #35209

Merged
LA
2d ago
+43-22

Summary

Tip red on feat-cmux-next since b1b0f37b15f: web-lint: webviews: bun run check:fixed-waits (exit 1).

Cause: #35206 alone, not a conflict with #35209. #35209 added a separate Python guard
(scripts/ci/check_short_timeouts.py) and did not change webviews/scripts/check-fixed-waits.ts
(the #23365 ratchet). #35206 (a628f506790e) added transportDeadlines.test.ts with a fixed wait.
check:pieces stops at the first red, so #35206 also hid three more reds in the same job:
a type error in mock.ts, a stale test that still uses the removed STARTING_READS, and an unused variable.

The fixed wait was hiding a test that tested nothing. The test made the mock with
new MockAcpmuxSocket(() => Promise.resolve()), so the "600 ms slow reply" came back in under 1 ms.
The request never crossed its 20 ms deadline. Only await wait(350) made elapsed > 20 true. The
landed test passes with direct.ts from before #35206.

Changes:

  • transportDeadlines.test.ts: the mock holds the slow method's reply until the test sees the
    client's waiting snapshot (daemonWaitingSince). That snapshot is the event the 20 ms deadline
    causes on an open socket. Then the test releases the reply, checks that the request resolves, and
    checks that the waiting state clears. There is no wall-clock wait. A deadline that fails the request
    settles the race, so the test fails at once and does not hang.
  • mock.ts: read the slow-method globals once (TS2345 number | undefined, vp check red).
  • agent-pane-peer-copy-paused.test.tsx: #35206 removed the STARTING_READS cap on purpose. The
    test now proves that reads continue past the old 3-minute cap and that the interval is not cleared
    (before: TS2339 plus a runtime failure).
  • useCloudChatRecovery.ts: remove the result binding that #35206 left unused (vp lint no-unused-vars).

Guard output

Before (d3d5a6246ab):

check-fixed-waits: a test waits a fixed time. ...
  src/agent-session/acpmux/transportDeadlines.test.ts: 2 fixed waits, baseline 0
    src/agent-session/acpmux/transportDeadlines.test.ts:8
    src/agent-session/acpmux/transportDeadlines.test.ts:40
error: script "check:fixed-waits" exited with code 1

After: Fixed waits checked (0 on the baseline)., and bun run check (webviews) exits 0.

Red / green

All from webviews/, with bun test <file>:

  • src/agent-session/acpmux/transportDeadlines.test.ts (1 test): head passes in 5 of 5 runs. With direct.ts from
    a628f506790e^ it fails: native.timed_out. The landed version with that old direct.ts passes,
    which shows that it did not test the fix.
  • test/agent-pane-peer-copy-paused.test.tsx: head 8/8 pass. With peerCloudMachine.ts from
    a628f506790e^ it fails 1 test (interval cleared after 60 reads).

Observed / Not run

Observed: bun run check:fixed-waits, full bun run check (exit 0), scripts/web-lint.sh (pass),
scripts/cmux-next/prepush-gate.py (no new violations), and the red/green runs above.

Not run: the full webviews test suite. Known base red not fixed here: 5 tests in
test/cloud-chat-resume.test.tsx still assert the 60 s resume deadline that #35206 removed
(a hung inventory fails at the original recovery deadline and 4 others). They fail the same way on
d3d5a6246ab without this PR and need #35206's author to decide the new contract.

Changelog

none