cmux-next Chief: Subagents menu rows run chief.openSubagent, not an inline selector
Merged
TE
16d ago+183+183+012345678901234567890123456789-13-13-01234567890123456789
check-menu-actions.py (the "Menu rows run registered actions, not inline selectors" step of cmux-next guards) fails on feat-cmux-next because the Chief pane's Subagents menu built its rows with an inline #selector(openSubagent(_:)). This PR makes each row run a new registered action, chief.openSubagent, so that check passes. The rows behave the same as before.
- New action:
chief.openSubagent("Open Chief Subagent") goes inSidebarSectionActionCatalog. Its target is the subagent row's sidebar item (sidebar-item:<id>). It is exempt from the palette and CLI verb asfocusMove, likehome.openConversation. Its title is translated into the catalog's 21 languages. - Binding:
ChiefSidebar.bindbinds it to the existingactivate(LayoutItemID(target.id), registry:)path, the same path a click on the sidebar row takes. - Menu rows:
ChiefPaneTools.subagentsMenu()builds each row throughregistry.makeContextMenu, then sets the subagent's own title and status tooltip, with no icon and no key. The@objc openSubagentselector is gone. - Behavior: a row is now enabled only while the action is bound and allowed by policy. In the app it is always bound, so nothing visible changes.
- Generated files: the action exports (
plans/cmux-next/action-surfaces.json,actions.md) are regenerated by PR autofix on a Mac runner, not by hand.
Testing
- Red, on base 92d14b214ff:
python3 scripts/cmux-next/check-menu-actions.pyfails onChiefPaneTools.swift, the same failure as the base red. - Green, on head: the same command passes with "38 inline menu rows in 29 baselined files, none new".
- New test:
HomeDockTabRowToolsTests.eachSubagentRowOpensItsSessionThroughTheRegisteredAction(commit 1). It checks throughActionRegistry.menuRun(of:)that each row runschief.openSubagenton its ownsidebar-item:<row id>with no arguments, and that each row keeps its title and tooltip.
Observed / Not run
- Observed:
check-menu-actions.pypasses,prepush-gate.pyreports no new violations andcheck-no-godfiles.shpasses on the changed files.localization_catalog.py checkfails exactly as it does on base, with no error in the files changed here. - Not run: no Swift compile or tests locally (Mac compiles run on CI). The new test,
ActionSurfaceParityTestsandActionContractTestsrun on CI.
Changelog
none
Agent session: huge-blue
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
The Chief pane's Subagents menu rows now run the registered chief.openSubagent action through the action registry, instead of an inline selector, so the check-menu-actions.py guard passes. Rows behave identically to before.
- New
chief.openSubagentaction binds to the same activation path as a click on the sidebar row; its target is the row'ssidebar-item:<id>, and it is exempt from the palette and CLI verb asfocusMove. - Menu rows are rebuilt from the registry, then retitled with the subagent's own title and status tooltip, with no icon or key.
- Added tests asserting each row runs the action on its own row's sidebar item with no arguments, and that the action is not a palette row.
- A row is enabled only while the action is bound and allowed by policy; in the app it is always bound, so nothing visible changes.