cmux-next Chief: Subagents menu rows run chief.openSubagent, not an inline selector

Merged
TE
16d ago
+183-13

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 in SidebarSectionActionCatalog. Its target is the subagent row's sidebar item (sidebar-item:<id>). It is exempt from the palette and CLI verb as focusMove, like home.openConversation. Its title is translated into the catalog's 21 languages.
  • Binding: ChiefSidebar.bind binds it to the existing activate(LayoutItemID(target.id), registry:) path, the same path a click on the sidebar row takes.
  • Menu rows: ChiefPaneTools.subagentsMenu() builds each row through registry.makeContextMenu, then sets the subagent's own title and status tooltip, with no icon and no key. The @objc openSubagent selector 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.py fails on ChiefPaneTools.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 through ActionRegistry.menuRun(of:) that each row runs chief.openSubagent on its own sidebar-item:<row id> with no arguments, and that each row keeps its title and tooltip.

Observed / Not run

  • Observed: check-menu-actions.py passes, prepush-gate.py reports no new violations and check-no-godfiles.sh passes on the changed files. localization_catalog.py check fails 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, ActionSurfaceParityTests and ActionContractTests run on CI.

Changelog

none

Agent session: huge-blue

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
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.openSubagent action binds to the same activation path as a click on the sidebar row; its target is the row's sidebar-item:<id>, and it is exempt from the palette and CLI verb as focusMove.
  • 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.