Repository navigation
test(gateway): assert the exact pinned-clock dispatch timeout - #124669
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 12:01 PM ET / 16:01 UTC. ClawSweeper reviewWhat this changesThe PR replaces a permissive timeout assertion in the Gateway worker workspace test with an exact assertion and explains the deterministic clock invariant. Merge readinessThe focused test hardening is correct: current main still accepts a zero dispatch timeout, while the pinned clock makes 777 the only expected value. This maintainer-labeled PR should remain open for ordinary current-main merge-result review. Priority: P3 Review scores
Verification
How this fits togetherGateway worker workspace actions turn a command timeout into an SSH dispatch deadline before running a remote command. This test verifies the timeout passed into that transport boundary. flowchart LR
A[Workspace command] --> B[Workspace action]
B --> C[Deadline from pinned clock]
C --> D[SSH command options]
D --> E[Remote worker dispatch]
F[Focused test] --> C
Before merge
Agent review detailsSecurityNone. PR surfaceTests +2. Total +2 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the exact assertion and merge after the current-main merge result receives normal maintainer and CI confirmation. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR hardens an existing deterministic test; its body reports the focused test passing after the change. Is this the best way to solve the issue? Yes. The assertion is at the workspace-command transport boundary and directly protects the exact deadline value without adding runtime behavior or test-only seams. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 421e319fb7c1. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
The never-retry test pins Date.now specifically so the derived dispatch timeout is deterministic, then asserted only <=777 — which also accepts zero and would mask a broken deadline derivation. Assert the exact value the pin guarantees.
ef7e603 to
7ecbc34
Compare
|
Merged via squash.
|
…aw#124669) The never-retry test pins Date.now specifically so the derived dispatch timeout is deterministic, then asserted only <=777 — which also accepts zero and would mask a broken deadline derivation. Assert the exact value the pin guarantees.
What Problem This Solves
workspace-sync.test.tspinsDate.nowexplicitly so the derived dispatch timeout is deterministic (its own comment says the pin exists to avoid a loaded-runner flake on "the exact 777 assertion") — but the assertion was weakened totoBeLessThanOrEqual(777), which also accepts 0 and would pass if the deadline derivation broke entirely.Why This Change Was Made
With the clock pinned there is exactly one correct value; assert it. A weakened bound on a deterministic setup protects nothing.
User Impact
None (test-only); the dispatch-deadline invariant is now actually protected.
Evidence
node scripts/run-vitest.mjs run src/gateway/worker-environments/workspace-sync.test.ts— 7/7 pass.