Skip to content

test(gateway): assert the exact pinned-clock dispatch timeout - #124669

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-workspace-sync-assert
Aug 16, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-workspace-sync-assert

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

workspace-sync.test.ts pins Date.now explicitly 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 to toBeLessThanOrEqual(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.
  • LOC: test +3/−1, prod 0.

@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Aug 16, 2026
@steipete
steipete marked this pull request as ready for review August 16, 2026 15:35
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 16, 2026
@clawsweeper

clawsweeper Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 12:01 PM ET / 16:01 UTC.

ClawSweeper review

What this changes

The PR replaces a permissive timeout assertion in the Gateway worker workspace test with an exact assertion and explains the deterministic clock invariant.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The 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
Reviewed head: 7ecbc34b7264eb8da813f9ca0577766695e2d3bb

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, well-scoped regression-test improvement with direct source support and focused validation reported in the PR body.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, test-only PR has no user-visible behavior change requiring external real-behavior proof.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, test-only PR has no user-visible behavior change requiring external real-behavior proof.
Evidence reviewed 5 items Current-main test gap: Current main still asserts only that the dispatched timeout is at most 777, which would accept a zero timeout.
Owner-boundary behavior: The workspace command owner creates a deadline from Date.now and passes its remaining time to the non-retry SSH dispatch; with the test clock fixed, this is exactly 777.
Production caller: The tunnel constructs these workspace actions and routes worker launches through the non-retry command path, so the assertion covers the real SSH options boundary.
Findings None None.
Security None None.

How this fits together

Gateway 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
Loading

Before merge

  • Resolve merge risk (P1) - The branch is marked behind current main, so landing should use the current merge result and its exact-head checks.
  • Complete next step (P2) - No repair is needed; the maintainer-labeled PR needs routine current-main merge-result and CI confirmation.
Agent review details

Security

None.

PR surface

Tests +2. Total +2 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 3 1 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 3 1 +2

Review metrics

Metric Value Why it matters
Production versus test LOC production 0; tests net +2 (3 added, 1 removed) The branch only strengthens colocated regression coverage and does not alter runtime behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the exact assertion and merge after the current-main merge result receives normal maintainer and CI confirmation.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label justifications:

  • P3: This is a low-risk test-only assertion improvement with no direct user-facing behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, test-only PR has no user-visible behavior change requiring external real-behavior proof.

Evidence

What I checked:

Likely related people:

  • steipete: Peter Steinberger introduced the current workspace-sync test and is the recorded author of the nearby worker-workspace implementation history. (role: feature owner and recent area contributor; confidence: high; commits: 605dece17105, b61bc5cd8da6, 592bf90b079c; files: src/gateway/worker-environments/workspace-sync.ts, src/gateway/worker-environments/workspace-sync.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm the current-main merge result and its exact-head checks before landing.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-16T15:41:06.866Z sha ef7e603833b9a1633e13606997682b0862700d02 :: needs maintainer review before merge. :: none

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.
@steipete
steipete force-pushed the codex/autoqa-workspace-sync-assert branch from ef7e603 to 7ecbc34 Compare August 16, 2026 15:56
@steipete
steipete merged commit 01a23bc into main Aug 16, 2026
107 checks passed
@steipete
steipete deleted the codex/autoqa-workspace-sync-assert branch August 16, 2026 16:05
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 17, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant