Skip to content

fix(test): avoid false native polling timeouts - #140119

Merged
steipete merged 2 commits into
mainfrom
codex/fix-shared-native-wait-final-read
Sep 6, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/fix-shared-native-wait-final-read

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves false native test timeouts when an asynchronous observation and the final polling sleep cross the deadline after the observed work has completed. The shared test helper and the macOS coordinator's test waiter previously threw without reading the condition again.

Why This Change Was Made

Both waiters check the condition once more before their existing timeout error. This follows their existing semantics: a true asynchronous result can already finish after the polling deadline. The shared helper retains its 15-second default and wall clock; the coordinator retains its two-second continuous-clock deadline. Both retain 10ms polling, typed errors and cancellation propagation from their throwing sleep. The coordinator's unused timeout parameter is removed.

User Impact

Test reliability only; production code is unchanged. Shared tests cover completed asynchronous state, the unchanged incomplete-condition timeout label, and cancellation of an owned child task. The coordinator regression reuses its existing completion probe. The total change is 76 net test and test-support lines across three files.

Evidence

Isolated Foundation/Testing targets reproduced the false timeout with each original waiter and passed with each repair. The shared helper's exact three permanent cases failed only the stale-observation regression before the fix and passed all three afterward. The coordinator's exact new regression likewise failed before and passed afterward. These runs imported no app modules and touched no operator state; they do not establish a historical CI scheduling interval.

Formatting and typechecking passed. All 13 canonical changed checks passed, including 1,125 Node/tooling executions across 21 file runs. One independent P2 review of the complete three-file change is clean. The committed files match that reviewed candidate exactly.

The combined head's CI run is green. All four regressions passed in their actual native targets. The shared package reports 1,673 tests / 127 suites, and the macOS default profile reports 2,075 / 226. Its three normal skips remain recorded; separate isolation (2 / 1) and health-render (1 / 1) invocations passed. The response-loss and embedded-handshake probes remain unexecuted. The tested merge contains the exact three reviewed files, and iOS/Android tests, builds and screenshot jobs passed.

The earlier shared-only CI run passed its native waiter proof but failed an Android composer assertion and the aggregate gate. That historical failure is retained without attributing it to this repair; the fresh combined-head Android Play job passed.

@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 5:27 PM ET / 21:27 UTC.

ClawSweeper review

What this changes

The PR makes two native test waiters recheck completion before throwing a timeout and adds regression coverage for delayed observations, timeout labels, and cancellation.

Merge readiness

✅ Ready for maintainer review

The repair remains useful: current main still has both false-timeout paths. No blocking defect was found in the introduced changes, and the maintainer-authored PR is protected from automatic closure.

Priority: P2
Reviewed head: fe4b41c7dd662afab31e39a03d922004d15db725

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful regression cases, reported native-target validation, and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored, test-only repair is exempt from external-contributor runtime proof; the captured evidence reports both repaired waiters passing their regressions in the actual native test targets.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored, test-only repair is exempt from external-contributor runtime proof; the captured evidence reports both repaired waiters passing their regressions in the actual native test targets.
Evidence reviewed 6 items Introduced behavior: Both introduced changes add one final condition read before the existing timeout error. The shared helper retains its 15-second default, and the coordinator retains its two-second deadline and throwing polling sleep.
Current main still needs the repair: The inspected main versions of both waiters exit the polling loop directly into their timeout errors without rereading the condition.
Latest supplied release retains the old helper: The shared waiter in v2026.9.2 also throws immediately after the polling loop; this release does not contain the proposed final read.
Findings None None.
Security None None.

How this fits together

OpenClaw’s native test waiters poll asynchronous observations while testing shared Swift components and the macOS node coordinator. They return when the observed work completes or report a labeled timeout.

flowchart TD
  A[Native test] --> B[Async condition]
  B --> C[Polling waiter]
  C --> D{Completion observed?}
  D -->|Yes| E[Test continues]
  D -->|No and time remains| B
  D -->|Deadline passed| F[Final condition read]
  F -->|Complete| E
  F -->|Incomplete| G[Labeled timeout]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Other +76. Total +76 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 81 5 +76
Total 3 81 5 +76

Review metrics

None.

Technical review

Best possible solution:

Keep the final observation at each waiter’s timeout boundary while preserving existing deadlines, cancellation propagation, and substantive native-test assertions.

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

Yes, source establishes the failure path: a false asynchronous snapshot can return after completion and the deadline, causing the old waiter to throw without rereading. The PR reports before/after reproduction; this review did not execute it.

Is this the best way to solve the issue?

Yes. One final observation repairs the waiter-owned decision without increasing timeout budgets or weakening the assertions in its callers.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 270762e51d65.

Labels

Label justifications:

  • P2: This is a bounded native-test reliability repair with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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 maintainer-authored, test-only repair is exempt from external-contributor runtime proof; the captured evidence reports both repaired waiters passing their regressions in the actual native test targets.

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)

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 (3 earlier review cycles)
  • reviewed 2026-09-06T13:05:15.587Z sha 6f851fb :: needs maintainer review before merge. :: none
  • reviewed 2026-09-06T13:11:30.116Z sha 6f851fb :: needs maintainer review before merge. :: none
  • reviewed 2026-09-06T20:38:08.646Z sha fe4b41c :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review September 6, 2026 13:08
@openclaw-barnacle openclaw-barnacle Bot added the app: macos App: macos label Sep 6, 2026
@steipete
steipete merged commit face9c2 into main Sep 6, 2026
79 of 80 checks passed
@steipete
steipete deleted the codex/fix-shared-native-wait-final-read branch September 6, 2026 21:31
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit '294df333c58f2da104eccffc623ccb3c4d43d4d8': (1802 commits)
  fix: clear stale diagnostics after Gateway changes (#140426)
  fix: keep plugin catalogs intact after discovery timeouts (#140441)
  perf(tui): prepare session picker rows once per overlay (#140462)
  refactor(config): reuse environment substitution for write-back (#140460)
  refactor(discord): remove retired auto-presence templates (#140463)
  fix(ui): finish roster refreshes during session activity (#140459)
  fix(setup): match prepared credentials to the model provider (#140461)
  fix: keep MiniMax discovery on the selected credential (#140438)
  refactor(tests): remove unused parent context cache reset (#140456)
  fix: avoid repeated xAI OAuth refresh during discovery (#140434)
  perf(routing): reuse prepared event session targets (#140454)
  fix(media): keep deferred audio and extraction providers discoverable (#139231)
  refactor(codex): remove redundant app-server forwarding (#140451)
  fix(test): avoid false native polling timeouts (#140119)
  test(gateway): retain saved source in reload fixtures (#140453)
  fix(gateway): reduce repeated model work when listing sessions (#140414)
  fix(feishu): fall back to post mode over table limit (#136382)
  fix: use the bundle-compatible Proxyline runtime under Bun (#140411)
  refactor(trace): reuse the canonical usage counter type (#140444)
  refactor(node-host): share execution policy result fields (#140446)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
* test(native): recheck completion before polling timeout

* test(macos): recheck completed coordinator waits at timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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