Agent chat: ⌘P opens Search Files… (cx-ncc.69)

Merged
TE
1mo ago
+448-13

Summary

⌘P in an agent chat now opens Search Files…, as it does in the Codex desktop app. It searches the chat folder's files, and picking one mentions it in the prompt. Elsewhere ⌘P is still Go to Workspace.

  • New action agentPane.searchFiles ("Search Files…"): default ⌘P, available only while an agent chat has the keyboard, and listed in the palette. It is a person-facing chooser, so the CLI and MCP surfaces are exempt, as for Switch Model….
  • The app makes the page first responder and sends it searchFiles. The composer then opens the same Search files that its + menu opens.
  • showModelPicker and showFileSearch share one keyboard-taking helper, which keeps AgentPaneView from growing (god-file ratchet).
  • Action exports are regenerated on the fleet: actions.md, action-surfaces.json and cmux-shortcuts.generated.json.

This is the first slice of cx-ncc.69. A default key for Search Agent Chats and ⌃1–9 for recent chats follow in later slices.

Testing

Gallery play search-files-key, driven by webviews/test/composer-search-files-key.test.ts with CMUX_BROWSER_TESTS=1:

  • 95093300f8d5 (red): the command opened nothing.
  • cb7c999c971d (green): Search files opens with the keyboard in its field.

Also passing: bun run typecheck, bun run lint, vp fmt --check, and the ui-rules, gallery-coverage and ui-a11y suites. The god-file check passes (AgentPaneView is 1188, unchanged). The crash ratchet's hits are all in files this PR does not touch. The Release compile and the CmuxNext Swift suites ran on the head.

Localization: two new strings (the action title and the no-agent-chat refusal), each added in all 21 locales of their catalogs.

Changelog

  • Added: ⌘P in an agent chat opens Search Files… for the chat's folder.

🤖 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

Adds the agentPane.searchFiles action (Search Files…, default ⌘P) so that in an agent chat ⌘P opens the composer's file search over the chat folder, matching the Codex desktop app. Picking a file mentions it in the prompt; elsewhere ⌘P still opens Go to Workspace.

  • The action is available only while an agent chat has the keyboard; otherwise it refuses with a focus message (CLI and MCP are exempt, as for Switch Model…).
  • The model picker and file search share one keyboard-taking helper to keep AgentPaneView from growing (god-file ratchet).
  • Regenerated action exports (actions.md, action-surfaces.json, cmux-shortcuts.generated.json) and added a gallery play and browser test.
  • This is the first slice of cx-ncc.69; default keys for Search Agent Chats and recent chats follow in later slices.