Skip to content

Integrate current-main check repairs - #8941

Merged
lawrencecchen merged 35 commits into
mainfrom
task-integrate-web-determinism-repairs
Jul 26, 2026
Merged

lawrencecchen merged 35 commits into
mainfrom
task-integrate-web-determinism-repairs

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Integrates seven exact reviewed heads, including repairs that could not merge independently against earlier main:

Every source head and current main are ancestors. After #8891 and #8892 landed independently, the reviewed output-order and Bun-version repairs were retained while reconciling current main. The remaining diff is 11 paths.

Validation

  • bash tests/test_ci_self_hosted_guard.sh
  • python3 scripts/check-test-determinism.py --strict (0 findings)
  • swift test --package-path Packages/iOS/CmuxMobileTerminalKit --filter TerminalDockKeyboardTransitionPlannerTests (6 passed)
  • cd web && bun run test (1,012 tests: 890 passed, 122 skipped, 0 failed) after current-main reconciliation
  • cd web && bun run typecheck after current-main reconciliation
  • swift test --package-path Packages/macOS/CmuxTerminal linked and passed all 118 tests in 19 suites; SwiftPM then emitted the workflow-tolerated unexpected-binary-name diagnostic
  • Tagged macOS 26 build: https://github.com/manaflow-ai/cmux/actions/runs/30182008958

Bun 1.2.14 reproduced 14 mock-isolation failures. The runner and required web job now enforce Bun 1.3.14, with behavioral rejection tests for 1.2.14 and 1.3.13.

Exact-head automated reviews and speculative merge CI are rerun after every head change.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@lawrencecchen, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 6 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 95ccace9-83d8-4975-b595-1763bf8eeca2

📥 Commits

Reviewing files that changed from the base of the PR and between b4a1ab2 and 17bf72e.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • tests/test_ci_self_hosted_guard.sh
  • web/scripts/run-tests.sh
📝 Walkthrough

Walkthrough

The PR adds an isolated Bun test runner, routes web package and CI execution through it, adds regression coverage, updates an iOS duration assertion, adjusts Swift defaults and state handling, adds a Ghostty test stub, and applies concurrency-related fixes.

Changes

Shared web test runner

Layer / File(s) Summary
Isolated web test runner
web/package.json, web/scripts/run-tests.sh
The web test script delegates to a Bash runner that handles Bun discovery, deterministic file discovery, argument forwarding, configuration, isolation, and no-test failures.
Runner integration and regression coverage
.github/workflows/ci.yml, web/tests/web-test-runner-isolation.test.ts, tests/test_ci_self_hosted_guard.sh
CI and regression checks cover ordering, filters, configuration, live modes, forwarding, ignored fixtures, and failure handling.

Swift behavior and warning updates

Layer / File(s) Summary
Optional defaults and state-based reconfiguration
Sources/ContentView.swift, Sources/ClosedWorkspaceHistory.swift, Sources/Sidebar/AppKitList/Cells/SidebarGroupHeaderRowView.swift
Initializers and reopening methods accept optional values with shared fallbacks, and sidebar full-apply decisions use stored actions state.
Concurrency and collection warning fixes
Sources/NotificationFeedHistoryStore.swift, Sources/TerminalController+MobileNotificationSync.swift, Sources/Mobile/MobileTerminalRenderGridAnchorRegistry.swift
Persistence snapshot consumption is synchronous, the response limit is nonisolated, and anchor-removal results are explicitly discarded.

iOS transition duration assertion

Layer / File(s) Summary
Synthesized duration expectation
Packages/iOS/CmuxMobileTerminalKit/Tests/CmuxMobileTerminalKitTests/TerminalDockKeyboardTransitionPlannerTests.swift
The test computes the remaining fraction and expected duration, then directly asserts the planner’s animation result.

Ghostty runtime test stubs

