Skip to content

fix(ci): stabilize ChatViewModel concurrency tests - #110798

Merged
steipete merged 1 commit into
mainfrom
codex/fix-chat-viewmodel-test-flakes
Jul 18, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-chat-viewmodel-test-flakes

Conversation

@steipete

@steipete steipete commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Related: #110646 (CI evidence; unrelated product diff)

What Problem This Solves

Resolves a problem where the macos-swift lane could fail unrelated apps/ pull requests in shared OpenClawKit ChatViewModel tests. Run 29642644168 failed three attachment-owner XCTest subprocesses with signal 6 on attempt 1, then timed out the fork-navigation test on attempt 2.

Why This Change Was Made

The attachment tests now enter MainActor explicitly inside ordinary async XCTest methods, avoiding actor-isolated XCTest entry points. The fork test replaces a fixed delay plus polling with buffered start/release signals; a cancellation-aware watchdog bounds broken call paths without controlling normal ordering.

Production behavior is unchanged.

AI-assisted: yes (Codex).

User Impact

No user-visible product change. Maintainers get reliable macOS Swift validation for pull requests touching apps/.

Evidence

  • Before: run 29642644168 attempt 1 reported signal 6 for all three attachment identity-pinning tests.
  • Before: run 29642644168 attempt 2 timed out fork completion does not override newer navigation after 2 seconds.
  • swiftc -frontend -parse passes for both changed test files with the installed Swift 6.4 parser.
  • Targeted SwiftFormat lint and git diff --check pass.
  • Mandatory autoreview is clean after one accepted finding added cancellation-aware timeout cleanup to the deterministic gate; the final branch review reports no actionable findings at 0.97 confidence.
  • Exact-head CI run 29651434725 passes, including macos-swift, OpenClawKit tests, full Swift test, and the aggregate openclaw/ci-gate.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Jul 18, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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 Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 12:13 PM ET / 16:13 UTC.

Summary
The branch rewrites two OpenClawKit XCTest concurrency tests to enter MainActor explicitly and replace delay/polling synchronization with buffered async start/release gates.

PR surface: Other +75. Total +75 across 2 files.

Reproducibility: no. high-confidence current-main reproduction was completed. The PR provides specific prior hosted-CI failures in the two changed XCTest surfaces, which makes the reported test race source-reproducible but not presently reproduced on the current base.

Review metrics: none identified.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🌊 off-meta tidepool
Patch quality: 🦐 gold shrimp
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Rebase onto current main and obtain a passing exact-head macos-swift result.
  • Complete a full review of the changed tests, their OpenClawChatViewModel call path, sibling concurrency tests, and feature history.

Risk before merge

  • [P1] The PR is behind current main, so the concurrency-test change needs a refreshed exact-head macos-swift result after rebasing before maintainers can rely on its validation.
  • [P1] The read-only inspection environment failed before the required full source, scoped AGENTS.md, caller/sibling-test, and git-history review; no high-confidence correctness or ownership conclusion is justified yet.

Maintainer options:

  1. Decide the mitigation before merge
    Rebase onto current main, complete the macos-swift lane on the refreshed head, and perform a full OpenClawKit test-and-history review to confirm the gates model the intended fork ordering without masking a runtime regression.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] A maintainer should refresh the branch and complete the native CI/source review; this protected maintainer-labeled PR is not a safe automated repair candidate.

Security
Cleared: The supplied diff is confined to XCTest synchronization code and shows no dependency, workflow, credential, permission, package-resolution, or production security-surface change.

Review details

Best possible solution:

Rebase onto current main, complete the macos-swift lane on the refreshed head, and perform a full OpenClawKit test-and-history review to confirm the gates model the intended fork ordering without masking a runtime regression.

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

No high-confidence current-main reproduction was completed. The PR provides specific prior hosted-CI failures in the two changed XCTest surfaces, which makes the reported test race source-reproducible but not presently reproduced on the current base.

Is this the best way to solve the issue?

Unclear. Replacing timer-driven ordering with explicit async gates is plausibly the narrowest test-only solution, but a full read of the changed tests, OpenClawChatViewModel fork behavior, and sibling concurrency tests is still required to establish that it is the best fix.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 3e8f1c6448a5.

Label changes

Label changes:

  • add P2: This targets flaky shared macOS test execution that can interrupt validation for otherwise unrelated app changes, without evidence of a user-facing production outage.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-labeled test-only PR documents prior hosted CI failures and targeted static checks; the external contributor real-behavior-proof gate is not applicable, while refreshed macos-swift CI remains the relevant merge evidence.

Label justifications:

  • P2: This targets flaky shared macOS test execution that can interrupt validation for otherwise unrelated app changes, without evidence of a user-facing production outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-labeled test-only PR documents prior hosted CI failures and targeted static checks; the external contributor real-behavior-proof gate is not applicable, while refreshed macos-swift CI remains the relevant merge evidence.
Evidence reviewed

PR surface:

Other +75. Total +75 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 179 104 +75
Total 2 179 104 +75

What I checked:

Likely related people:

  • steipete: The author proposed this focused OpenClawKit test repair and also recently landed related macOS/OpenClawKit work, but the required local feature-history search was unavailable, so ownership attribution remains tentative. (role: recent adjacent OpenClawKit contributor; confidence: low; commits: 52e57199cc85, 42133d0c3c3e; files: apps/shared/OpenClawKit/Tests/OpenClawKitTests/ChatViewModelAttachmentTests.swift, apps/shared/OpenClawKit/Tests/OpenClawKitTests/ChatViewModelSessionActionTests.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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 837db49 into main Jul 18, 2026
98 of 104 checks passed
@steipete
steipete deleted the codex/fix-chat-viewmodel-test-flakes branch July 18, 2026 16:47
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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