Skip to content

fix: prevent cron and gateway stress-run timeouts - #115241

Merged
steipete merged 3 commits into
mainfrom
codex/cron-workboard-race-stress
Jul 28, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/cron-workboard-race-stress

Conversation

@steipete

@steipete steipete commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where focused or concurrent cron, Workboard, and gateway stress runs could falsely time out or miss the agent tests they were intended to execute. Embedded-agent, tool, support, and specially isolated agent tests were collapsed into the generic project. Gateway startup also raced a cold lazy WebSocket handler against a one-second poll.

Why This Change Was Made

Route focused files, directories, and owner-local globs through the existing canonical agent harnesses. Expand the mixed embedded-agent directory into its four isolated projects; preserve broad agent globs and watch mode. Wait for the actual Gateway response using the existing deferred primitive. This changes test ownership and synchronization, not production Gateway, SQLite, configuration, or protocol behavior.

User Impact

Cron, Workboard, Gateway, and agent test runs select their real owner and retain the correct isolation and timeout contract. Cold Gateway startup no longer fails from an unrelated polling deadline.

Evidence

Rebased and independently reproved on fresh main; reviewed head: 2905eaa46282263ccfe9e7c4cc25cf6a6e6b145e.

Remote Linux, provider blacksmith-testbox, lease tbx_01kymsye2kxre68p6cvdzycrg5:

pnpm test test/scripts/test-projects.test.ts \
  src/scripts/test-projects.test.ts \
  src/gateway/server/ws-connection.startup.test.ts \
  test/scripts/sqlite-sessions-transcripts-flip-proof.e2e.test.ts \
  -- --reporter=verbose

tooling: 2 files, 333 tests passed
gateway startup: 1 file, 2 tests passed
live isolated SQLite/session Gateway lifecycle: 1 file, 1 test passed
[test] passed 3 Vitest shards
Blacksmith timing JSON: exitCode=0, runStatus=succeeded

The former failing check-sqlite-session-flip-proof scenario now passes on this exact rebased source, including real isolated gateway startup, migration, restart, concurrent session operations, and SQLite-first transcript invariants.

Fresh independent review:

autoreview --mode branch --base origin/main
trufflehog: clean
autoreview clean: no accepted/actionable findings reported
overall: patch is correct

The broader preceding campaign also passed 340 distinct cron, Workboard, Gateway, tasks, agent, skills, CLI, and UI test files; 61 real-Chromium tests; and six isolated-Gateway scheduling scenarios. The direct terminal proof above is the current-head landing evidence.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime scripts Repository scripts size: M maintainer Maintainer-authored PR labels Jul 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 28, 2026
@clawsweeper

clawsweeper Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 11:07 AM ET / 15:07 UTC.

ClawSweeper review

What this changes

The PR routes focused agent tests to their existing isolated Vitest harnesses and replaces a polling assertion in a Gateway startup test with a deferred response wait.

Merge readiness

⛔ Blocked until real behavior proof is added - 3 items remain

Keep this PR open. Current main still lacks the PR’s focused embedded-agent ownership routing, so the central test-isolation fix remains necessary; however, the branch is behind main and its body contains result claims rather than inspectable after-fix artifacts, so it needs a current-head refresh and real behavior proof before merge. The maintainer label also requires explicit maintainer handling rather than automated cleanup.

Priority: P2
Reviewed head: 110865506a1906197c30b8b1d4148c7fba7d837e

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and has meaningful regression coverage, but the real behavior claims are not yet backed by inspectable evidence and the branch needs a current-main refresh.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body describes stress, Chromium, and isolated-Gateway results, but it supplies no inspectable after-fix terminal output, redacted logs, recording, screenshot, or linked artifact. Add one that demonstrates focused owner selection and a completed Gateway startup response; redact private endpoints, IPs, and credentials. Updating the PR body should trigger a new review, or a maintainer can request one with @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body describes stress, Chromium, and isolated-Gateway results, but it supplies no inspectable after-fix terminal output, redacted logs, recording, screenshot, or linked artifact. Add one that demonstrates focused owner selection and a completed Gateway startup response; redact private endpoints, IPs, and credentials. Updating the PR body should trigger a new review, or a maintainer can request one with @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current-main gap: The current main version of the focused-test planner imports only the core-isolated agent path list and retains the generic agent configuration constants; it does not contain this PR’s embedded incomplete-turn, overflow-compaction, embedded-run, tools, and support target routing.
Branch implementation and regression coverage: The branch adds path classification for the embedded-agent parent and owner-local subtrees, then adds focused-file, directory, and glob routing expectations for core, embedded, support, and tools shards.
Gateway test synchronization: The branch changes the startup-readiness test from periodically searching sent frames to resolving a shared deferred value when the matching connect response is emitted, which directly targets the reported lazy-handler race without changing production Gateway code.
Findings None None.
Security None None.