Layer / File(s) Summary
Render-grid stub symbol
Packages/macOS/CmuxTerminal/Tests/GhosttyRuntimeTestStubs/*
The Ghostty test stub implementation and header add ghostty_surface_render_grid_json_v2.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CI
  participant WebPackage
  participant RunTests
  participant Bun
  CI->>WebPackage: run bun run test
  WebPackage->>RunTests: execute scripts/run-tests.sh
  RunTests->>Bun: run test --isolate with discovered files or forwarded discovery options
  Bun-->>RunTests: return test results
  RunTests-->>CI: return test status
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 23 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning It has a useful summary and validation notes, but it omits the template’s Testing, Demo Video, Review Trigger, and Checklist sections. Add the missing template sections: Testing, Demo Video if applicable, Review Trigger, and a completed Checklist.
✅ Passed checks (23 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed Touched Swift code stays on MainActor or uses explicit nonisolated/lock-backed patterns; no new unsafe background access to UI-bound stores or Sendable refs.
Cmux Swift Blocking Runtime ✅ Passed No production Swift change adds blocking or timing sync; the Swift hunks are refactors/test-only, with existing locks/timers unchanged.
Cmux Browser Automation Off-Main ✅ Passed The diff only touches web test-runner scripts/tests; no browser.* socket commands, worker routing, or WebKit/AppKit main-hop changes were introduced.
Cmux Expensive Synchronous Load ✅ Passed No production Swift change adds or moves RestorableAgentSessionIndex.load()/similar heavy parsing onto a main-actor or interactive path; edits are unrelated defaults/cleanup.
Cmux Cache Substitution Correctness ✅ Passed No production change swapped a fresh authoritative read for a stale cache; the history store still persists event-driven snapshots, and the workspace history API change only makes the store paramet...
Cmux No Hacky Sleeps ✅ Passed New web runner uses find/sort and Bun delegation only; no fixed sleeps, polling, or delayed dispatch were added in runtime scripts.
Cmux Algorithmic Complexity ✅ Passed The only production change is a single repo scan+sort in the web test runner; it’s not a hot user-data path and adds no nested/full rescans.
Cmux Swift Concurrency ✅ Passed Diff only tweaks signatures and internal logic; it adds no new background DispatchQueue, Combine app-state, completion-handler APIs, or unmanaged fire-and-forget Tasks.
Cmux Swift @Concurrent ✅ Passed The edited async paths already hop off the main actor via await persistence.persist or Task.detached; the diff only makes local accesses synchronous and adds a nonisolated static let.
Cmux Swift Package Boundaries ✅ Passed The Swift hunks are small app/UI/glue refactors; no new reusable domain feature was introduced or expanded in the app target.
Cmux Swiftpm Lockfiles ✅ Passed Merge diff only changes tests/web runner files; no Package.swift, Package.resolved, .gitignore, or Xcode project files changed, so the SwiftPM lockfile rule isn't triggered.
Cmux Swift Logging ✅ Passed No diffed production Swift file adds or materially changes print/NSLog/Logger usage; the Swift edits are non-logging logic changes or tests.
Cmux User-Facing Error Privacy ✅ Passed Only new user-facing copy is generic runner output (“Web test discovery failed” / “No web test files found”); no vendor/internal details are exposed.
Cmux Full Internationalization ✅ Passed The diff only changes tests and the web test runner script; no user-facing Swift/web copy or locale assets were added or altered.
Cmux Swiftui State Layout ✅ Passed SwiftUI hunks only tweak ContentView init nil-coalescing and an AppKit bridge reuse check; no new state/layout anti-patterns were introduced.
Cmux Architecture Rethink ✅ Passed The Swift diffs are local correctness fixes; they don’t add sleeps, polling, observers, side channels, duplicate wiring, or split lifecycle ownership. Test-only sync stays in Tests/.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed No Swift files changed in this commit; only web runner/test files moved, so the auxiliary-window shortcut rule isn’t implicated.
Cmux Source Artifacts ✅ Passed All changed paths are intentional source/config/test files; no logs, caches, build output, temp dirs, or downloaded artifacts are added.
Cmux No Test Or Debug Seam In Production Source ✅ Passed PASS: The touched Sources hunks only adjust defaults, nil-coalescing, actor isolation, and bookkeeping; no new DEBUG/test-hook seam appears in production source.
Cmux No Ambient Global State ✅ Passed HEAD only changes web runner/test files; no production Swift diff exists to violate ambient-global-state rules.
Title check ✅ Passed The title is concise and matches the main change: repairing current-main check integration.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task-integrate-web-determinism-repairs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Integrates current-main compatibility repairs across native and web test infrastructure.

  • Pins the required web CI job to Bun 1.3.14 and makes the shared web test runner reject older versions.
  • Repairs Swift concurrency warnings and default-argument isolation without changing production behavior.
  • Updates Ghostty test stubs and makes concurrent Bun test-output assertions order-independent.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains in the reviewed changes.

Important Files Changed

Filename Overview
web/scripts/run-tests.sh Adds a minimum Bun version check before preserving the existing test-discovery and argument-forwarding behavior.
.github/workflows/ci.yml Pins the web typecheck and test job to the Bun version required for mock isolation.
Sources/NotificationFeedHistoryStore.swift Removes redundant awaits inside a Task that inherits the store's main-actor isolation.
Sources/ClosedWorkspaceHistory.swift Moves shared history-store resolution into actor-isolated method bodies while preserving existing caller behavior.
Sources/TerminalController+MobileNotificationSync.swift Marks an immutable frame-size constant nonisolated for safe worker access.
web/tests/web-test-runner-isolation.test.ts Stops assuming deterministic reporting order while continuing to verify that every discovered test executes.
Packages/macOS/CmuxTerminal/Tests/GhosttyRuntimeTestStubs/GhosttyRuntimeTestStubs.c Adds the missing render-grid-v2 symbol needed to link the terminal package tests.

Reviews (8): Last reviewed commit: "Merge current main before integration ga..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/tests/web-test-runner-isolation.test.ts`:
- Around line 105-110: Remove the fixed timeout and its associated killSignal
option from the spawnSync invocation in the test harness. Keep the existing
command, arguments, working directory, and encoding unchanged so cancellation
remains owned by the harness.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 54083722-f668-48b0-91c9-c45a5ef80835

📥 Commits

Reviewing files that changed from the base of the PR and between 51ddd42 and 9d03ceb.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • Packages/iOS/CmuxMobileTerminalKit/Tests/CmuxMobileTerminalKitTests/TerminalDockKeyboardTransitionPlannerTests.swift
  • tests/test_ci_self_hosted_guard.sh
  • web/package.json
  • web/scripts/run-tests.sh
  • web/tests/web-test-runner-isolation.test.ts

Comment thread web/tests/web-test-runner-isolation.test.ts
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

CodeRabbit's Cmux No Hacky Sleeps prose finding is a false positive. spawnSync(... timeout: 30_000, killSignal: "SIGKILL") does not sleep or wait after fixture completion; it bounds a child test process so a recursive runner regression cannot hang CI indefinitely. The fixture completes in milliseconds locally, and the exact speculative gate is the timing authority. No source change is warranted.

@lawrencecchen lawrencecchen changed the title Integrate web test isolation and deterministic dock assertion Integrate current-main check repairs Jul 26, 2026
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12ec8e1168

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web/scripts/run-tests.sh Outdated
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Sources/NotificationFeedHistoryStore.swift`:
- Around line 245-250: Update the persistence loop around
consumePendingPersistenceSnapshot and
NotificationFeedHistoryPersistence.persist(_:) to remove the unnecessary await
when calling the synchronous persist method; keep the existing snapshot
consumption and finishPersistenceTask flow unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 71ef8ca4-0a88-40b9-9f09-70e1178864e0

📥 Commits

Reviewing files that changed from the base of the PR and between 5b1372b and 24cc58a.

📒 Files selected for processing (10)
  • Packages/macOS/CmuxTerminal/Tests/GhosttyRuntimeTestStubs/GhosttyRuntimeTestStubs.c
  • Packages/macOS/CmuxTerminal/Tests/GhosttyRuntimeTestStubs/include/GhosttyRuntimeTestStubs.h
  • Sources/ClosedWorkspaceHistory.swift
  • Sources/ContentView.swift
  • Sources/Mobile/MobileTerminalRenderGridAnchorRegistry.swift
  • Sources/NotificationFeedHistoryStore.swift
  • Sources/TerminalController+MobileNotificationSync.swift
  • tests/test_ci_self_hosted_guard.sh
  • web/scripts/run-tests.sh
  • web/tests/web-test-runner-isolation.test.ts

Comment thread Sources/NotificationFeedHistoryStore.swift

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24cc58a1d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web/scripts/run-tests.sh
exit 1
fi

exec bun test --isolate "${test_files[@]}" "$@"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Run mocked test files in genuinely separate processes

When the complete web suite runs, --isolate still executes every file in one Bun process and does not prevent the repository's process-global mock.module state from contaminating later files (this behavior is also documented in web/tests/dashboard-billing-page.test.tsx). With Bun 1.2.14, bash scripts/run-tests.sh deterministically adds 10 founders-welcome-route.test.ts failures, while the previous sorted invocation has none of those failures; the new focused test passes only because it runs two hand-picked files without the earlier module loads. Since the workflow now calls this default path, web CI needs per-file processes or another mechanism that actually resets the module registry.

Useful? React with 👍 / 👎.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Exact integration head is 20ee08093493110d69140277cac33853d1eda77f. Every listed source head is an ancestor; the final tree exactly matches the reviewed repair head. Local guard, full Bun 1.3.14 suite, and typecheck pass.

@codex review
@greptileai review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

@lawrencecchen: Thanks for the integration and validation details. I’ll review the current PR state, including the final integration head.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

# Conflicts:
#	tests/test_ci_self_hosted_guard.sh
#	web/scripts/run-tests.sh
#	web/tests/web-test-runner-isolation.test.ts
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Exact head is 17bf72e1141e9092fe366b84d125737eb0b2d497, with current main 265d1763c4 merged. The three web conflicts retain the reviewed output-order and Bun 1.3.14 repairs; guard, full 1,012-test web suite, and typecheck pass.

@codex review
@greptileai review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

@lawrencecchen: Thanks for the updated integration-head and validation details. I’ll review the current PR state.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 17bf72e114

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lawrencecchen
lawrencecchen merged commit 7c82622 into main Jul 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant