Skip to content

test(cmux-next): HomeDock allow_tabs wait: replacement, end when Home's page goes, no polling (#30826 review follow-ups) - #30888

Merged
cmux-bot[bot] merged 5 commits into
feat-cmux-nextfrom
fix/fc1-home-dock-allow-tabs-followups
Nov 1, 2026
Merged

cmux-bot[bot] merged 5 commits into
feat-cmux-nextfrom
fix/fc1-home-dock-allow-tabs-followups

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Review follow-ups to #30826 (Home's dock takes tabs once the tree reports its ids). This PR changes tests and one comment only, with no behavior change.

From the independent review of #30826 (#30826 (comment)):

  • Continuation: HomeDockAllowTabsTests no longer loops 2000 Task.yield calls (REVIEW.md section 6). The recorded request resumes a continuation (Sent.next(after:)), and the test also awaits the wait task itself. The suite's time limit bounds a request that never comes.
  • UserDefaults cleanup: each test removes its UserDefaults suite (removePersistentDomain), so no plist is left on the test host.
  • Two new tests:
    • aLaterStepReplacesTheWait: two steps with no ids, then the ids. Exactly one column.update goes, and the first wait ends with none.
    • theWaitEndsWhenHomesPageIsGone: the wait ends when Home's page leaves the tree, and the ids arriving later send nothing.
  • HomeDock:
    • A comment says why the wait keeps the HomeDock across its await. A window Home makes a HomeDock per connect and keeps none, so a later "fix" to a weak capture would break it.
    • allowTabsWait is private(set) so the tests can await it.

Changelog

none

Testing

These are new and changed tests. They cover behavior #30826 already added, so there is no red commit. They pass at the base of this change: the HomeDock behavior is #30826's, unchanged here.

  • Compile: cmux-ci compile-check --app --package CmuxNext --recipe-version 2 job 6c98bb17a942958e881d7ac8 passed at 43924e7 (before the merge of feat). Job bf17cd1e372f688d77a98f09 runs at the head f842b96.
  • Display worker, CMUX_TEST_REQUIRE_GUI=1, HomeDockAllowTabsTests: GREEN_RESULT

Observed / Not run

  • Observed: the compile-check above and prepush-gate.py with no new violations.
  • Not run: the full CmuxNextHomeEngineTests suite.

perf claim: none


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Review follow-ups to #30826; tests and one comment only, with no behavior change.

  • HomeDockAllowTabsTests no longer loops 2000 Task.yield calls — a recorded request resumes a continuation, and each test awaits the wait task itself.
  • Each test removes its UserDefaults suite, so no plist is left on the test host.
  • Two new tests: a later step replaces the wait (exactly one allow_tabs request when the ids come), and the wait ends when Home's page leaves the tree.
  • HomeDock.allowTabsWait is now private(set) for the tests, and a comment explains why the wait holds the HomeDock across its await.

Written for commit f842b96. Summary will update on new commits.

View guided diff Turn on auto-fix

… ids (FC-1 follow-up)

HomeDock's allow-tabs step needs the dock's screen and pane resource ids;
with none in the tree yet it returned 'waits for resource ids' and nothing
ran it again until the next connection, so Home's pinned dock took no tab
for the whole launch. The test applies a tree without the ids, runs the
step, then applies the ids and expects one column.update. A seam passes the
request in (no behavior change). Red on the base.
… not at the next connect (FC-1 follow-up)

HomeDock's allow-tabs step (column.update {allow_tabs: true}) needs the
dock's screen and pane resource ids. When the tree had none yet, it
returned and only the next connection tried again, so Home's pinned dock
could take no tab for the whole launch: every new tab aimed at it was
refused (dock-column-pinned) or had to open beside it. The step now arms
one wait on the store's records (ObservationStream, no timer) and runs
again when the ids first show; a later step replaces the wait, and it
ends when Home's page is gone.

Regression test: HomeDockAllowTabsTests (red at the commit before).
…me's page goes, no polling (FC-1 follow-up review notes)

Review notes on #30826: the test's Task.yield loop becomes a continuation
the recorded request resumes; the test's UserDefaults suite is removed;
two tests cover a later step replacing the wait (one request when the ids
come) and the wait ending when Home's page is gone. HomeDock: a comment on
why the wait holds the dock across its await (window Homes keep no
HomeDock), and allowTabsWait is readable for the tests. No behavior change.
…e-dock-allow-tabs-followups