How this fits together

OpenClaw’s test-project planner converts focused paths and globs into Vitest configuration runs, where each agent shard owns its timeout and isolation contract. The Gateway startup test exercises the WebSocket connection handler and verifies that a startup-unavailable response reaches the test socket.

flowchart LR
  A[Focused test path or glob] --> B[Test-project planner]
  B --> C[Agent ownership decision]
  C --> D[Isolated Vitest harness]
  D --> E[Deterministic test result]
  F[Gateway startup handler] --> G[WebSocket response]
  G --> H[Deferred test assertion]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body describes stress, Chromium, and isolated-Gateway results, but it supplies no inspectable after-fix terminal output, redacted logs, recording, screenshot, or linked artifact. Add one that demonstrates focused owner selection and a completed Gateway startup response; redact private endpoints, IPs, and credentials. Updating the PR body should trigger a new review, or a maintainer can request one with @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The branch is behind current main; the focused-routing behavior and its expectations need a rebase or merge-result refresh before landing.
  • Resolve merge risk (P1) - The PR body reports extensive stress and browser/Gateway runs but provides no inspectable redacted terminal output, logs, recording, or linked artifact showing the after-fix behavior.
Agent review details

Security

None.

PR surface

Tests +137, Other +49. Total +186 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 174 37 +137
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 50 1 +49
Total 4 224 38 +186

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/gateway/server/ws-connection.startup.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase onto current main, retain the canonical owner-based routing rather than adding parallel test runners, and attach a redacted real-run trace that shows the selected harnesses and the Gateway startup response completing reliably.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase onto current main, retain the canonical owner-based routing rather than adding parallel test runners, and attach a redacted real-run trace that shows the selected harnesses and the Gateway startup response completing reliably.

Do we have a high-confidence way to reproduce the issue?

No high-confidence independent live reproduction was run in this review. The current planner and the PR’s focused routing regressions make the misclassification path source-reproducible, while the reported timing failure still needs an inspectable current-head run.

Is this the best way to solve the issue?

Yes, provisionally. Preserving the existing full-suite owner configurations for focused targets is narrower and safer than inventing new timeouts or a parallel test runner; the exact result should be checked after rebasing onto current main.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 206f989069fb.

Labels

Label changes:

  • add P2: This is a bounded test and CI reliability repair that can cause false failures or incomplete focused coverage, but it does not change production runtime behavior.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body describes stress, Chromium, and isolated-Gateway results, but it supplies no inspectable after-fix terminal output, redacted logs, recording, screenshot, or linked artifact. Add one that demonstrates focused owner selection and a completed Gateway startup response; redact private endpoints, IPs, and credentials. Updating the PR body should trigger a new review, or a maintainer can request one with @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded test and CI reliability repair that can cause false failures or incomplete focused coverage, but it does not change production runtime behavior.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body describes stress, Chromium, and isolated-Gateway results, but it supplies no inspectable after-fix terminal output, redacted logs, recording, screenshot, or linked artifact. Add one that demonstrates focused owner selection and a completed Gateway startup response; redact private endpoints, IPs, and credentials. Updating the PR body should trigger a new review, or a maintainer can request one with @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main gap: The current main version of the focused-test planner imports only the core-isolated agent path list and retains the generic agent configuration constants; it does not contain this PR’s embedded incomplete-turn, overflow-compaction, embedded-run, tools, and support target routing. (scripts/test-projects.test-support.mjs:1, 206f989069fb)
  • Branch implementation and regression coverage: The branch adds path classification for the embedded-agent parent and owner-local subtrees, then adds focused-file, directory, and glob routing expectations for core, embedded, support, and tools shards. (test/scripts/test-projects.test.ts:2631, 110865506a19)
  • Gateway test synchronization: The branch changes the startup-readiness test from periodically searching sent frames to resolving a shared deferred value when the matching connect response is emitted, which directly targets the reported lazy-handler race without changing production Gateway code. (src/gateway/server/ws-connection.startup.test.ts:13, 54955faa3e71)
  • Branch provenance: The PR’s three commits show a focused progression from deterministic cron/Gateway stress behavior, through expectation updates, to preserving focused agent-glob isolation. (scripts/test-projects.test-support.mjs:4250, 110865506a19)
  • Merge freshness: GitHub reports the PR as cleanly mergeable but behind main; review should be refreshed against the current merge result before landing. (206f989069fb)

