Skip to content

chore(test): stop Codex Computer Use and Signal batching tests flaking under load - #157334

Merged
steipete merged 2 commits into
mainfrom
fix/flaky-codex-cu-elicitation
Sep 24, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/flaky-codex-cu-elicitation

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: two plugin test files fail intermittently on loaded hosts. The Codex Computer Use elicitation test reports a completed turn as aborted: true, and the Signal batched-reply test sees 0 replies instead of 2.

User Impact

No user-visible change. Maintainers and contributors stop seeing red PR CI and failed local runs from these tests. Product code is unchanged.

Why This Change Was Made

Both tests depended on wall-clock time, which docs/help/testing/writing-tests.md forbids.

  • Codex (extensions/codex/src/app-server): the attempt's 5s execution budget starts before async preparation. Under load, the deadline controller arms an already-overdue watchdog, the timeout handler aborts the run, and finalization correctly reports aborted: true for the "completed" variant. Harness waits used vi.waitFor, which advances fake clocks even when the awaited request already exists, so it also spent the budget. The harness now resolves deferred waiters when requests, handlers, and server responses are recorded, and exposes turn acceptance from the attempt wrapper. The Computer Use test runs on a fake deadline clock. Sibling tests now await acceptance or prompt persistence where they relied on the old polling order, and all their assertions still apply.
  • Signal (extensions/signal/src): the batched-reply test polled replyMock with a 5s real-time vi.waitFor and then aborted the monitor. Under load, debounced dispatch started after that budget, so the test cancelled valid in-flight work (Mac: 3/3 fail, Linux: 3/3 pass). The test now advances the 10ms debounce with fake timeouts once ingress is idle, and awaits the actual sends. Exact MessageSid/RawBody checks still fail if the two events are merged.

The other reported Signal failure ("cancels a pending reply-session conflict retry…", CI job 107407804689) ran on PR head c41aae5. That head predates 8b14034, which already replaced that test's polling on main. It is not changed here.

Evidence

  • New regression in run-attempt.activation.test.ts: an accepted attempt with a 1ms budget. Against the original polling fixtures it fails with aborted: true, timedOut: true, promptError: "codex app-server execution budget timed out"; with the fix it passes.
  • Codex Computer Use file: 4/4 failures before the fix (1 untouched baseline, 3 instrumented), 20/20 consecutive clean runs after. Sibling extensions/codex/src/app-server suite: 50 files, 737 tests passed. Linux Testbox run: https://github.com/openclaw/openclaw/actions/runs/36009225426
  • Signal: restoring the original fixture reproduces expected 2 calls, got 0. A temporary mutation that merges the two events is rejected by the stronger assertions. 20/20 Linux full-file runs and 70/70 shared-harness sibling tests passed. Testbox: https://github.com/openclaw/openclaw/actions/runs/36001546896
  • node scripts/check-changed.mjs and git diff --check pass.
  • Test cost (node scripts/run-vitest.mjs <file> --maxWorkers=1, heavily loaded host, so not a speedup claim): Codex Computer Use 421s before, 354s after. Signal responseprefix on the same Testbox: 62.8s before, 48.2s after.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

…gnals

The Computer Use elicitation test ran on real time with a 5s attempt budget that starts before async preparation. Under load the deadline controller armed an already-overdue watchdog, the timeout handler aborted the run, and finalization correctly reported aborted:true for the completed variant. Harness waits also used vi.waitFor, which advances fake clocks even when the awaited request already exists and so spends the execution budget.

Record requests/handlers/server responses with deferred waiters, expose turn acceptance from the attempt wrapper, run the Computer Use test on a fake deadline clock, and add an activation regression with a 1ms budget that fails on the polling fixture.
…ll-clock polling

The batched-reply test polled replyMock with a 5s real-time vi.waitFor and aborted the monitor when it expired. Under host load, dispatch of the debounced events started after that budget, so the test stopped valid in-flight work (Mac: 3/3 fail, Linux: 3/3 pass). Advance the 10ms debounce with fake timeouts after the ingress monitor is idle and await actual sends; assert per-message MessageSid/RawBody so merged events still fail.
@steipete
steipete force-pushed the fix/flaky-codex-cu-elicitation branch from 4dab170 to 7f2ff83 Compare September 24, 2026 14:49
@steipete
steipete marked this pull request as ready for review September 24, 2026 14:49
@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 10:54 AM ET / 14:54 UTC.