# Conflicts:
#	Packages/macOS/CmuxNext/Sources/CmuxNextHomeEngine/HomeDock.swift
#	Packages/macOS/CmuxNext/Tests/CmuxNextHomeEngineTests/HomeDockAllowTabsTests.swift
@lawrencecchen lawrencecchen added the risk:low Risk tier (docs/ci/risk-tiers.md) label Nov 1, 2026
@github-actions github-actions Bot added risk:normal Risk tier (docs/ci/risk-tiers.md) and removed risk:low Risk tier (docs/ci/risk-tiers.md) labels Nov 1, 2026

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 2 files

You’re at about 92% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Packages/macOS/CmuxNext/Sources/CmuxNextHomeEngine/HomeDock.swift">

<violation number="1" location="Packages/macOS/CmuxNext/Sources/CmuxNextHomeEngine/HomeDock.swift:241">
P2: The resource-ID wait can disappear for window Homes before it observes the IDs. `WindowHomes.ensureDock` creates `HomeDock()` as a temporary, while this task captures `self` weakly; after `ensure` returns, the task can start with `self == nil` and never send `allow_tabs`. Retain the dock for the run or capture it strongly with cancellation-safe cleanup instead of relying on this weak capture.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

return placed.screen.resourceID != nil && placed.pane.resourceID != nil ? true : nil
}
// `self?.shown` holds this HomeDock across the await on purpose: a window Home makes a HomeDock per connect
// (`WindowHomes.ensureDock`) and keeps none, so the wait is what keeps it until the ids come or the page goes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The resource-ID wait can disappear for window Homes before it observes the IDs. WindowHomes.ensureDock creates HomeDock() as a temporary, while this task captures self weakly; after ensure returns, the task can start with self == nil and never send allow_tabs. Retain the dock for the run or capture it strongly with cancellation-safe cleanup instead of relying on this weak capture.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At Packages/macOS/CmuxNext/Sources/CmuxNextHomeEngine/HomeDock.swift, line 241:

<comment>The resource-ID wait can disappear for window Homes before it observes the IDs. `WindowHomes.ensureDock` creates `HomeDock()` as a temporary, while this task captures `self` weakly; after `ensure` returns, the task can start with `self == nil` and never send `allow_tabs`. Retain the dock for the run or capture it strongly with cancellation-safe cleanup instead of relying on this weak capture.</comment>

<file context>
@@ -237,6 +237,8 @@ public final class HomeDock {
                 return placed.screen.resourceID != nil && placed.pane.resourceID != nil ? true : nil
             }
+            // `self?.shown` holds this HomeDock across the await on purpose: a window Home makes a HomeDock per connect
+            // (`WindowHomes.ensureDock`) and keeps none, so the wait is what keeps it until the ids come or the page goes.
             guard await self?.shown(identified) == true, !Task.isCancelled, let self else { return }
             allowTabsWait = nil // the step below must not cancel the task it runs in
</file context>

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 0a4c836 to compare; do not merge until green; see lane-rules

Shipped in:

@blacksmith-sh

blacksmith-sh Bot commented Nov 1, 2026

Copy link
Copy Markdown

Found 4 test failures on Blacksmith runners:

Failures

Test View Logs
main.DeveloperIdAppTests.test_download_prints_the_active_profile_only/
test_download_prints_the_active_profile_only
View Logs
stubs: /System/Library/Frameworks/Security.framework/Versions/A/Security has no stub/
Security has no stub
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_CFRetain']/
CoreFoundation, missing 1: ['_CFRetain']
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_log2']/
CoreFoundation, missing 1: ['_log2']
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator

Review (codex gpt-6-astra high, next-review): SHIP at f842b96

SHIP at f842b96

Visual verdict: unchanged by this diff

Follow-ups: none

@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 21:26 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 21:26 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 21:27 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 21:31 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 21:32 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 21:33 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 21:33 Inactive
@cmux-bot
cmux-bot Bot merged commit ef43251 into feat-cmux-next Nov 1, 2026
189 of 192 checks passed
@cmux-bot
cmux-bot Bot deleted the fix/fc1-home-dock-allow-tabs-followups branch November 1, 2026 21:34

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 03e7d256 Deployed Nov 1, 2026 by cmux-bot[bot] via wait for same-key tree publisher #97567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants