cmux next: the agent activity page shows computer use sessions, and one helper runs per build
LU
11d ago+683+683+012345678901234567890123456789-77-77-01234567890123456789
The Agent Activity page talked to the default cmux-cua socket (~/Library/Caches/cmux-cua/cmux-cua.sock) with env tokens, while the app's own computer use helper listens on its tag-scoped socket. So the page could be empty and its Stop did nothing. Export, open agent, open target and stop all also failed with no error. And quick off/on changes could start a second helper for the same tag.
- The page reads the running helper (
AgentActivityPageService.swift,AgentActivitySocketSource.swift): the socket and tokens come fromComputerUseHelperDaemon.configurationand follow a helper restart. - Unsupported operations say so: export, open agent, open target and stop all return an error the page shows, instead of failing silently. No new wire operations.
- One helper per tag (
ComputerUseHelperScope.swift,WorkspaceHelperLauncher.swift): a scope lock per socket; pending starts are shared; before a launch, an older Developer ID signedcmux-cua serveon the same exact socket is stopped and waited for (5 s, off the main actor). Helpers of other tags, NIGHTLY and classic cmux have other sockets and are never touched. A candidate that already exited counts as stopped.
Stacked on #25795 (it keeps that PR's per-launch agent token).
Changelog
- Fixed: the Agent Activity page shows computer use sessions and its Stop works.
Tests
Packages/macOS/CmuxNext/Tests/CmuxNextAppTests/ComputerUseActivitySourceTests.swift: the page uses the helper's socket and follows a restart; unsupported operations report an error.ComputerUseHelperLifecycleTests.swift: concurrent starts share one launch.ComputerUseHelperScopeTests.swift: only a signed helper on the exact socket is stopped; an exited candidate counts as stopped; argv matching.
Observed / Not run
- Ran locally (Xcode 26.6):
swift test --package-path Packages/macOS/CmuxNext --filter 'ComputerUseActivitySourceTests|ComputerUseHelperLifecycleTests|ComputerUseHelperScopeTests|ComputerUseEndpointTests': 15 passed (after the review fix). prepush-gate.py: no new violations. One review: one P2 (an exited helper blocked the relaunch), fixed with a test.- Not run: a live helper restart in a tagged app.
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.