feat(agents): support agents plugin CLI extensions - #960
Conversation
Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Nico Tonozzi <nico@nicot.us>
Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Nico Tonozzi <nico@nicot.us>
|
Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Nico Tonozzi <nico@nicot.us>
Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Nico Tonozzi <nico@nicot.us>
Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Nico Tonozzi <nico@nicot.us>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds the ChangesAgent CLI extension
Sequence Diagram(s)sequenceDiagram
participant AgentsCLI
participant discover_agent_cli
participant NemoCLI
participant Typer
AgentsCLI->>discover_agent_cli: Load discovered agent CLI classes
discover_agent_cli->>NemoCLI: Return named CLI subclasses
AgentsCLI->>NemoCLI: Call get_cli()
NemoCLI->>Typer: Provide agent sub-application
AgentsCLI->>Typer: Mount under the discovered agent name
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/nemo_platform_plugin/src/nemo_platform_plugin/discovery.py (1)
299-301: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winMirror the existing
NemoCLI.namevalidation.
discover_cli()warns when a class name differs from its entry-point key, butdiscover_agent_cli()silently casts and returns the mismatch. A typo can therefore mount an agent under a different identity than the class declares. Reuse the same validation behavior here.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/nemo_platform_plugin/src/nemo_platform_plugin/discovery.py` around lines 299 - 301, Update discover_agent_cli() to apply the same NemoCLI.name-versus-entry-point-key validation and warning behavior used by discover_cli(). Preserve the existing discovered mapping and cast, but ensure mismatched agent class names are detected and handled consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/nemo-agents/src/nemo_agents_plugin/cli.py`:
- Around line 121-122: Update the extension-mounting loop in AgentsCLI.get_cli
to catch exceptions from each cli_cls construction or get_cli call, log the
failing agent name, and continue mounting the remaining discovered CLIs. Add a
regression test covering a broken extension and verifying other extensions still
mount successfully.
---
Nitpick comments:
In `@packages/nemo_platform_plugin/src/nemo_platform_plugin/discovery.py`:
- Around line 299-301: Update discover_agent_cli() to apply the same
NemoCLI.name-versus-entry-point-key validation and warning behavior used by
discover_cli(). Preserve the existing discovered mapping and cast, but ensure
mismatched agent class names are detected and handled consistently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c3c06368-7519-4bf9-816f-27d803d0d7cd
📒 Files selected for processing (5)
packages/nemo_platform_plugin/src/nemo_platform_plugin/discovery.pypackages/nemo_platform_plugin/src/nemo_platform_plugin/docs/ARCHITECTURE.mdpackages/nemo_platform_plugin/tests/test_discovery.pyplugins/nemo-agents/src/nemo_agents_plugin/cli.pyplugins/nemo-agents/tests/unit/test_cli_extensions.py
Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Nico Tonozzi <nico@nicot.us>
nemo.cli.agentsdiscovery wrapper forNemoCLIsubclassesnemo agents <agent-name>This will let us follow the guidelines in https://linear.app/nvidia/issue/ASE-702/make-sure-analyst-and-experimentalist-match-new-plugin-naming.
Summary by CodeRabbit
nemo agentscommand now mounts discovered agent subcommands dynamically.