ClawSweeper review

What this changes

The branch replaces polling in Codex app-server and Signal test harnesses with event-based waits and updates their assertions.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still has the timing-sensitive waits, and source review found no definite defect in this focused repair.

Priority: P2
Reviewed head: 7f2ff83e60a97d2600195917b868f05df4d80d1f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused test repair has credible source-level synchronization and reported repeat runs, with no definite patch defect found.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The recorded repository-member PR changes test fixtures and assertions, with no production behavior or stored-data contract change. The PR reports before-and-after repeat runs, while its linked Testbox workflows were cancelled on earlier SHAs.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The recorded repository-member PR changes test fixtures and assertions, with no production behavior or stored-data contract change. The PR reports before-and-after repeat runs, while its linked Testbox workflows were cancelled on earlier SHAs.
Evidence reviewed 7 items Current-main behavior: The pinned main revision still uses polling in the Codex harness and the Signal batched-reply test; the central repair is not already on main.
Codex fixture synchronization: The introduced recorder resolves a method waiter when the fixture records that request; the attempt wrapper separately exposes turn acceptance for tests that need the later lifecycle point.
Signal assertions: The changed test advances the configured debounce after ingress dispatch becomes idle, waits for sends, and checks each reply's message identity and body.
Findings None None.
Security None None.

How this fits together

The Codex plugin tests drive synthetic app-server turns and check their outcomes. Signal tests feed inbound events through the monitor and check the resulting replies.

flowchart LR
  A[Codex test turn] --> B[App-server fixture]
  B --> C[Request and acceptance signals]
  C --> D[Turn assertions]
  E[Signal inbound events] --> F[Ingress monitor and debounce]
  F --> G[Reply assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +124. Total +124 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 14 245 121 +124
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 245 121 +124

Review metrics

Metric Value Why it matters
Production versus test LOC production +0, tests and fixtures +124 net The branch changes test synchronization without changing product runtime code.

Technical review

Best possible solution:

Keep the waits tied to fixture-owned completion signals and retain assertions for Codex terminal outcomes and distinct Signal replies.

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

No high-confidence current-main execution was established in this read-only review. Source confirms the timing-sensitive waits, and the PR reports failures on loaded hosts.

Is this the best way to solve the issue?

Yes. Fixture-owned request and delivery signals address the stated timing dependency without changing product behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1b32a8b3c7fc.

Labels

Label changes:

  • add P2: Intermittent Codex and Signal test failures consume normal maintainer and CI time without a reported user-facing outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The recorded repository-member PR changes test fixtures and assertions, with no production behavior or stored-data contract change. The PR reports before-and-after repeat runs, while its linked Testbox workflows were cancelled on earlier SHAs.

Label justifications:

  • P2: Intermittent Codex and Signal test failures consume normal maintainer and CI time without a reported user-facing outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The recorded repository-member PR changes test fixtures and assertions, with no production behavior or stored-data contract change. The PR reports before-and-after repeat runs, while its linked Testbox workflows were cancelled on earlier SHAs.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 merged commit ef2156f into main Sep 24, 2026
172 of 174 checks passed
@steipete
steipete deleted the fix/flaky-codex-cu-elicitation branch September 24, 2026 15:16
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 24, 2026
* commit '02ad6b76b1a2ee2b414b170072e6e3e606fda3d4': (134 commits)
  fix(build): scope normalization declarations to package sources (#157174)
  fix: exit after validating Codex model references (#157323)
  fix(gateway): guard workspace adoption during active work (#157259)
  fix(update): rebuild stale Git runtimes when source is already current (#156996)
  fix: require a click before diagnosing failed updates (#157359)
  test(release): provide sealed artifact inputs to writer fixtures
  fix(ios): preserve chat state and adapt layout when iPad windows resize (#156683)
  fix(test): prepare native UI fixtures before compilation
  fix(test): await outbound delivery readiness before assertions
  fix: clarify deferred Codex catalog refresh warnings (#157352)
  fix(skills): refresh skills after watched directories are replaced (#156324)
  ci: reduce Node fixture overhead and defer seven release matrices (#157341)
  chore(test): stop Codex Computer Use and Signal batching tests flaking under load (#157334)
  fix(gateway): retain owned suspension status during restart (#157258)
  fix(ci): scope desktop status assertions to the selected worker
  chore(i18n): refresh native locales (#157337)
  test(daemon): use the native PowerShell probe budget (#157289)
  fix(exec): avoid gateway stalls during background task writes (#157177)
  test(cli): isolate preaction title setter state
  fix(test): synchronize Git backoff cancellation readiness (#157315)
  ...
vincentkoc added a commit that referenced this pull request Sep 24, 2026
* commit 'c4333da677cbdfe1bbaf783ed01c363ff39e93b8': (100 commits)
  fix(test): stop preflight mocks leaking into shared workers (#157207)
  fix(build): scope normalization declarations to package sources (#157174)
  fix: exit after validating Codex model references (#157323)
  fix(gateway): guard workspace adoption during active work (#157259)
  fix(update): rebuild stale Git runtimes when source is already current (#156996)
  fix: require a click before diagnosing failed updates (#157359)
  test(release): provide sealed artifact inputs to writer fixtures
  fix(ios): preserve chat state and adapt layout when iPad windows resize (#156683)
  fix(test): prepare native UI fixtures before compilation
  fix(test): await outbound delivery readiness before assertions
  fix: clarify deferred Codex catalog refresh warnings (#157352)
  fix(skills): refresh skills after watched directories are replaced (#156324)
  ci: reduce Node fixture overhead and defer seven release matrices (#157341)
  chore(test): stop Codex Computer Use and Signal batching tests flaking under load (#157334)
  fix(gateway): retain owned suspension status during restart (#157258)
  fix(ci): scope desktop status assertions to the selected worker
  chore(i18n): refresh native locales (#157337)
  test(daemon): use the native PowerShell probe budget (#157289)
  fix(exec): avoid gateway stalls during background task writes (#157177)
  test(cli): isolate preaction title setter state
  ...
vincentkoc added a commit that referenced this pull request Sep 24, 2026
* commit '02ad6b76b1a2ee2b414b170072e6e3e606fda3d4': (122 commits)
  fix(build): scope normalization declarations to package sources (#157174)
  fix: exit after validating Codex model references (#157323)
  fix(gateway): guard workspace adoption during active work (#157259)
  fix(update): rebuild stale Git runtimes when source is already current (#156996)
  fix: require a click before diagnosing failed updates (#157359)
  test(release): provide sealed artifact inputs to writer fixtures
  fix(ios): preserve chat state and adapt layout when iPad windows resize (#156683)
  fix(test): prepare native UI fixtures before compilation
  fix(test): await outbound delivery readiness before assertions
  fix: clarify deferred Codex catalog refresh warnings (#157352)
  fix(skills): refresh skills after watched directories are replaced (#156324)
  ci: reduce Node fixture overhead and defer seven release matrices (#157341)
  chore(test): stop Codex Computer Use and Signal batching tests flaking under load (#157334)
  fix(gateway): retain owned suspension status during restart (#157258)
  fix(ci): scope desktop status assertions to the selected worker
  chore(i18n): refresh native locales (#157337)
  test(daemon): use the native PowerShell probe budget (#157289)
  fix(exec): avoid gateway stalls during background task writes (#157177)
  test(cli): isolate preaction title setter state
  fix(test): synchronize Git backoff cancellation readiness (#157315)
  ...
vincentkoc added a commit that referenced this pull request Sep 24, 2026
* test(ui): cover stack-free tooltip disconnect cleanup

* fix(build): scope normalization declarations to package sources

Give normalization-core its own TypeScript project so declaration generation does not load the repository-wide source set. Preserve the existing DTS build command and compiler policy.

* Merge normalization declaration scope for tooltip proof

* commit '81aeccb3db80136a118d6d2f98b67d836ec25e51':
  fix(build): scope normalization declarations to package sources

* fix(ui): avoid retaining tooltip anchors in abort reasons

* Merge main to include native wrapper source inventory repair

* commit '02ad6b76b1a2ee2b414b170072e6e3e606fda3d4': (134 commits)
  fix(build): scope normalization declarations to package sources (#157174)
  fix: exit after validating Codex model references (#157323)
  fix(gateway): guard workspace adoption during active work (#157259)
  fix(update): rebuild stale Git runtimes when source is already current (#156996)
  fix: require a click before diagnosing failed updates (#157359)
  test(release): provide sealed artifact inputs to writer fixtures
  fix(ios): preserve chat state and adapt layout when iPad windows resize (#156683)
  fix(test): prepare native UI fixtures before compilation
  fix(test): await outbound delivery readiness before assertions
  fix: clarify deferred Codex catalog refresh warnings (#157352)
  fix(skills): refresh skills after watched directories are replaced (#156324)
  ci: reduce Node fixture overhead and defer seven release matrices (#157341)
  chore(test): stop Codex Computer Use and Signal batching tests flaking under load (#157334)
  fix(gateway): retain owned suspension status during restart (#157258)
  fix(ci): scope desktop status assertions to the selected worker
  chore(i18n): refresh native locales (#157337)
  test(daemon): use the native PowerShell probe budget (#157289)
  fix(exec): avoid gateway stalls during background task writes (#157177)
  test(cli): isolate preaction title setter state
  fix(test): synchronize Git backoff cancellation readiness (#157315)
  ...

Co-authored-by: Vincent Koc <[email protected]>
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
…g under load (openclaw#157334)

* test(codex): replace app-server harness polling with owned request signals

The Computer Use elicitation test ran on real time with a 5s attempt budget that starts before async preparation. Under load the deadline controller armed an already-overdue watchdog, the timeout handler aborted the run, and finalization correctly reported aborted:true for the completed variant. Harness waits also used vi.waitFor, which advances fake clocks even when the awaited request already exists and so spends the execution budget.

Record requests/handlers/server responses with deferred waiters, expose turn acceptance from the attempt wrapper, run the Computer Use test on a fake deadline clock, and add an activation regression with a 1ms budget that fails on the polling fixture.

* test(signal): drive batched debounce with owned signals instead of wall-clock polling

The batched-reply test polled replyMock with a 5s real-time vi.waitFor and aborted the monitor when it expired. Under host load, dispatch of the debounced events started after that budget, so the test stopped valid in-flight work (Mac: 3/3 fail, Linux: 3/3 pass). Advance the 10ms debounce with fake timeouts after the ingress monitor is idle and await actual sends; assert per-message MessageSid/RawBody so merged events still fail.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
* test(ui): cover stack-free tooltip disconnect cleanup

* fix(build): scope normalization declarations to package sources

Give normalization-core its own TypeScript project so declaration generation does not load the repository-wide source set. Preserve the existing DTS build command and compiler policy.

* Merge normalization declaration scope for tooltip proof

* commit '81aeccb3db80136a118d6d2f98b67d836ec25e51':
  fix(build): scope normalization declarations to package sources

* fix(ui): avoid retaining tooltip anchors in abort reasons

* Merge main to include native wrapper source inventory repair

* commit 'f11e16cd65951f284264bd202b49984e21091cf5': (134 commits)
  fix(build): scope normalization declarations to package sources (openclaw#157174)
  fix: exit after validating Codex model references (openclaw#157323)
  fix(gateway): guard workspace adoption during active work (openclaw#157259)
  fix(update): rebuild stale Git runtimes when source is already current (openclaw#156996)
  fix: require a click before diagnosing failed updates (openclaw#157359)
  test(release): provide sealed artifact inputs to writer fixtures
  fix(ios): preserve chat state and adapt layout when iPad windows resize (openclaw#156683)
  fix(test): prepare native UI fixtures before compilation
  fix(test): await outbound delivery readiness before assertions
  fix: clarify deferred Codex catalog refresh warnings (openclaw#157352)
  fix(skills): refresh skills after watched directories are replaced (openclaw#156324)
  ci: reduce Node fixture overhead and defer seven release matrices (openclaw#157341)
  chore(test): stop Codex Computer Use and Signal batching tests flaking under load (openclaw#157334)
  fix(gateway): retain owned suspension status during restart (openclaw#157258)
  fix(ci): scope desktop status assertions to the selected worker
  chore(i18n): refresh native locales (openclaw#157337)
  test(daemon): use the native PowerShell probe budget (openclaw#157289)
  fix(exec): avoid gateway stalls during background task writes (openclaw#157177)
  test(cli): isolate preaction title setter state
  fix(test): synchronize Git backoff cancellation readiness (openclaw#157315)
  ...

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: signal Channel integration: signal extensions: codex P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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