Skip to content

Fix last unowned app-host unit test failures - #13678

Merged
teamleaderleo merged 2 commits into
manaflow-ai:fix/app-host-greenfrom
teamleaderleo:fix/app-host-last-unowned
Sep 22, 2026
Merged

teamleaderleo merged 2 commits into
manaflow-ai:fix/app-host-greenfrom
teamleaderleo:fix/app-host-last-unowned

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes the remaining unowned app-host failures from #13643 run 35735052149. Focus, geometry, and sidebar failures are owned elsewhere.

Product fix

  • TabManagerSessionSnapshotTests.testSessionSnapshotPersistsRemoteSurfaceProjectionsAndRestoreRelinksThem: product regression. TabManager.restoreSessionSnapshot restores projections before it assigns tabs, so the ownership check in SurfaceCatalog.restore (eb3edd7/42f1ab4a07) never finds the workspace. It then silently drops every restored Cloud projection. That is why registering the TabManager (test: repair session-restore, CLI, shell, and Cloud placement app-host tests #13657) didn't help. Fix: restore checks ownership against the workspace being restored (restoringWorkspace:), using the same ownershipRejection policy.

Stale tests or test bugs

  • CLINotify…testSSHSessionAttachCreatesSurfaceWithPersistedPTYSessionID: stale. fix: make SSH auth cleanup fork resilient #11497 added an auth-event-token uuidgen, which took the raw count from 2 to 4. The test now makes exact assertions for the attempt, lifecycle, and auth-token UUIDs.
  • "Device mirror directories stay visible…": test bug. e3d424c shows a device's workspaces and terminals only behind a trusted live link, and the fake device had no presence. Fix: give it .sameAccount online presence.
  • "workspace font-size adjustment reaches remote tmux mirrors…": test bug from e6926fb. The mirrors inherit 8pt, so the -1/-3 deltas landed at 7/5, not 6/4. Deltas are now -2/-4, and the test asserts the 8pt base.
  • grantedPermissionsResumeIncompleteSetupFromSettingsRefresh: test bug from Fix Computer Use granted-permission setup recovery #13599. In the raw string #"{\"ok\"…}"# the fake daemon's reply is invalid JSON, so every refresh timed out as unknown. Removed the escapes.
  • presenterUsesStandaloneCompletionWithoutRunningNestedModalLoop: host-dependent geometry. Where NSAlert stacks its buttons, each button's frame carries about 6pt of bezel padding. The test now compares alignmentRect(forFrame:), and the no-overlap assertion is kept.
  • splitFromLocalResumedAgentPaneInsideRemoteWorkspaceUsesSessionCwdRescue: stale. Since Fix SSH split panes inheriting the remote CWD #12054, SSH-startup splits carry cwd in CMUX_REMOTE_INITIAL_CWD, and requestedWorkingDirectory is nil. The test asserts that the rescued directory arrives there.
  • TabManagerChildExitCloseTests.testDefaultFreestyleCloudSplit…: stale. Since fa5dc4c, managed-Cloud SSH panes are Cloud-owned, and their splits route to the provider or fail closed. The test keeps the startup-command repair assertions, which now run on effectiveRemoteTerminalStartupCommand, and asserts the Cloud routing.

Not changed

  • WorkspaceTerminalFocusRecoveryTests hidden-tiny deferral (2 tests): test: pin key-window focus, rebind retired terminals, diagnose tmux divider parity #13672's KeyStatusTestWindow already reaches these tests through makeWindow(). The failing stats also show windowIsKey: true, appIsActive: true, so this isn't key status. The cause is unproven; the suspect is the workspace visibility sync re-showing the panel before the test's reveal. That needs a local run with focus logs.

Checks: swiftc -parse on the edited files, test_ci_pbxproj_test_wiring.sh, check-test-determinism.py. The fixes have not been run yet; this PR's CI is the first run.

🤖 Generated with Claude Code


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


Summary by cubic

Fixes the last unowned app-host test failures, including one product regression where session restore silently dropped all Cloud projections.

The product fix makes SurfaceCatalog.restore check ownership against the workspace being restored. Previously, TabManager.restoreSessionSnapshot restored projections before assigning tabs, so the ownership check never found the destination workspace and every restored remote projection was dropped.

Test fixes

  • SSH attach test now counts the auth-event token UUID added in fix: make SSH auth cleanup fork resilient #11497.
  • Device mirror test gives the fake device trusted presence so its directories appear.
  • Font zoom test adjusts from the inherited 8pt base instead of assuming live deltas.
  • Computer Use test removes invalid JSON escapes in the fake daemon reply.
  • Quit alert test compares alignmentRect(forFrame:) instead of padded bezel frames.
  • Remote split cwd test asserts the rescued directory arrives via CMUX_REMOTE_INITIAL_CWD.
  • Default freestyle split test asserts the split routes to Cloud and fails closed without a provider.

Two WorkspaceTerminalFocusRecoveryTests failures remain; the cause is unproven and suspected to be the workspace visibility sync, not key status.

Written for commit 8ca302a. Summary will update on new commits.

Review in cubic

teamleaderleo and others added 2 commits September 22, 2026 10:51
TabManager.restoreSessionSnapshot restores each workspace's surface
projections before it assigns tabs, so SurfaceCatalog.restore's ownership
check could not find the destination and silently dropped every restored
remote projection. Check ownership against the workspace being restored.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- CLI ssh attach: count identity UUIDs exactly; manaflow-ai#11497 added an auth token uuidgen
- device mirror directories: give the fake device trusted presence (e3d424c gate)
- font zoom mirrors: deltas from the 8pt inherited base (e6926fb arithmetic)
- Computer Use refresh: fake daemon reply was invalid JSON in a raw string (manaflow-ai#13599)
- quit alert: compare button alignment rects, not padded frames
- remote split cwd rescue: cwd travels as CMUX_REMOTE_INITIAL_CWD since manaflow-ai#12054
- default freestyle split: Cloud-owned splits route to Cloud since fa5dc4c

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 48ca0e83-5ecc-4e06-a3b9-dab04adc77b9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@teamleaderleo
teamleaderleo merged commit 5a92d7f into manaflow-ai:fix/app-host-green Sep 22, 2026
35 of 36 checks passed
@teamleaderleo
teamleaderleo deleted the fix/app-host-last-unowned branch September 23, 2026 11:35
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