Repository navigation
victor/agent-help-plugin-followups - #3250
gtrrz-victor wants to merge 6 commits into
Conversation
…ugin backfillManifestMetadata returned early when entire-plugin.yml at the installed tag named a different plugin, so agent_help stayed unrecorded and every no-op upgrade fetched the metadata again. Take nothing from that metadata, but record agent_help as false, so it is fetched for agent_help at most once, as documented. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M8P12DP2PF094RZSKP0AHS0K
agentHelpGuidedPlugins kept its own copies of the dispatcher's filters (an inline rootCmd.Find, validatePluginName, per-entry manifest loads). It now reads the manifests once and resolves each declaring plugin with resolvePlugin, managed bin dir first on PATH, as maybeDelegateAgentHelpToPlugin does. A plugin is named only when that lookup reaches its managed release binary, so the listing and `entire agent-help <name>` agree: help/completion count as built-ins on a bare root, and on Windows a same-name exe in the working directory (which LookPath refuses with ErrDot) no longer gets a pointer that delegation then rejects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M8P12F5EBGPMVY1ZZ5ZVAMJ6
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the plugin guidance resolution and metadata-backfill changes.
No open issues 🎉
What changed in this PR
Aligns Entire CLI’s plugin guidance listing with actual command delegation and tightens metadata backfill during plugin upgrades.
Changes:
- Uses dispatcher resolution to list only managed release plugins whose guidance is reachable, respecting built-in shadowing and Windows lookup collisions.
- Ignores metadata naming another plugin and records missing
agent_helpasfalse. - Adds regression tests and updates the external-command architecture documentation.
| File | Description |
|---|---|
docs/architecture/external-commands.md |
Documents guidance-list resolution and mismatched metadata handling. |
cmd/entire/cli/plugin_install_remote.go |
Discards mismatched metadata while allowing agent_help backfill to complete. |
cmd/entire/cli/plugin_help_test.go |
Tests backfill when metadata names another plugin. |
cmd/entire/cli/agent_help_plugins.go |
Resolves manifest candidates through the dispatcher and verifies release-binary identity. |
cmd/entire/cli/agent_help_plugins_windows_test.go |
Tests listing behavior with a same-named executable in the working directory. |
cmd/entire/cli/agent_help_plugins_test.go |
Adds shadowing coverage for built-in help and completion commands. |
Review effort: Balanced
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 29f817e. Configure here.
| // in the working directory makes delegation's lookup refuse with ErrDot, so | ||
| // `entire agent-help <name>` would answer "unknown command". The listing must | ||
| // not name it then; with no such file it does. | ||
| func TestAgentHelpGuidedPlugins_WorkingDirectoryCollision(t *testing.T) { //nolint:paralleltest // mutates env and CWD |
There was a problem hiding this comment.
Windows listing test skipped in CI
Medium Severity
TestAgentHelpGuidedPlugins_WorkingDirectoryCollision is the only coverage for the new Windows ErrDot listing behavior, but its name does not contain Windows or MSYS. The Windows CI job runs go test ./cmd/entire/cli/... -run '(Windows|MSYS)', so this test never executes there. A regression that listed a plugin when a working-directory collision made entire agent-help <name> fail would go unnoticed.
Triggered by learned rule: Windows plugin bin: never Root.Symlink; Link needs root-relative names
Reviewed by Cursor Bugbot for commit 29f817e. Configure here.
The test-windows job selects tests with -run '(Windows|MSYS)', so the working-directory collision test never ran there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M8P1RKFQTB2AC8W9H04RN8C9
The listing walked pkg/ manifests and trusted each one's name: field, so a manifest in pkg/foo/ naming bar could declare agent_help for bar, and two manifests naming one plugin listed it twice. Walk the bin entries instead (unique by name) and read only pkg/<name>/manifest.yml, requiring it to name <name>. Also correct runAgentHelp's doc comment: the text path now runs exec.LookPath with PATH briefly prepended and primes help/completion on rootCmd, which is why the MCP tool keeps to JSON. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M8P27YNSK80Z2ZHKA07Z1YSA
ListInstalledPlugins can return one name twice on Windows (entire-foo.exe and entire-foo.cmd both strip to foo), so skip a repeat of the previous name in the sorted list. runAgentHelp's comment said the MCP tool serves requests concurrently and keeps to JSON because of the PATH change; it handles one request at a time and always took the JSON path, so it never reaches the listing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M8P2PKE6K979GMYGKZC9BG3J
The decoy cases write into pkg/decoy/, which the listing never reads, so they passed without the m.Name != p.Name check. Cover pkg/stream/manifest.yml saying name: other. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M8P3G6F9MXSN7WTDR2KRRYNF


This draft pull request was opened by Entire to back a trail. Feel free to edit the title or body, but keep the hidden marker below: Entire uses it to close this pull request when the trail closes.
Note
Low Risk
CLI-only agent-help listing and manifest backfill logic with expanded tests; no auth or network behavior changes beyond safer metadata handling.
Overview
Aligns the bare
entire agent-helpplugin list with real delegation: it walks manifests withagent_help, temporarily prepends the managed bin dir toPATH, and usesresolvePlugin(notFind) so names drop out when built-ins shadow them, anotherentire-<name>wins onPATH, or on Windows a same-named exe in the working directory triggersLookPath’sErrDot.Upgrade backfill no longer treats mismatched metadata as “unknown”: if the tag’s
entire-plugin.ymlnames a different plugin, description is skipped andagent_helpis recordedfalseso the manifest isn’t refetched forever.Tests add help/completion shadow cases, the wrong-plugin metadata backfill case, and a Windows CWD collision test; architecture docs describe the same rules.
Reviewed by Cursor Bugbot for commit 29f817e. Configure here.