feat(studio): sample-agent registry cleanup and agents list UX - #1060
Conversation
89e54c2 to
ba750d7
Compare
6145296 to
fb6e0d9
Compare
7818d45 to
004b6db
Compare
595d8eb to
449c9b0
Compare
ddd95df to
a73d855
Compare
449c9b0 to
a0e5b98
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughStudio updates sample-agent definitions, example-agent model selection, agent bulk actions, and evaluation utility imports. ChangesAgent workflow
Sequence Diagram(s)sequenceDiagram
participant CreateExampleAgentModal
participant loadSampleAgentModelName
participant SampleAgentYaml
participant pickModelNameForExample
CreateExampleAgentModal->>loadSampleAgentModelName: load selected example model
loadSampleAgentModelName->>SampleAgentYaml: fetch and parse YAML
SampleAgentYaml-->>loadSampleAgentModelName: return model configuration
loadSampleAgentModelName-->>CreateExampleAgentModal: return preferred model or null
CreateExampleAgentModal->>pickModelNameForExample: validate preferred model
pickModelNameForExample-->>CreateExampleAgentModal: set model field
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (4)
web/packages/studio/src/routes/agents/AGENTS.md (3)
82-117: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftProvide Python SDK and CLI examples in tab sets.
The examples at Lines 82-117 use shell and
curlcommands only. Add Python SDK alternatives in tab sets, or move these workflows to a page that can provide both variants.As per coding guidelines, provide both Python SDK and CLI examples in tab sets.
🤖 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 `@web/packages/studio/src/routes/agents/AGENTS.md` around lines 82 - 117, Update the verification workflows around the build, asset-serving, registry, and model checks to provide both CLI/shell and Python SDK examples using the documentation’s tab-set format. Preserve the existing commands and ensure the Python alternatives cover equivalent behavior, including served asset validation, registered types, and model reachability.Source: Coding guidelines
13-17: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftSplit this page by Diataxis type.
This file combines a how-to checklist, an evaluation explanation, endpoint and payload reference, and troubleshooting. Split these into separate pages and cross-link them. Keep each page in one quadrant.
As per coding guidelines, each documentation page should fit one Diataxis quadrant.
Also applies to: 125-159
🤖 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 `@web/packages/studio/src/routes/agents/AGENTS.md` around lines 13 - 17, Split the AGENTS.md documentation into separate Diataxis pages for the how-to checklist, evaluation concepts, endpoint and payload reference, and troubleshooting content. Keep each page focused on a single quadrant, then add cross-links between the pages and update references to the original combined page.Source: Coding guidelines
6-10: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd the required page sections.
Place a
Prerequisitessection beforeContents. AddNext Stepsafter the final reference section.As per coding guidelines, documentation pages must list prerequisites at the top and include
Next Stepsat the end.Also applies to: 463-467
🤖 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 `@web/packages/studio/src/routes/agents/AGENTS.md` around lines 6 - 10, Update the AGENTS.md documentation structure by adding a Prerequisites section before Contents and a Next Steps section after the final reference section. Preserve the existing contents entries and ensure both required sections follow the page’s established documentation format.Source: Coding guidelines
web/packages/studio/src/components/dataViews/AgentsDataView/index.test.tsx (1)
142-152: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTest the new Run Evaluation action.
The changed tests cover only the
Compare Modelsrename. Add a test that selectsRun Evaluationand verifies that the callback receives the selected agent name. Include the action in the test description at Line 142.As per path instructions, validate this test through the package’s
testscript instead of invoking Vitest directly.🤖 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 `@web/packages/studio/src/components/dataViews/AgentsDataView/index.test.tsx` around lines 142 - 152, Extend the action-menu test in the `AgentsDataView` test suite to include `Run Evaluation` in its description and select that menu item, then verify the associated callback is invoked with the selected agent’s name. Use the existing callback mock and row/menu setup, and validate the change through the package’s `test` script rather than invoking Vitest directly.Source: Path instructions
🤖 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 `@web/packages/studio/src/components/dataViews/AgentsDataView/index.tsx`:
- Line 94: Update the action menu rendering in AgentsDataView to conditionally
include the “Run Evaluation” item only when the optional onRunEvaluation
callback is provided, while preserving its existing behavior when available.
In `@web/packages/studio/src/constants/sampleAgents.ts`:
- Around line 37-42: Update SAMPLE_AGENTS or the associated isSampleAgentName
logic to preserve detection of legacy calculator-* and email-phishing-analyzer-*
agent names, even though only the email_security_analyst entry remains. Restore
those sample-agent entries or add explicit legacy prefix mappings, while keeping
current sample-agent detection unchanged.
In `@web/packages/studio/src/routes/agents/AGENTS.md`:
- Around line 69-72: Update the fenced output example in AGENTS.md by specifying
text on its opening fence, preserving the example content and closing fence so
markdownlint MD040 passes.
---
Nitpick comments:
In `@web/packages/studio/src/components/dataViews/AgentsDataView/index.test.tsx`:
- Around line 142-152: Extend the action-menu test in the `AgentsDataView` test
suite to include `Run Evaluation` in its description and select that menu item,
then verify the associated callback is invoked with the selected agent’s name.
Use the existing callback mock and row/menu setup, and validate the change
through the package’s `test` script rather than invoking Vitest directly.
In `@web/packages/studio/src/routes/agents/AGENTS.md`:
- Around line 82-117: Update the verification workflows around the build,
asset-serving, registry, and model checks to provide both CLI/shell and Python
SDK examples using the documentation’s tab-set format. Preserve the existing
commands and ensure the Python alternatives cover equivalent behavior, including
served asset validation, registered types, and model reachability.
- Around line 13-17: Split the AGENTS.md documentation into separate Diataxis
pages for the how-to checklist, evaluation concepts, endpoint and payload
reference, and troubleshooting content. Keep each page focused on a single
quadrant, then add cross-links between the pages and update references to the
original combined page.
- Around line 6-10: Update the AGENTS.md documentation structure by adding a
Prerequisites section before Contents and a Next Steps section after the final
reference section. Preserve the existing contents entries and ensure both
required sections follow the page’s established documentation format.
🪄 Autofix
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: f1c75050-08e9-439e-ae92-232bd76ad7b4
⛔ Files ignored due to path filters (1)
web/packages/studio/public/sample-agents/email-phishing-analyzer/smaller_test.csvis excluded by!**/*.csv
📒 Files selected for processing (19)
web/packages/studio/AGENTS.mdweb/packages/studio/public/sample-agents/email-phishing-analyzer/agent.ymlweb/packages/studio/public/sample-agents/email-phishing-analyzer/dataset.jsonlweb/packages/studio/public/sample-agents/email-phishing-analyzer/eval-config.jsonweb/packages/studio/public/sample-agents/email-phishing-analyzer/eval.ymlweb/packages/studio/src/components/dataViews/AgentsDataView/index.test.tsxweb/packages/studio/src/components/dataViews/AgentsDataView/index.tsxweb/packages/studio/src/components/dataViews/EvalComparisonTable/ComparisonDeltaCell.tsxweb/packages/studio/src/components/dataViews/EvalComparisonTable/EvalComparisonTable.tsxweb/packages/studio/src/constants/sampleAgents.test.tsweb/packages/studio/src/constants/sampleAgents.tsweb/packages/studio/src/mocks/handlers.tsweb/packages/studio/src/mocks/handlers/sampleAgents.tsweb/packages/studio/src/routes/agents/AGENTS.mdweb/packages/studio/src/routes/agents/AgentsListRoute/CreateExampleAgentModal/index.tsxweb/packages/studio/src/routes/agents/AgentsListRoute/index.test.tsxweb/packages/studio/src/routes/agents/AgentsListRoute/index.tsxweb/packages/studio/src/util/buildSuggestedModelOptions.tsweb/packages/studio/src/util/sampleAgents.ts
💤 Files with no reviewable changes (5)
- web/packages/studio/src/mocks/handlers.ts
- web/packages/studio/src/constants/sampleAgents.test.ts
- web/packages/studio/src/routes/agents/AgentsListRoute/index.test.tsx
- web/packages/studio/public/sample-agents/email-phishing-analyzer/eval.yml
- web/packages/studio/src/mocks/handlers/sampleAgents.ts
|
…list cleanup Signed-off-by: Octavian Drulea <odrulea@nvidia.com>
a0e5b98 to
eda2644
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
web/packages/studio/src/routes/agents/AGENTS.md (1)
1-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftSplit the mixed Diataxis content.
This page combines a HOW-TO checklist for adding an example agent with an evaluation REFERENCE/EXPLANATION section. Move one topic to a separate page and cross-link it.
As per coding guidelines, each documentation page should fit one Diataxis quadrant.
🤖 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 `@web/packages/studio/src/routes/agents/AGENTS.md` around lines 1 - 15, Split the mixed Diataxis content in AGENTS.md by moving either the “Adding a New Example Agent” checklist or the “Agent Evaluation” reference/explanation section into a separate documentation page. Update the remaining page’s contents links and add cross-links between both pages, preserving all existing guidance.Source: Coding guidelines
web/packages/studio/AGENTS.md (1)
93-96: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMake the example self-contained and add
Next Steps.
- Show
reset: resetFormfromuseForm, or callresetdirectly.- Add a
Next Stepssection with related links at the end of the file.🤖 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 `@web/packages/studio/AGENTS.md` around lines 93 - 96, The AGENTS.md example is incomplete because it references resetForm without defining it and lacks the requested follow-up guidance. Update the example to obtain resetForm from useForm (or invoke the form reset API directly), then append a Next Steps section at the end with relevant related links.
🤖 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 `@web/packages/studio/AGENTS.md`:
- Around line 88-97: Append a “Next Steps” section to
web/packages/studio/AGENTS.md with links to related KUI form guidance, and
append a “Next Steps” section to web/packages/studio/src/routes/agents/AGENTS.md
with links to related agent and evaluation documentation; ensure each page ends
with its new section.
In `@web/packages/studio/src/components/dataViews/AgentsDataView/index.tsx`:
- Around line 321-329: Update the bulk deletion flow around renderBulkActions
and setDeleteState to clear selected rows whenever the current workspace
changes, disable the delete action while rows are fetching, and reject any
selected row whose workspace does not match the current workspace before opening
deletion state. Preserve deletion only for validated selections from the active
workspace.
In `@web/packages/studio/src/routes/agents/AGENTS.md`:
- Around line 1-4: Add a Prerequisites section before the existing overview or
Contents content in the AGENTS.md documentation, listing the required uv and
pnpm tools, running services, and local endpoints used by the agent routes. Keep
the existing Agent Routes overview unchanged after the new prerequisites
section.
- Around line 82-85: Update the command examples in AGENTS.md to define valid
MODULE and NAME variables, use MODULE in the Python import/register example, and
substitute NAME in the URL request with proper shell quoting so every published
snippet is runnable and tested.
---
Nitpick comments:
In `@web/packages/studio/AGENTS.md`:
- Around line 93-96: The AGENTS.md example is incomplete because it references
resetForm without defining it and lacks the requested follow-up guidance. Update
the example to obtain resetForm from useForm (or invoke the form reset API
directly), then append a Next Steps section at the end with relevant related
links.
In `@web/packages/studio/src/routes/agents/AGENTS.md`:
- Around line 1-15: Split the mixed Diataxis content in AGENTS.md by moving
either the “Adding a New Example Agent” checklist or the “Agent Evaluation”
reference/explanation section into a separate documentation page. Update the
remaining page’s contents links and add cross-links between both pages,
preserving all existing guidance.
🪄 Autofix
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: a5d5e709-8df7-46dc-a483-5524f9bec7d3
📒 Files selected for processing (14)
web/packages/studio/AGENTS.mdweb/packages/studio/src/components/dataViews/AgentsDataView/index.test.tsxweb/packages/studio/src/components/dataViews/AgentsDataView/index.tsxweb/packages/studio/src/components/dataViews/EvalComparisonTable/ComparisonDeltaCell.tsxweb/packages/studio/src/components/dataViews/EvalComparisonTable/EvalComparisonTable.tsxweb/packages/studio/src/constants/sampleAgents.test.tsweb/packages/studio/src/constants/sampleAgents.tsweb/packages/studio/src/mocks/handlers.tsweb/packages/studio/src/mocks/handlers/sampleAgents.tsweb/packages/studio/src/routes/agents/AGENTS.mdweb/packages/studio/src/routes/agents/AgentsListRoute/CreateExampleAgentModal/index.tsxweb/packages/studio/src/routes/agents/AgentsListRoute/index.test.tsxweb/packages/studio/src/util/buildSuggestedModelOptions.tsweb/packages/studio/src/util/sampleAgents.ts
💤 Files with no reviewable changes (4)
- web/packages/studio/src/routes/agents/AgentsListRoute/index.test.tsx
- web/packages/studio/src/mocks/handlers/sampleAgents.ts
- web/packages/studio/src/constants/sampleAgents.test.ts
- web/packages/studio/src/mocks/handlers.ts
🚧 Files skipped from review as they are similar to previous changes (7)
- web/packages/studio/src/components/dataViews/EvalComparisonTable/EvalComparisonTable.tsx
- web/packages/studio/src/util/sampleAgents.ts
- web/packages/studio/src/components/dataViews/EvalComparisonTable/ComparisonDeltaCell.tsx
- web/packages/studio/src/components/dataViews/AgentsDataView/index.test.tsx
- web/packages/studio/src/util/buildSuggestedModelOptions.ts
- web/packages/studio/src/constants/sampleAgents.ts
- web/packages/studio/src/routes/agents/AgentsListRoute/CreateExampleAgentModal/index.tsx
Signed-off-by: Octavian Drulea <odrulea@nvidia.com>
Signed-off-by: Octavian Drulea <odrulea@nvidia.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@web/packages/studio/src/components/dataViews/AgentsDataView/index.tsx`:
- Around line 118-125: Update AgentsDataView’s workspace-switch handling to
reset deleteState and prevent deletion until the new workspace data has loaded.
Before opening or executing deletion, validate that the selected row’s workspace
matches the current workspace, including pending-delete state. Add tests
covering selected rows and pending-delete rows across workspace switches.
🪄 Autofix
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: b904c88b-5c80-4310-a8d4-b6b5ded17c36
📒 Files selected for processing (1)
web/packages/studio/src/components/dataViews/AgentsDataView/index.tsx
Signed-off-by: Octavian Drulea <odrulea@nvidia.com>
New sample agent becomes the only option, and tidies the agents list.
useEffect/seededRefseeding with a key-based remount and a single seed effect.loadSampleAgentModelNamemoved toutil/sampleAgents.ts(it isn't an API call).EvalComparisonTableatformatScorein its post-feat(studio): new example agent, eval modal supports dataset-driven, per-row results view #1059 location.Removes the now-unused sample-agent MSW handlers and the tests that asserted the old roster.
Summary by CodeRabbit
New Features
Improvements