Likely related people:

  • steipete: The supplied branch history attributes all three focused commits to this contributor, covering the routing change, expectation alignment, and focused-glob isolation. Current-main history could not be independently expanded in the read-only sandbox. (role: recent contributor to the affected test-routing and Gateway-test surfaces; confidence: low; commits: 54955faa3e71, b2cfe898c317, 110865506a19; files: scripts/test-projects.test-support.mjs, src/gateway/server/ws-connection.startup.test.ts, test/scripts/test-projects.test.ts)

Rank-up moves

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

  • Rebase or refresh the branch against current main and rerun the affected routing assertions.
  • Attach a redacted terminal trace or linked artifact showing focused embedded-agent paths select their isolated configurations and the Gateway response completes after startup.

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.

@steipete
steipete force-pushed the codex/cron-workboard-race-stress branch from 1108655 to 2905eaa Compare July 28, 2026 17:03
@steipete
steipete merged commit 2aa79e4 into main Jul 28, 2026
116 checks passed
@steipete
steipete deleted the codex/cron-workboard-race-stress branch July 28, 2026 17:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 28, 2026
…224005-host

* origin/main: (72 commits)
  fix: macOS-only Parallels smoke harness regression (#75293)
  fix(ios): use configured speech language for system voice (#113372)
  refactor: centralize isolated agent test ownership (#115340)
  test(ui): stabilize browser route readiness (#115320)
  fix(cron): clear automation after failed scheduler shutdown (#115316)
  fix: keep isolated gateway workspaces and skills inside state dir (#114487)
  docs: document local TTS on macOS, Linux, and Windows (#110230)
  fix(tasks): clone only the requested task page (#114277)
  fix(agents): prevent Code Mode resume loss and unbounded preparation (#115314)
  fix(process): preserve the first process cancellation reason (#115317)
  fix(nostr): report unavailable ingress when queue open fails (#115313)
  fix: prevent Slack and Feishu ingress startup leaks (#115295)
  fix(slack): avoid unsafe emphasis boundaries (#111575)
  fix: prevent changed checks from expanding into full lint (#115322)
  fix(codex): stabilize prompts and expose real cache regressions (#115238)
  refactor(ui): derive page route specs from the route table (#115214)
  fix(compaction): plan cut points in trigger units (#111886) (#115309)
  fix: prevent cron and gateway stress-run timeouts (#115241)
  fix(ci): validate frozen Matrix QA targets (#115298)
  test(macos): block real process fallthrough (#113337)
  ...

# Conflicts:
#	CHANGELOG.md
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
* fix: make cron and gateway stress tests deterministic

* test: update focused agent project expectations

* fix: preserve focused agent glob isolation
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
…afea23-host

* origin/main: (72 commits)
  fix: macOS-only Parallels smoke harness regression (openclaw#75293)
  fix(ios): use configured speech language for system voice (openclaw#113372)
  refactor: centralize isolated agent test ownership (openclaw#115340)
  test(ui): stabilize browser route readiness (openclaw#115320)
  fix(cron): clear automation after failed scheduler shutdown (openclaw#115316)
  fix: keep isolated gateway workspaces and skills inside state dir (openclaw#114487)
  docs: document local TTS on macOS, Linux, and Windows (openclaw#110230)
  fix(tasks): clone only the requested task page (openclaw#114277)
  fix(agents): prevent Code Mode resume loss and unbounded preparation (openclaw#115314)
  fix(process): preserve the first process cancellation reason (openclaw#115317)
  fix(nostr): report unavailable ingress when queue open fails (openclaw#115313)
  fix: prevent Slack and Feishu ingress startup leaks (openclaw#115295)
  fix(slack): avoid unsafe emphasis boundaries (openclaw#111575)
  fix: prevent changed checks from expanding into full lint (openclaw#115322)
  fix(codex): stabilize prompts and expose real cache regressions (openclaw#115238)
  refactor(ui): derive page route specs from the route table (openclaw#115214)
  fix(compaction): plan cut points in trigger units (openclaw#111886) (openclaw#115309)
  fix: prevent cron and gateway stress-run timeouts (openclaw#115241)
  fix(ci): validate frozen Matrix QA targets (openclaw#115298)
  test(macos): block real process fallthrough (openclaw#113337)
  ...

# Conflicts:
#	CHANGELOG.md
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 P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant