Skip to content

fix(macos): prevent dashboard fixture loopback timeouts - #139556

Merged
steipete merged 2 commits into
mainfrom
codex/fix-dashboard-fixture-loopback
Sep 6, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/fix-dashboard-fixture-loopback

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where macos-swift (tests) intermittently fails an unrelated PR because DashboardHTTPFixtureTests times out fetching inert loopback HTML. The reported failure is run 33999463775, macos-swift (tests) on #139522: the first URLSession request fails with NSURLErrorDomain -1001 after 2.627 seconds; the suite reports one issue across 2,042 tests.

Why This Change Was Made

The fixture already waits for NWListener.State.ready, starts its two listeners sequentially, uses distinct ephemeral ports, disables URLSession caches, and replies with Connection: close. The transport instead depends on the main queue for accepting connections, reading headers, sending responses, and cleanup. Parallel native tests can occupy that queue, including deliberate semaphore stalls in TalkModeRuntimeSpeechTests. A TCP handshake can complete while the application callbacks remain queued until after the two-second request deadline. The original log does not identify which callback was delayed.

The repair gives each fixture a private serial transport queue and installs its real connection handler before starting the listener, as Network.framework requires. Existing main-actor response hooks remain isolated there, with cancellation when their client closes. Startup still waits for .ready; request deadlines, assertions, connection limits, and header bounds remain unchanged.

User Impact

Developers get reliable dashboard fixture HTTP responses even while other native tests occupy the main actor. This is test support only; shipped app behavior does not change.

Evidence

  • Adds a child-process regression that holds the main actor synchronously until a URLSession completion arrives, then requires HTTP 200 and the exact inert body. Its request timeout remains two seconds. The child prevents the deliberate stall from affecting parallel suites.
  • Before repair: run 34001430025 on f4ae221bd18b2fee0c1c0ba14d5d444f22f07f07 failed only the new regression at its HTTP-success assertion (2,052 tests, one issue). Both existing fixture tests passed. This reproduces the main-queue dependency without relying on random suite scheduling.
  • Local: full swift build --package-path apps/macos --build-system native --build-tests passed after generating the standard Apple Mermaid resources; changed-file checks, Swift formatting, native localization verification, and independent review passed.
  • After repair: run 34002395536, first attempt on 69680abe79042e58d84866ad9b44b9facf26d668 passed the complete DashboardHTTPFixtureTests suite, including the new blocked-main-actor regression. The only issue across 2,053 tests was the unchanged PipeReadStreamTests cleanup join timing out at line 39; it passed in the preceding run and does not use this fixture. The same-head rerun passed, including all 2,053 app tests, the two named-profile tests, 1,655 shared-kit tests, the original fixture tests, the new regression, and the pipe cleanup test. The required CI gate is green. No timeout or assertion changed; the pipe test remains a separate follow-up.
  • Native tests are compiled only on the local operator desktop; execution is reserved for disposable macOS CI.

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

@steipete
steipete marked this pull request as ready for review September 6, 2026 00:29
@openclaw-barnacle openclaw-barnacle Bot added app: macos App: macos size: S maintainer Maintainer-authored PR labels Sep 6, 2026
Install the real connection handler before starting the listener and serialize transport state on a fixture-owned queue. Preserve MainActor response hooks and cancel retired client tasks. Keep request timeouts unchanged.
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 5, 2026, 9:19 PM ET / September 6, 2026, 01:19 UTC.

ClawSweeper review

What this changes

Moves the macOS dashboard test server onto a private transport queue and adds a regression checking HTTP responses while the main actor is blocked.

Merge readiness

✅ Ready for maintainer review

The repair remains necessary: current main retains the main-queue dependency. The earlier missing-repair finding is resolved, and no introduced correctness or security defect was found.

Priority: P2
Reviewed head: 69680abe79042e58d84866ad9b44b9facf26d668

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful regression coverage and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The contributor-proof gate does not apply to this maintainer-authored test-support repair. The captured evidence reports real URLSession-to-Network.framework execution under a blocked main actor, failing before and passing after repair; linked logs could not be independently retrieved.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The contributor-proof gate does not apply to this maintainer-authored test-support repair. The captured evidence reports real URLSession-to-Network.framework execution under a blocked main actor, failing before and passing after repair; linked logs could not be independently retrieved.
Evidence reviewed 7 items Current main still needs the repair: Current main starts the listener and connections on the main queue. Comparing the merge base with fetched main shows no changes to either reviewed fixture file.
Latest release retains the original fixture: The supplied latest release commit contains fixture blob 984958d845033123febcf7de03795accca48ba45, matching the pre-repair fixture in the pinned introduced diff.
Transport ownership and cleanup: The private queue serializes acceptance, receive callbacks, response sending, deadlines, and client removal. Optional hooks remain on MainActor; close cancels their tasks, and response dispatch checks that the client still exists. Loopback binding, TLS configuration, CSP, header bounds, and connection limits remain intact.
Findings None None.
Security None None.

How this fits together

The dashboard HTTP fixture serves local HTML and optional custom responses to macOS native tests. Its transport scheduling affects test reliability without changing the shipped app.

flowchart LR
 A[Native test client] --> B[Loopback listener]
 B --> C[Private transport queue]
 C --> D{Response hooks configured?}
 D -->|No| F[HTTP response]
 D -->|Yes| E[Main actor hooks]
 E --> C
 F --> G[Client cleanup]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Other +59. Total +59 across 2 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 2 143 84 +59
Total 2 143 84 +59

Review metrics

None.

Technical review

Best possible solution:

Keep fixture transport independent of UI scheduling while preserving main-actor hooks, bounded requests, and deterministic teardown.

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

Yes: current main requires main-queue callbacks to serve HTTP, and the regression synchronously blocks that queue during a request. The PR reports a before/after native run; this review established the mechanism from source without executing it.

Is this the best way to solve the issue?

Yes: moving transport ownership off MainActor addresses the scheduling dependency directly without increasing timeouts or weakening assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8214179fe29c.

Labels

Label justifications:

  • P2: This is a bounded native test reliability repair with no shipped application 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 contributor-proof gate does not apply to this maintainer-authored test-support repair. The captured evidence reports real URLSession-to-Network.framework execution under a blocked main actor, failing before and passing after repair; linked logs could not be independently retrieved.

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)
  • Omar Shahine: 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 (2 earlier review cycles)
  • reviewed 2026-09-06T00:34:56.166Z sha f4ae221 :: needs changes before merge. :: [P2] Include the transport repair before landing the regression
  • reviewed 2026-09-06T00:56:45.357Z sha 69680ab :: needs maintainer review before merge. :: none

@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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 6, 2026
@steipete
steipete merged commit 2c26114 into main Sep 6, 2026
112 of 114 checks passed
@steipete
steipete deleted the codex/fix-dashboard-fixture-loopback branch September 6, 2026 01:38
@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 '047587a542ce205ee78354fbd88ba8ec05c07844': (45 commits)
  chore(ui): refresh control ui locales (#139481)
  fix(slack): keep prototype-named emoji shortcodes intact (#136374)
  fix(gateway): deliver upgrade rejection responses under Bun (#139516)
  refactor(test): simplify catalog guards and fix native report fixture (#139496)
  fix(macos): prevent dashboard fixture loopback timeouts (#139556)
  fix(matrix): preserve selected reply targets inside threads (#139479)
  test(gateway): preserve held-work close failures (#139593)
  refactor(exec): share package argument scanning (#139560)
  fix(audit): preserve sequence range validation before numeric decoding (#139587)
  fix(transcripts): retain capture ownership through failed cleanup (#139572)
  refactor(models): share selector reference traversal (#139571)
  perf(agents): classify allowlists without intermediate sets (#138392)
  chore(release): update appcast for 2026.9.2 (#139575)
  fix(ci): synchronize cloud retries and board widget input (#139506)
  fix(plugins): explain SDK incompatibilities after core updates (#139458)
  fix(voice-call): retain installed WebSocket behavior under Bun (#139567)
  test(text): consolidate literal sanitizer cases (#139579)
  test(gateway): observe native drain without a lint exception (#139576)
  test(memory): consolidate visibility fixtures without policy defaults (#139569)
  fix(ui): show shimmer skeletons while loading Control UI (#139525)
  ...
vincentkoc added a commit that referenced this pull request Sep 6, 2026
* origin/main:
  fix(cli): keep note text with Windows and Unicode line endings (#139512)
  fix(agents): keep isolated completion context on its admitted generation (#139607)
  fix: avoid declaration builds during source-server updates (#139392)
  fix(models): keep discovered models after catalog refresh failures (#139357)
  fix(gateway): record a transcript notice when a run fails before replying (#139439)
  refactor(ios): reuse shared integer conversion (#139581)
  fix(sessions): prevent database lock failures during reclamation (#139469)
  perf(test): reuse transforms within owned scheduler slots (#139553)
  test(agents): share sparse transcript input fixtures (#139589)
  chore(ui): refresh control ui locales (#139481)
  fix(slack): keep prototype-named emoji shortcodes intact (#136374)
  fix(gateway): deliver upgrade rejection responses under Bun (#139516)
  refactor(test): simplify catalog guards and fix native report fixture (#139496)
  fix(macos): prevent dashboard fixture loopback timeouts (#139556)
  fix(matrix): preserve selected reply targets inside threads (#139479)
vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit 'refs/openclaw/tasks/pr-135167-main': (2467 commits)
  refactor(ios): reuse shared integer conversion (#139581)
  fix(sessions): prevent database lock failures during reclamation (#139469)
  perf(test): reuse transforms within owned scheduler slots (#139553)
  test(agents): share sparse transcript input fixtures (#139589)
  chore(ui): refresh control ui locales (#139481)
  fix(slack): keep prototype-named emoji shortcodes intact (#136374)
  fix(gateway): deliver upgrade rejection responses under Bun (#139516)
  refactor(test): simplify catalog guards and fix native report fixture (#139496)
  fix(macos): prevent dashboard fixture loopback timeouts (#139556)
  fix(matrix): preserve selected reply targets inside threads (#139479)
  test(gateway): preserve held-work close failures (#139593)
  refactor(exec): share package argument scanning (#139560)
  fix(audit): preserve sequence range validation before numeric decoding (#139587)
  fix(transcripts): retain capture ownership through failed cleanup (#139572)
  refactor(models): share selector reference traversal (#139571)
  perf(agents): classify allowlists without intermediate sets (#138392)
  chore(release): update appcast for 2026.9.2 (#139575)
  fix(ci): synchronize cloud retries and board widget input (#139506)
  fix(plugins): explain SDK incompatibilities after core updates (#139458)
  fix(voice-call): retain installed WebSocket behavior under Bun (#139567)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
)

* test(macos): reproduce dashboard fixture main-actor timeout

* fix(macos): serve dashboard fixtures off the main queue

Install the real connection handler before starting the listener and serialize transport state on a fixture-owned queue. Preserve MainActor response hooks and cancel retired client tasks. Keep request timeouts unchanged.
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: 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