refactor(insights): port Analyst to Nooa - #1097
Conversation
Signed-off-by: Brian Newsom <brnewsom@nvidia.com>
|
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 ignored due to path filters (1)
📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughThe analyst migrated from Pydantic AI to Nooa. The change adds scoped read methods, Nooa tracing, LiteLLM model configuration, updated CLI error handling, and tests for the new execution paths. ChangesAnalyst migration
Sequence Diagram(s)sequenceDiagram
participant CLI
participant run_analyst
participant Analyst
participant AnalystBackend
CLI->>run_analyst: start analyst run
run_analyst->>Analyst: construct with deps and call analyze
Analyst->>AnalystBackend: fetch scoped evidence
AnalystBackend-->>Analyst: return spans, scores, annotations, or Insights
Analyst-->>run_analyst: return validated AnalystResult
run_analyst-->>CLI: return result or GenerationError
Possibly related PRs
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: 2
🤖 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-insights/src/nemo_insights_plugin/analyst/observability.py`:
- Around line 58-62: Update the tracing setup around _otlp_auth_headers so
Bearer authentication headers are only attached when the configured base_url
uses HTTPS; reject or omit authentication for remote HTTP endpoints before
calling exporters.otlp. Add coverage for a remote HTTP base_url with a Bearer
token and verify the token is not passed to the exporter.
In `@plugins/nemo-insights/src/nemo_insights_plugin/analyst/run.py`:
- Line 70: Move the _enable_litellm_drop_params() call inside the try block in
run_analyst(), before the LiteLLM import, so import failures enter the existing
cleanup scope and still close the injected client.
🪄 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: 4702bd77-6f3b-417a-9d9f-6b4b8c3c55bc
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (19)
plugins/nemo-insights/examples/research-agent/tests/test_analyst_e2e.pyplugins/nemo-insights/pyproject.tomlplugins/nemo-insights/src/nemo_insights_plugin/analyst/agent.pyplugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.pyplugins/nemo-insights/src/nemo_insights_plugin/analyst/deps.pyplugins/nemo-insights/src/nemo_insights_plugin/analyst/functions/annotations.pyplugins/nemo-insights/src/nemo_insights_plugin/analyst/functions/insights.pyplugins/nemo-insights/src/nemo_insights_plugin/analyst/functions/spans.pyplugins/nemo-insights/src/nemo_insights_plugin/analyst/model_config.pyplugins/nemo-insights/src/nemo_insights_plugin/analyst/observability.pyplugins/nemo-insights/src/nemo_insights_plugin/analyst/result.pyplugins/nemo-insights/src/nemo_insights_plugin/analyst/run.pyplugins/nemo-insights/src/nemo_insights_plugin/cli.pyplugins/nemo-insights/src/nemo_insights_plugin/client.pyplugins/nemo-insights/tests/test_analyst_agent.pyplugins/nemo-insights/tests/test_analyst_observability.pyplugins/nemo-insights/tests/test_analyst_run.pyplugins/nemo-insights/tests/test_cli_profile.pyplugins/nemo-insights/tests/testbed/test_cli.py
|
Signed-off-by: Brian Newsom <brnewsom@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 `@plugins/nemo-insights/tests/test_analyst_observability.py`:
- Around line 74-80: Update build_intake_otlp_traces_endpoint to reject
non-HTTPS endpoints unless the host is an explicitly allowed loopback address,
while preserving valid HTTPS behavior. Ensure exporters.otlp cannot be
configured with other HTTP URLs, and add or update tests covering rejection of
non-loopback HTTP and acceptance of loopback HTTP.
🪄 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: 989460ed-e1af-4b67-a760-c269efec6b97
📒 Files selected for processing (5)
plugins/nemo-insights/src/nemo_insights_plugin/analyst/observability.pyplugins/nemo-insights/src/nemo_insights_plugin/analyst/run.pyplugins/nemo-insights/tests/test_analyst_observability.pyplugins/nemo-insights/tests/test_analyst_run.pythird_party/licenses.jsonl
💤 Files with no reviewable changes (1)
- third_party/licenses.jsonl
🚧 Files skipped from review as they are similar to previous changes (2)
- plugins/nemo-insights/tests/test_analyst_run.py
- plugins/nemo-insights/src/nemo_insights_plugin/analyst/observability.py
Signed-off-by: Brian Newsom <brnewsom@nvidia.com>
callingmedic911
left a comment
There was a problem hiding this comment.
Left 1 comment, looks good otherwise
Signed-off-by: Brian Newsom <brnewsom@nvidia.com>
Summary
Orchestration notes
analyze()CodeAct run. Eval Author and Experimentalist use deterministic multi-stage orchestration; splitting Analyst would be a larger behavioral rewrite.AnalystResult; the existing backend then creates or updates Insights.Validation
pytest plugins/nemo-insights/tests -q: 594 passed, 1 skippedtychecks passeduv lock --checkpassed with repository-pinned uv 0.9.17Summary by CodeRabbit
New Features
Bug Fixes
Tests