Skip to content

feat(mcp): add compare_results agent tool - #230

Closed
tonythethompson wants to merge 14 commits into
mainfrom
feat/agent-compare-tool-v2
Closed

tonythethompson wants to merge 14 commits into
mainfrom
feat/agent-compare-tool-v2

Conversation

@tonythethompson

@tonythethompson tonythethompson commented Aug 10, 2026 •

Copy link
Copy Markdown
Owner

Implements compare_results MCP tool (task 6.1) for multi-job comparison with preference-weighted scoring.

Changes:

  • New file: olive-mcp-server/olive_mcp_server/tools/agent_compare.py

Requirements: 7.1-7.8, 8.3, 11.1, 11.3, 12.1-12.7

Review in cubic

tonythethompson and others added 10 commits August 9, 2026 22:23
…y tools

- Mark v0.1.0 and v0.2 as shipped, remove "current" and "next" labels
- Restructure v0.3 section around 5 new MCP agent autonomy tools (`execute_and_observe`, `plan_optimization`, `diagnose_and_fix`, `compare_results`, `get_model_info`)
- Rename "Backlog / v0.3+" to clearer v0.4 and Backlog sections with specific features
- Remove graduation criteria sections (Tauri desktop, MultiLoRA) for conciseness
- Consolidate v0.2 shipped work (persistent MCP, component splits, security headers, agent platform phases)
- Move experimental features to backlog with blocker notes (MultiLoRA, cloud sync, WebGPU)
- Update CI pipeline description to include test tiers and pytest
- Simplify status legend table formatting
Coordinated version bump from olive-ai 0.12.1 to 0.13.0:

• 8 new passes added to TS catalog, MCP knowledge base, and recipe builder
  (MobiusBuilder, QairtPipeline, KQuant, OnnxKquantQuantization,
  QuantizeEmbeddingInt8, ShareEmbeddingLmHead, SimplifiedLayerNormToRMSNorm,
  OnnxDiscrepancyCheck)
• KQuant added as new quantization method ("kquant" in type union + allowlists)
• trust_remote_code default flip handled in recipe builder + pipeline advisory
• QNN ABI EP added to hardware profiles and provider conflicts
• CROSS_PASS_RULES for QairtPipeline and SimplifiedLayerNormToRMSNorm EP constraints
• Removed-pass warning rule for MobiusModelBuilder/QairtPreparation/QairtGenAIBuilder
• Migration module (src/lib/passMigration.ts) with pass name renames, removals,
  and parameter migration infrastructure
• Migration integrated into pipelineStore replaceState + rehydration paths
• Venv spec bumped to v5 (olive-ai>=0.12.0,<1)
• Sync script version guard for 0.13.x

Tests: 1052 unit tests passing, 5 property-based tests (idempotence, validity,
preservation, exclusion, recipe schema), 6 integration test fixtures.
Lint: 0 errors. Recipe validation: passes.
Register execute_and_observe, plan_optimization, diagnose_and_fix,
compare_results, and get_model_info in ALLOWED_MCP_TOOL_NAMES under a
Phase 3 comment group.

Requirements: 2.2, 4.2, 6.2, 8.2, 10.2
Add 5 new agent autonomous loop tools to _TOOL_IMPORTS in mcp_server.py
and ALLOWED_MCP_TOOL_NAMES in allowedTools.ts:

- execute_and_observe → agent_execute
- plan_optimization → agent_planner
- diagnose_and_fix → agent_diagnosis
- compare_results → agent_compare
- get_model_info → agent_model_info

Part of v0.3-agent-mcp-tools (tasks 1.1 + 1.2).
Implement the get_model_info MCP tool that provides HuggingFace model
metadata lookup with heuristic fallback for autonomous agent planning.

- Validates model_id (1-256 chars)
- Attempts HF API call (urllib, 3s timeout) for exact param count
- Falls back to inferParamBillions regex heuristics (ported from
  src/lib/vramEstimate.ts) on any HF failure
- Computes VRAM estimate (params_b * 2 FP16 baseline)
- Classifies model_type via _normalize_model_type from strategy_advisor
- Recommends int4 (>=6B) or int8 (<6B) quantization
- Confidence: high (HF API), medium (explicit size token), low (family default)
- Zero new pip dependencies, no module-level network I/O
- Wrapped in top-level try/except for internal_error safety

Implements: Requirements 9.1-9.8, 11.1, 11.3, 12.1, 12.5
Implements the diagnose_and_fix MCP tool (agent_diagnosis.py) for the
Phase 3 autonomous agent loop.

- Validates error_message (1-4000 chars) and recipe (must be dict)
- Calls troubleshoot_olive_error internally with config context
- Applies RFC 7386 JSON Merge Patch when KB entry has updated_config
- Generates human-readable change descriptions
- Best-effort recipe validation through Studio bridge
- Maps fix_confidence: high/medium/low/none based on KB match quality
- Top-level try/except for internal_error safety net
- Zero new pip dependencies (stdlib only + internal imports)

Requirements: 5.1-5.9, 6.3, 11.1, 11.3, 12.1-12.7
Implements the execute_and_observe MCP tool for the Phase 3 autonomous
agent loop. Submits a recipe to Olive Studio via the loopback bridge,
polls job status at 2-second intervals until a terminal state is reached
or the effective timeout expires.

Key behaviors:
- Timeout clamping: min(max(timeout or 600, 10), 1800)
- Terminal states: completed, failed, cancelled
- Terminal-at-timeout-boundary: terminal wins (timed_out: false)
- Pre-submission errors: no side_effect field
- Post-submission results: side_effect: True
- Logs capped at 200 entries, artifact refs as basenames only
- Top-level try/except for internal_error safety

Requirements: 1.1-1.12, 2.3, 2.4, 2.5, 11.1, 11.3, 12.1-12.7
Implements the compare_results MCP tool (task 6.1) for multi-job
comparison with preference-weighted scoring.

- Validates job_ids count (2-10) and format (^[A-Za-z0-9_-]{1,128}$)
- Normalizes preference (latency/size/accuracy/balanced)
- Fetches job status via studio_request loopback bridge
- Excludes non-terminal, failed, or unfetchable jobs
- Min-max normalizes metrics with lower-is-better inversion
- Applies 2x weight for preferred metric, 1x for others
- Selects highest scored job as winner
- Returns structured comparison with side_effect: False
- Top-level try/except for internal_error safety
- Zero new pip dependencies (stdlib + studio_loopback only)

Requirements: 7.1-7.8, 8.3, 11.1, 11.3, 12.1-12.7
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deployment failed for project olive-studio with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/trackdub?upgradeToPro=build-rate-limit

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @tonythethompson, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR upgrades Olive integration from 0.12.1 to 0.13.0, adds K-Quant and QNN ABI support, migrates legacy pass state, expands recipe validation, updates knowledge bases, and adds autonomous MCP tools for execution, diagnosis, comparison, and model metadata.

Changes

Olive 0.13.0 pipeline support

Layer / File(s) Summary
Pass contracts and catalog
src/types.ts, src/lib/passCatalog.ts, src/lib/passCatalog.test.ts
The catalog and state types add Olive 0.13.0 passes, categories, providers, K-Quant, and pass options.
Recipe construction and validation
src/lib/oliveRecipeBuilder.ts, src/lib/pipelineValidation.ts, src/lib/providerRuntimeKind.ts, src/lib/vramEstimate.ts, src/lib/auditAutofix.ts, src/lib/chatActions.ts, src/lib/__tests__/pipelineValidation.test.ts
Recipe generation adds K-Quant, optional graph and QAIRT passes, and trust_remote_code. Validation covers provider compatibility, QNN ABI, removed passes, and cross-pass rules.
State migration and runtime requirements
src/lib/passMigration.ts, src/lib/stores/pipelineStore.ts, src/server/services/venv/*, src/lib/__tests__/passMigration*
Imported and persisted state migrates renamed or removed passes. Virtual-environment specifications and capability checks support the updated Olive range and QNN ABI.
Catalog synchronization and telemetry
scripts/sync-pass-catalog.mjs, src/lib/issueReport.ts
Catalog synchronization validates Olive 0.13.x and records catalog metadata. Telemetry reports Olive 0.13.0.

Knowledge-base and MCP agent updates

Layer / File(s) Summary
Knowledge-base catalogs
olive-mcp-server/olive_mcp_server/knowledge_base/*.json, olive-mcp-server/tests/test_compatibility_matrix.py
Compatibility, hardware, and troubleshooting catalogs reference Olive 0.13.0 and include new workflows, providers, passes, and troubleshooting entries.
Autonomous MCP tools
olive-mcp-server/olive_mcp_server/mcp_server.py, olive-mcp-server/olive_mcp_server/tools/*.py, src/server/services/mcp/allowedTools.ts
The MCP server registers tools for job execution, diagnosis and repair, result comparison, and model information retrieval. The tools return structured success and error data.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: greptile-apps

🚥 Pre-merge checks | ✅ 8
✅ Passed checks (8 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 67.21% which is sufficient. The required threshold is 60.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Pipeline Stage Enum Ordering ✅ Passed The PR diff and all tracked source contain no SessionWorkflowStage enum, named stage members, or stage inequalities; ordering, raw-literal, and legacy-converter checks are not applicable.
Gpu/Cpu Runtime Boundary ✅ Passed The base-to-HEAD diff changes no files under inference/ and no requirements files, so the GPU/CPU runtime boundary check is not applicable.
Managed Host Restart Safety ✅ Passed The PR changes only recipe quantization configuration; no managed-host components or restart/lease symbols exist in the diff or repository.
Title check ✅ Passed The title clearly identifies the primary change: adding the compare_results MCP agent tool.
Description check ✅ Passed The description directly explains the compare_results tool and its preference-weighted multi-job comparison behavior.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/agent-compare-tool-v2
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/agent-compare-tool-v2

Warning

Review ran into problems

🔥 Problems

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. Analyzed tonythethompson/QuickShell, tonythethompson/numan, tonythethompson/dependency-chain-substrate, skipped Trackdubllc/Trackdub.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread src/lib/passMigration.ts
let discardedParams = 0;

// Deep-clone overrides to avoid mutation.
let overrides: Record<string, Record<string, unknown>> = state.passRecipeOverrides

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'overrides' is never reassigned. Use 'const' instead.

Suggested change
let overrides: Record<string, Record<string, unknown>> = state.passRecipeOverrides
const overrides: Record<string, Record<string, unknown>> = state.passRecipeOverrides

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Add compare_results MCP tool + Olive 0.13.0 pass catalog/migration updates

✨ Enhancement 🧪 Tests ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Add Phase 3 MCP agent tools, including compare_results for multi-job scoring.
• Upgrade Olive integration to 0.13.0 with updated pass catalog/KB and UI support.
• Add migrations and tests to keep persisted pipelines compatible across versions.
Diagram

graph TD
  A["MCP Client"] --> B["MCP Server"] --> C["Tool Registry"]
  C --> D["Agent Tools"] --> E["Studio Loopback"] --> F["Olive Studio API"]
  G["Web App UI"] --> H["Pipeline Validation/Migration"]
  H --> B
  subgraph Legend
    direction LR
    _cli["Client/UI"] ~~~ _svc["Service"] ~~~ _api{{"External API"}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Extract shared agent-tool helpers
  • ➕ Avoids duplicating response/error checks across agent_* tools
  • ➕ Centralizes input validation patterns and common constants (terminal states, status path)
  • ➖ Slight upfront refactor cost; current duplication is small and readable
2. Use more robust scoring (e.g., z-score or rank-based)
  • ➕ Less sensitive to outliers vs min-max normalization
  • ➕ Easier to reason about ties and missing metrics
  • ➖ More complex to explain; min-max is sufficient for early-stage agent loops

Recommendation: Current approach is appropriate: compare_results uses simple min-max normalization with clear preference weighting and explicit exclusions. Consider a follow-up to factor shared agent-tool utilities once Phase 3 tools stabilize; keep the scoring method as-is unless real-world results show outlier sensitivity.

Files changed (33) +4984 / -805

Enhancement (16) +1347 / -45
mcp_server.pyRegister Phase 3 autonomous agent tools +21/-0

Register Phase 3 autonomous agent tools

• Adds execute_and_observe, plan_optimization, diagnose_and_fix, compare_results, and get_model_info to the MCP server tool map.

olive-mcp-server/olive_mcp_server/mcp_server.py

agent_compare.pyAdd compare_results tool with preference-weighted scoring +279/-0

Add compare_results tool with preference-weighted scoring

• Implements multi-job comparison by fetching job statuses, extracting metrics, normalizing/weighting scores by preference, and returning a winner plus exclusions and reasoning.

olive-mcp-server/olive_mcp_server/tools/agent_compare.py

agent_diagnosis.pyAdd diagnose_and_fix tool with merge-patch recipe repair +202/-0

Add diagnose_and_fix tool with merge-patch recipe repair

• Introduces an agent-facing diagnosis tool that consults the troubleshooting KB, applies RFC 7386 merge patches when applicable, and optionally validates the repaired recipe via Studio.

olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py

agent_execute.pyAdd execute_and_observe tool for submit + poll lifecycle +201/-0

Add execute_and_observe tool for submit + poll lifecycle

• Adds an agent tool to submit a recipe, poll status to terminal state with clamped timeout, collect logs/metrics, and surface artifact references.

olive-mcp-server/olive_mcp_server/tools/agent_execute.py

agent_model_info.pyAdd get_model_info tool with HF lookup + heuristic fallback +233/-0

Add get_model_info tool with HF lookup + heuristic fallback

• Implements model metadata lookup via HuggingFace API with a fast heuristic fallback for parameter count/VRAM estimation and quant recommendation.

olive-mcp-server/olive_mcp_server/tools/agent_model_info.py

auditAutofix.tsAllow kquant in audited quantMethod enums +2/-1

Allow kquant in audited quantMethod enums

• Updates enum coercion/allowed sets so audit and autofix logic recognizes the new kquant quant method.

src/lib/auditAutofix.ts

chatActions.tsAllow kquant in chat-driven pass enums +1/-1

Allow kquant in chat-driven pass enums

• Extends chat action parameter enums to include the kquant quant method for user/agent interactions.

src/lib/chatActions.ts

defaultPasses.tsDefault trustRemoteCode to true +1/-0

Default trustRemoteCode to true

• Adds trustRemoteCode to the default pass state, matching the intended behavior for HuggingFace model loading compatibility.

src/lib/defaultPasses.ts

oliveRecipeBuilder.tsSupport Olive 0.13.0 passes + trust_remote_code emission +99/-4

Support Olive 0.13.0 passes + trust_remote_code emission

• Adds builders and ordering for new 0.13.0 passes, introduces kquant quantization dispatch logic, and emits trust_remote_code for HF sources unless explicitly disabled.

src/lib/oliveRecipeBuilder.ts

passMigration.tsAdd pass migration framework for Olive upgrades +141/-0

Add pass migration framework for Olive upgrades

• Introduces migration tables and logic to rename/remove pass overrides (and infrastructure for parameter migrations), returning structured migration results.

src/lib/passMigration.ts

pipelineValidation.tsAdd 0.13.0 provider/pass rules + migration advisories +104/-8

Add 0.13.0 provider/pass rules + migration advisories

• Adds kquant provider gating, introduces QNN ABI provider handling, adds cross-pass rules for new passes, warns on deprecated overrides, and coerces trustRemoteCode defaults for HF sources.

src/lib/pipelineValidation.ts

providerRuntimeKind.tsTreat QnnAbiExecutionProvider as platform-local runtime +2/-0

Treat QnnAbiExecutionProvider as platform-local runtime

• Adds QnnAbiExecutionProvider to runtime kind mapping and always-selectable provider list.

src/lib/providerRuntimeKind.ts

pipelineStore.tsApply migrations when loading/replacing pipeline state +14/-5

Apply migrations when loading/replacing pipeline state

• Runs applyMigrations during state replace and persisted state hydration, logging rename/removal counts and then committing the updated state through validation.

src/lib/stores/pipelineStore.ts

vramEstimate.tsHandle QnnAbiExecutionProvider in VRAM/provider helpers +3/-2

Handle QnnAbiExecutionProvider in VRAM/provider helpers

• Extends GPU/provider classification to recognize QnnAbiExecutionProvider in VRAM estimation and related provider logic.

src/lib/vramEstimate.ts

status.tsMap QnnAbiExecutionProvider to QNN capability resolution +24/-23

Map QnnAbiExecutionProvider to QNN capability resolution

• Extends capability mapping so QnnAbiExecutionProvider uses the same QNN preparation/inference capability selection logic as QNNExecutionProvider.

src/server/services/venv/status.ts

types.tsAdd QnnAbiExecutionProvider, kquant, and new pass flags +20/-1

Add QnnAbiExecutionProvider, kquant, and new pass flags

• Extends core UI types to include QnnAbiExecutionProvider, the kquant quant method, trustRemoteCode, and several new Olive 0.13.0 pass toggles.

src/types.ts

Tests (8) +718 / -4
test_compatibility_matrix.pyAlign compatibility matrix test expectations to new version +1/-1

Align compatibility matrix test expectations to new version

• Updates the expected compatibility matrix version asserted by the test suite.

olive-mcp-server/tests/test_compatibility_matrix.py

passMigrationIntegration.test.tsAdd pass migration integration tests +138/-0

Add pass migration integration tests

• Adds fixture-based tests covering pass rename/removal migrations and verifies migrated state still produces a valid recipe (including trust_remote_code emission rules).

src/lib/tests/passMigrationIntegration.test.ts

passMigrationPBT.test.tsAdd property-based tests for migration correctness +239/-0

Add property-based tests for migration correctness

• Introduces fast-check property tests for migration validity, idempotence, removal handling, and post-migration recipe build invariants.

src/lib/tests/passMigrationPBT.test.ts

passParameterValidation.test.tsUpdate pass parameter validation test defaults +1/-0

Update pass parameter validation test defaults

• Extends the base pass state used in tests to include the new trustRemoteCode field.

src/lib/tests/passParameterValidation.test.ts

pipelineValidation.test.tsExtend pipeline validation tests for 0.13.0 rules +130/-3

Extend pipeline validation tests for 0.13.0 rules

• Updates quant-method expectations to include kquant and adds tests for new cross-pass/provider rules (QairtPipeline, SimplifiedLayerNormToRMSNorm, removed-pass warnings, trustRemoteCode advisory).

src/lib/tests/pipelineValidation.test.ts

passCatalog.test.tsAdd catalog consistency tests vs passes.json +83/-0

Add catalog consistency tests vs passes.json

• Adds tests ensuring OLIVE_VERSION and telemetry strings match 0.13.0 and that PASS_CATALOG is consistent with the MCP passes.json knowledge base.

src/lib/passCatalog.test.ts

qnnReadiness.test.tsUpdate QNN readiness tests for new provider handling +1/-0

Update QNN readiness tests for new provider handling

• Adjusts QNN readiness/unit tests to account for the new QnnAbiExecutionProvider and/or updated QNN gating logic.

src/lib/qnnReadiness.test.ts

spec.test.tsAdd venv spec tests for upgraded Olive pin +125/-0

Add venv spec tests for upgraded Olive pin

• Adds unit tests validating VENV_SPEC_VERSION bump and that the pinned olive-ai install range includes 0.13.0 (and excludes incompatible versions).

src/server/services/venv/spec.test.ts

Documentation (1) +189 / -26
troubleshooting.jsonRevise troubleshooting KB entries/metadata +189/-26

Revise troubleshooting KB entries/metadata

• Updates troubleshooting knowledge base metadata and normalizes/extends entry patterns and suggested config patches for diagnosis workflows.

olive-mcp-server/olive_mcp_server/knowledge_base/troubleshooting.json

Other (8) +2730 / -730
compatibility_matrix.jsonRefresh compatibility matrix data/versioning +575/-283

Refresh compatibility matrix data/versioning

• Updates the compatibility matrix knowledge base content and metadata (version/date), reflecting the latest supported models/passes/hardware combinations.

olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json

hardware_profiles.jsonUpdate hardware profiles knowledge base +381/-78

Update hardware profiles knowledge base

• Expands and adjusts hardware profile definitions used by the MCP knowledge base for recommendation and validation workflows.

olive-mcp-server/olive_mcp_server/knowledge_base/hardware_profiles.json

passes.jsonSync passes knowledge base to Olive 0.13.0 +1509/-358

Sync passes knowledge base to Olive 0.13.0

• Large update to the pass catalog knowledge base generated from the olive-ai CLI, adding new passes and updating metadata for 0.13.0.

olive-mcp-server/olive_mcp_server/knowledge_base/passes.json

sync-pass-catalog.mjsEnforce olive-ai 0.13.x for pass catalog sync +23/-1

Enforce olive-ai 0.13.x for pass catalog sync

• Adds a version check before extracting passes and writes additional metadata fields (olive_version/version/last_updated) into the generated passes.json output.

scripts/sync-pass-catalog.mjs

issueReport.tsReport Olive 0.13.0 in telemetry/issue reports +1/-1

Report Olive 0.13.0 in telemetry/issue reports

• Updates the reported Olive version string so diagnostics reflect the new supported release.

src/lib/issueReport.ts

passCatalog.tsUpgrade pass catalog to Olive 0.13.0 +233/-7

Upgrade pass catalog to Olive 0.13.0

• Bumps OLIVE_VERSION, adds a validation category, and expands the pass catalog entries to match the Olive 0.13.0 reference set.

src/lib/passCatalog.ts

allowedTools.tsAllow Phase 3 autonomous agent MCP tool names +6/-0

Allow Phase 3 autonomous agent MCP tool names

• Adds the new agent autonomy tools (execute_and_observe, plan_optimization, diagnose_and_fix, compare_results, get_model_info) to the server-side allowlist.

src/server/services/mcp/allowedTools.ts

spec.tsBump venv spec version and raise Olive lower bound +2/-2

Bump venv spec version and raise Olive lower bound

• Increments VENV_SPEC_VERSION and updates the pinned olive-ai installation range to avoid older unsupported releases.

src/server/services/venv/spec.ts

@greptile-apps

greptile-apps Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds autonomous MCP tools for executing, diagnosing, comparing, and inspecting optimization jobs while updating Olive 0.13-compatible catalogs and migration logic.

  • Registers the new agent tools with the MCP server and Studio allowlist.
  • Adds preference-weighted multi-job comparison and execution polling.
  • Refreshes pass, hardware, compatibility, troubleshooting, validation, and migration data.

Confidence Score: 2/5

The PR is not safe to merge because comparison can select cancelled or incompletely measured jobs and execution results can discard a successful zero exit code.

Cancelled jobs still enter the scoreable set, missing metrics still reduce each job’s scoring denominator, and exitCode: 0 is still discarded by truthiness-based fallback logic.

Files Needing Attention: olive-mcp-server/olive_mcp_server/tools/agent_compare.py; olive-mcp-server/olive_mcp_server/tools/agent_execute.py

Important Files Changed

Filename Overview
olive-mcp-server/olive_mcp_server/tools/agent_compare.py Adds multi-job weighted comparison, but cancelled jobs and incomplete metric sets can still produce an invalid winner.
olive-mcp-server/olive_mcp_server/tools/agent_execute.py Adds submission and terminal-state polling, but successful zero exit codes are still lost.
olive-mcp-server/olive_mcp_server/mcp_server.py Registers the four new autonomous-loop tools, and the previously missing planner registration is no longer present.
olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py Adds diagnosis-driven recipe patching and best-effort validation.
src/lib/passMigration.ts Adds parameter migration infrastructure; the current migration table is empty and no present prototype-key path is reachable.
olive-mcp-server/olive_mcp_server/tools/agent_model_info.py Adds Hugging Face metadata lookup with local heuristic fallbacks.

Reviews (2): Last reviewed commit: "fix: Emit the supported KQuant parameter" | Re-trigger Greptile

Comment thread olive-mcp-server/olive_mcp_server/mcp_server.py Outdated
Comment thread olive-mcp-server/olive_mcp_server/tools/agent_compare.py
Comment on lines +119 to +120
if val is None:
continue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing metrics inflate comparisons

When compared jobs expose different subsets of metrics, missing values are removed from each job's denominator while singleton metrics receive a full normalized score. An incompletely measured job can therefore tie or outrank a fully measured result without being comparable on the requested criteria.

Prompt To Fix With AI
This is a comment left during a code review.
Path: olive-mcp-server/olive_mcp_server/tools/agent_compare.py
Line: 119-120

Comment:
**Missing metrics inflate comparisons**

When compared jobs expose different subsets of metrics, missing values are removed from each job's denominator while singleton metrics receive a full normalized score. An incompletely measured job can therefore tie or outrank a fully measured result without being comparable on the requested criteria.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Devin

Comment thread olive-mcp-server/olive_mcp_server/tools/agent_execute.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56d03d6e4f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +98 to +100
"plan_optimization": (
"olive_mcp_server.tools.agent_planner",
"plan_optimization",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Provide the registered planner module

Starting the MCP server calls _build_mcp(), which resolves every entry in _TOOL_IMPORTS; this entry imports olive_mcp_server.tools.agent_planner, but that module is absent from the commit and repository tree. Consequently, a normal stdio or SSE startup raises ModuleNotFoundError before FastMCP begins serving, even if plan_optimization is never called.

Useful? React with 👍 / 👎.

Looks for latency_ms, model_size_mb, and accuracy in the latestMetrics
field (or latest_metrics fallback).
"""
raw = job_response.get("latestMetrics") or job_response.get("latest_metrics") or {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Read comparison metrics from an actual results source

For jobs returned by /api/olive/agent/status, latestMetrics is OliveJob.latestMetrics, whose repository type is GpuMetrics with only timestamp and gpus; it never contains latency_ms, model_size_mb, or accuracy. Thus completed jobs receive three None metrics and score 0.0, after which max() arbitrarily declares the first submitted ID the winner instead of comparing optimization results.

Useful? React with 👍 / 👎.

Comment on lines +180 to +182
if isinstance(updated_config, dict) and updated_config and applyable:
# Apply merge patch to produce fixed recipe
fixed_recipe = _apply_merge_patch(recipe, updated_config)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Translate diagnostic patches into Olive recipe structure

When a troubleshooting entry is applyable, its updated_config uses UI-oriented pass-type keys and params objects, such as passes.OnnxConversion.params, while generated Olive recipes use arbitrary pipeline keys whose entries contain type and config. Applying that object as a raw merge patch therefore leaves the existing pass unchanged and adds a malformed pass without a type; common fixes such as onnx-export-external-data return a recipe that cannot run.

Useful? React with 👍 / 👎.

Comment on lines +127 to +130
# If Studio is down or returned an error, treat as not validated
if isinstance(response.get("error"), str) and response["error"]:
return False
return True

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor the validation result before reporting success

Studio's validate_optimization_job returns a normal payload with valid: false and an errors array for an invalid recipe, without an error string. This function treats every such response as successful, so diagnose_and_fix reports recipe_validated: true for recipes that preflight explicitly rejected.

Useful? React with 👍 / 👎.

Comment on lines +155 to +158
# Capture exit code
exit_code = status_response.get("exitCode") or status_response.get("exit_code")
if exit_code is not None:
last_exit_code = exit_code

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve a successful zero exit code

On every normally completed job, the status endpoint returns exitCode: 0; because 0 is falsy, this expression falls through to the absent snake-case field and produces None. The final execute_and_observe response consequently loses the successful exit code, preventing callers from distinguishing a clean process exit from an unavailable exit status.

Useful? React with 👍 / 👎.

Comment on lines +227 to +232
if status not in _TERMINAL_STATES:
reason = f"status_{status}" if status != "unknown" else "status_unknown"
excluded_jobs.append({"job_id": jid, "reason": reason})
continue

# Job is completed (only non-failed terminal state that passes)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude cancelled jobs from comparison

When a requested job has status cancelled, it passes this terminal-state check and is appended to scoreable, despite the tool contract saying cancelled jobs are excluded. Once real result metrics are available, a cancelled job can therefore be selected as the winner, or at minimum count toward the two-job threshold and produce a misleading comparison.

Useful? React with 👍 / 👎.

@qodo-code-review

qodo-code-review Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (5) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. QNN ABI breaks exhaustiveness ✓ Resolved 🐞 Bug ≡ Correctness
Description
Adding QnnAbiExecutionProvider to IHVProvider without adding a case to
mandatoryFamilyForProvider makes the switch default receive a non-never value, causing
TypeScript compilation to fail. The same omission also causes Studio recipe bridge and chat inputs
to discard the newly advertised provider.
Code

src/types.ts[41]

+  | "QnnAbiExecutionProvider"
Relevance

●●● Strong

Missing exhaustive switch cases after union expansion can break TS build; such compile-break fixes
get accepted.

PR-#199

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The union now includes QNN ABI, but mandatoryFamilyForProvider has an exhaustive never default
without that case. Input sanitizers also only assign providers present in allowlists that omit QNN
ABI.

src/types.ts[38-44]
src/lib/venvFamily.ts[116-143]
src/server/services/mcp/studioRecipeBridge.ts[21-38]
src/server/services/mcp/studioRecipeBridge.ts[119-125]
src/lib/chatActions.ts[78-85]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new provider union member is not handled by exhaustive provider routing and is missing from provider input allowlists.

## Issue Context
Route QNN ABI to the `qnn` venv family and add its canonical ID and aliases to all exhaustive provider catalogs, bridge sanitizers, and tests.

## Fix Focus Areas
- src/types.ts[38-44]
- src/lib/venvFamily.ts[17-60]
- src/lib/venvFamily.ts[116-143]
- src/server/services/mcp/studioRecipeBridge.ts[21-38]
- src/server/services/mcp/studioRecipeBridge.ts[119-125]
- src/lib/chatActions.ts[9-19]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. compare_results registration breaks server via missing agent_planner module ✓ Resolved 🐞 Bug ≡ Correctness
Description
mcp_server.py registers plan_optimization pointing to olive_mcp_server.tools.agent_planner, but that
module does not exist anywhere in the repository (only agent_compare.py, agent_diagnosis.py,
agent_execute.py, and agent_model_info.py were added). Since _build_mcp() calls _iter_tools(), which
eagerly calls _resolve_tool() (and therefore importlib.import_module) for every entry in
_TOOL_IMPORTS including plan_optimization, building the MCP server (and thus registering
compare_results and all other tools) raises ModuleNotFoundError and crashes server startup / the mcp
attribute lazy-init.
Code

olive-mcp-server/olive_mcp_server/mcp_server.py[R98-101]

+    "plan_optimization": (
+        "olive_mcp_server.tools.agent_planner",
+        "plan_optimization",
+    ),
Relevance

●●● Strong

Missing/unresolvable module would crash startup; team has accepted fixes for unresolved imports.

PR-#199
PR-#73

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
_build_mcp() (lines 172-179) iterates _iter_tools() which for every name in _TOOL_IMPORTS calls
_resolve_tool(name) (lines 164-169); _resolve_tool imports the target module via
importlib.import_module (lines 122-140) unconditionally, and there is no
olive_mcp_server/tools/agent_planner.py file in the repository (confirmed via directory listing of
olive-mcp-server/olive_mcp_server/tools/), so import of plan_optimization fails with
ModuleNotFoundError, which is raised whenever mcp / TOOLS is first accessed (i.e., whenever the
server actually starts or the compare_results tool being added in this PR is exercised through the
shared registry).

olive-mcp-server/olive_mcp_server/mcp_server.py[164-179]
olive-mcp-server/olive_mcp_server/mcp_server.py[122-140]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`_TOOL_IMPORTS` in `mcp_server.py` registers a `plan_optimization` tool pointing at `olive_mcp_server.tools.agent_planner`, but that module file was never added to the repository in this PR (or any prior commit). Because `_build_mcp()` eagerly resolves every tool in `_TOOL_IMPORTS` via `importlib.import_module`, this causes a `ModuleNotFoundError` that crashes the whole MCP server (and therefore blocks the new `compare_results` tool from ever being registered/served) whenever `mcp_server.mcp` or `mcp_server.TOOLS` is accessed.

## Issue Context
`compare_results` was added correctly (`agent_compare.py`) and its own registration entry is fine, but it shares the `_TOOL_IMPORTS` dict with the broken `plan_optimization` entry, so the whole tool registry fails to build.

## Fix Focus Areas
- olive-mcp-server/olive_mcp_server/mcp_server.py[98-101]
- olive-mcp-server/olive_mcp_server/tools (add missing agent_planner.py implementing plan_optimization, or remove/comment out the plan_optimization entry until the module ships)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Diagnosis uses wrong proxy field ✓ Resolved 🐞 Bug ≡ Correctness
Description
_validate_fixed_recipe sends tool, but /api/mcp/tool requires toolName. Every
repaired-recipe validation is rejected before invocation, so recipe_validated remains false even
for valid fixes.
Code

olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py[R122-125]

+    response = studio_request(
+        "POST",
+        _VALIDATE_TOOL_PATH,
+        body={"tool": "validate_optimization_job", "args": {"recipe": fixed_recipe}},
Relevance

●●● Strong

Wrong request field prevents validation entirely; similar request-shape fixes have been accepted.

PR-#107

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The diagnosis request sends tool, while the route parser requires toolName and invokes only
body.parsed.toolName; the resulting HTTP error is converted to False.

olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py[116-137]
src/server/routes/mcp.ts[245-273]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The diagnosis tool uses the wrong MCP proxy request field, preventing all repaired recipes from being validated.

## Issue Context
Change the request body to use `toolName`, preserve `args`, and add a test that verifies both valid and invalid fixed recipes through the proxy contract.

## Fix Focus Areas
- olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py[116-137]
- src/server/routes/mcp.ts[245-273]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View action required (2)
4. KQuant emits unknown parameter ✓ Resolved 🐞 Bug ≡ Correctness
Description
buildKquantQuantizer emits is_symmetric, while both new KQuant schemas define the option as
symmetric. Recipes generated through the new KQuant path therefore contain an unsupported pass
parameter and can fail validation or execution.
Code

src/lib/oliveRecipeBuilder.ts[R419-422]

+        bits,
+        is_symmetric: true,
+        group_size: 128,
+      },
Relevance

●●● Strong

Schema key mismatch (is_symmetric vs symmetric) is a deterministic bug likely to break
validation/execution.

PR-#219

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The builder sends is_symmetric for both selected pass types, while each corresponding catalog
entry exposes only symmetric.

src/lib/oliveRecipeBuilder.ts[412-425]
olive-mcp-server/olive_mcp_server/knowledge_base/passes.json[2752-2771]
olive-mcp-server/olive_mcp_server/knowledge_base/passes.json[2811-2830]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Generated KQuant recipes use a parameter name that does not exist in either KQuant pass schema.

## Issue Context
Both `KQuant` and `OnnxKquantQuantization` use `symmetric`; update the shared builder and its assertions to match the catalog.

## Fix Focus Areas
- src/lib/oliveRecipeBuilder.ts[412-425]
- src/lib/__tests__/oliveRecipeBuilder.test.ts[1248-1257]
- olive-mcp-server/olive_mcp_server/knowledge_base/passes.json[2752-2771]
- olive-mcp-server/olive_mcp_server/knowledge_base/passes.json[2811-2830]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Comparison reads GPU telemetry 🐞 Bug ≡ Correctness
Description
compare_results expects latency, model size, and accuracy in latestMetrics, but the status
endpoint exposes GPU sampling telemetry there. Every completed job therefore receives a zero score
and input order determines the reported winner.
Code

olive-mcp-server/olive_mcp_server/tools/agent_compare.py[40]

+    raw = job_response.get("latestMetrics") or job_response.get("latest_metrics") or {}
Relevance

●● Moderate

Likely API/contract mismatch; fix depends on intended status payload shape and scoring design.

PR-#107

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The comparison extractor requests fields absent from the status endpoint's GpuMetrics payload; its
missing values are later scored as zero, after which max chooses the first tied entry.

olive-mcp-server/olive_mcp_server/tools/agent_compare.py[34-60]
olive-mcp-server/olive_mcp_server/tools/agent_compare.py[117-146]
olive-mcp-server/olive_mcp_server/tools/agent_compare.py[261-265]
src/server/routes/olive.ts[98-106]
src/server/types.ts[124-135]
src/lib/gpuMetrics.ts[1-14]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`compare_results` reads optimization-result metrics from a field that contains only GPU telemetry, so comparisons return zero scores and an arbitrary winner.

## Issue Context
The Studio status contract types `latestMetrics` as `GpuMetrics` (`timestamp` and `gpus`). Add an actual persisted optimization-result metric contract or derive the supported metrics from completed artifacts/results, then consume that contract in the tool.

## Fix Focus Areas
- olive-mcp-server/olive_mcp_server/tools/agent_compare.py[34-60]
- src/server/routes/olive.ts[98-106]
- src/server/types.ts[124-135]
- src/lib/gpuMetrics.ts[1-14]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

6. Cancelled jobs are scored 🐞 Bug ≡ Correctness
Description
The terminal-state filter excludes failed jobs but lets cancelled jobs enter scoreable,
contradicting the completed-only intent. A cancelled run can consequently be selected as the
comparison winner despite never producing a completed result.
Code

olive-mcp-server/olive_mcp_server/tools/agent_compare.py[R227-230]

+            if status not in _TERMINAL_STATES:
+                reason = f"status_{status}" if status != "unknown" else "status_unknown"
+                excluded_jobs.append({"job_id": jid, "reason": reason})
+                continue
Relevance

●●● Strong

Scoring cancelled jobs contradicts “completed-only” intent; excluding them is a straightforward
correctness fix.

PR-#73

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
cancelled belongs to _TERMINAL_STATES, and all terminal states except failed are appended to
scoreable; the server cancellation path finalizes such jobs without completing optimization.

olive-mcp-server/olive_mcp_server/tools/agent_compare.py[20-25]
olive-mcp-server/olive_mcp_server/tools/agent_compare.py[221-238]
src/server/routes/olive.ts[129-162]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Cancelled jobs pass the comparison filter and participate in winner selection even though optimization did not complete.

## Issue Context
The status model has three terminal states, but only `completed` is a valid comparison candidate. Return an explicit exclusion reason for both failed and cancelled jobs.

## Fix Focus Areas
- olive-mcp-server/olive_mcp_server/tools/agent_compare.py[22-22]
- olive-mcp-server/olive_mcp_server/tools/agent_compare.py[221-238]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Migration overwrites current overrides 🐞 Bug ☼ Reliability
Description
When state contains both MobiusModelBuilder and MobiusBuilder, migration unconditionally
replaces the current-name override with the legacy value. Hydration or state replacement can
therefore silently discard the user's newer override configuration.
Code

src/lib/passMigration.ts[R91-94]

+      // Pass renamed — move override entry to new key.
+      overrides[migration.newName] = overrides[migration.oldName];
+      delete overrides[migration.oldName];
+      renamedPasses.push({ oldName: migration.oldName, newName: migration.newName });
Relevance

●● Moderate

Migration overwrite behavior is edge-case and policy-dependent; could be accepted but not clearly
mandated.

PR-#201

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The destination assignment is unconditional, and the store applies this migration during both state
replacement and persisted-state merge.

src/lib/passMigration.ts[82-102]
src/lib/stores/pipelineStore.ts[53-63]
src/lib/stores/pipelineStore.ts[93-97]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Pass-name migration loses configuration when both legacy and current override keys are present.

## Issue Context
Define conflict precedence explicitly, preferably preserving the current-name entry and deleting only the legacy key, and add a both-keys regression test.

## Fix Focus Areas
- src/lib/passMigration.ts[82-102]
- src/lib/__tests__/passMigrationIntegration.test.ts[13-43]
- src/lib/stores/pipelineStore.ts[53-63]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

8. compare_results winner tie-break is nondeterministic 🐞 Bug ≡ Correctness
Description
When multiple scored jobs have the exact same highest score (e.g. identical metrics), `max(scored,
key=lambda x: x["score"])` returns the first max-scoring entry in list order, which is deterministic
given input order, but the function documents no defined tie-break rule and the reasoning text
doesn't mention ties, making the winner selection appear arbitrary to callers when scores are equal
(a common case when only 2 jobs are compared with identical metrics or all metrics missing, since
score defaults to 0.0 for every job with total_weight <= 0).
Code

olive-mcp-server/olive_mcp_server/tools/agent_compare.py[R263-265]

+        # Select winner (highest score)
+        winner_entry = max(scored, key=lambda x: x["score"])
+        winner = winner_entry["job_id"]
Relevance

●● Moderate

Tie-break policy is product/UX semantics; team has previously rejected similar comparison-semantics
tweaks.

PR-#58

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
In _normalize_and_score, score is 0.0 whenever total_weight <= 0 (line 140), which happens when all
scoreable jobs have no usable metrics (e.g. latestMetrics is entirely absent). In that case every
entry in scored has score 0.0, and max(scored, key=lambda x: x["score"]) (line 264) silently
picks the first job in job_ids order as 'winner' with no signal to the caller that the win was
arbitrary rather than metric-driven.

olive-mcp-server/olive_mcp_server/tools/agent_compare.py[140-141]
olive-mcp-server/olive_mcp_server/tools/agent_compare.py[263-265]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
When no scoreable job has any usable metric, every job's score computes to 0.0, and `compare_results` still confidently reports a 'winner' (the first job in input order) with reasoning text that doesn't disclose the tie/lack of signal.

## Issue Context
See `_normalize_and_score` and the winner-selection block in `compare_results`.

## Fix Focus Areas
- olive-mcp-server/olive_mcp_server/tools/agent_compare.py[110-141]
- olive-mcp-server/olive_mcp_server/tools/agent_compare.py[261-268]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. Runtime version remains unconstrained 🐞 Bug ☼ Reliability
Description
The catalog and builders target Olive 0.13.0, but the runtime requirement still permits 0.12.x and
any later 0.x release. If dependency resolution selects 0.12.x, newly generated passes such as
QairtPipeline and KQuant are unavailable, so Studio can build recipes its installed runtime
cannot execute.
Code

src/server/services/venv/spec.ts[R58-61]

+export const VENV_SPEC_VERSION = 5;

/** Pinned olive-ai range for family builds (avoid floating major). */
-export const PINNED_OLIVE_AI_INSTALL = "olive-ai>=0.9.0,<1";
+export const PINNED_OLIVE_AI_INSTALL = "olive-ai>=0.12.0,<1";
Relevance

● Weak

Team previously rejected tighter/pinned venv spec constraints; likely to keep wider Olive range.

PR-#111

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The runtime range explicitly accepts 0.12.0, while the bundled catalog declares 0.13.0 and includes
passes introduced for that target; the new test intentionally preserves acceptance of 0.12.0.

src/server/services/venv/spec.ts[57-63]
src/server/services/venv/spec.test.ts[77-90]
src/lib/passCatalog.ts[1-12]
olive-mcp-server/olive_mcp_server/knowledge_base/passes.json[1-7]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The environment dependency range does not enforce the Olive version represented by the bundled pass catalog.

## Issue Context
Constrain the install to the supported 0.13 line (or exact tested release), update the compatibility test, and bump the environment spec if the constraint changes.

## Fix Focus Areas
- src/server/services/venv/spec.ts[57-63]
- src/server/services/venv/spec.test.ts[72-97]
- src/lib/passCatalog.ts[1-12]
- olive-mcp-server/olive_mcp_server/knowledge_base/passes.json[1-7]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
✅ Compliance rules (platform): 25 rules
✅ REVIEW.md
Review mode: 🧠 Deep: This is an unusually dense, cross-cutting change with 321 independent edit sites spanning a new MCP tool, multiple agent tools, knowledge-base data, catalog/migration logic, validation, runtime, and service integrations, making independent missed defects materially likely.

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Looks for latency_ms, model_size_mb, and accuracy in the latestMetrics
field (or latest_metrics fallback).
"""
raw = job_response.get("latestMetrics") or job_response.get("latest_metrics") or {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Comparison reads gpu telemetry 🐞 Bug ≡ Correctness

compare_results expects latency, model size, and accuracy in latestMetrics, but the status
endpoint exposes GPU sampling telemetry there. Every completed job therefore receives a zero score
and input order determines the reported winner.
Agent Prompt
## Issue description
`compare_results` reads optimization-result metrics from a field that contains only GPU telemetry, so comparisons return zero scores and an arbitrary winner.

## Issue Context
The Studio status contract types `latestMetrics` as `GpuMetrics` (`timestamp` and `gpus`). Add an actual persisted optimization-result metric contract or derive the supported metrics from completed artifacts/results, then consume that contract in the tool.

## Fix Focus Areas
- olive-mcp-server/olive_mcp_server/tools/agent_compare.py[34-60]
- src/server/routes/olive.ts[98-106]
- src/server/types.ts[124-135]
- src/lib/gpuMetrics.ts[1-14]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +227 to +230
if status not in _TERMINAL_STATES:
reason = f"status_{status}" if status != "unknown" else "status_unknown"
excluded_jobs.append({"job_id": jid, "reason": reason})
continue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

2. Cancelled jobs are scored 🐞 Bug ≡ Correctness

The terminal-state filter excludes failed jobs but lets cancelled jobs enter scoreable,
contradicting the completed-only intent. A cancelled run can consequently be selected as the
comparison winner despite never producing a completed result.
Agent Prompt
## Issue description
Cancelled jobs pass the comparison filter and participate in winner selection even though optimization did not complete.

## Issue Context
The status model has three terminal states, but only `completed` is a valid comparison candidate. Return an explicit exclusion reason for both failed and cancelled jobs.

## Fix Focus Areas
- olive-mcp-server/olive_mcp_server/tools/agent_compare.py[22-22]
- olive-mcp-server/olive_mcp_server/tools/agent_compare.py[221-238]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread src/lib/oliveRecipeBuilder.ts
Comment thread src/types.ts
Comment thread olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py Outdated
Comment thread src/lib/passMigration.ts
Comment on lines +91 to +94
// Pass renamed — move override entry to new key.
overrides[migration.newName] = overrides[migration.oldName];
delete overrides[migration.oldName];
renamedPasses.push({ oldName: migration.oldName, newName: migration.newName });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

6. Migration overwrites current overrides 🐞 Bug ☼ Reliability

When state contains both MobiusModelBuilder and MobiusBuilder, migration unconditionally
replaces the current-name override with the legacy value. Hydration or state replacement can
therefore silently discard the user's newer override configuration.
Agent Prompt
## Issue description
Pass-name migration loses configuration when both legacy and current override keys are present.

## Issue Context
Define conflict precedence explicitly, preferably preserving the current-name entry and deleting only the legacy key, and add a both-keys regression test.

## Fix Focus Areas
- src/lib/passMigration.ts[82-102]
- src/lib/__tests__/passMigrationIntegration.test.ts[13-43]
- src/lib/stores/pipelineStore.ts[53-63]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread olive-mcp-server/olive_mcp_server/mcp_server.py Outdated
Comment on lines +263 to +265
# Select winner (highest score)
winner_entry = max(scored, key=lambda x: x["score"])
winner = winner_entry["job_id"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Informational

9. Compare_results winner tie-break is nondeterministic 🐞 Bug ≡ Correctness

When multiple scored jobs have the exact same highest score (e.g. identical metrics), `max(scored,
key=lambda x: x["score"])` returns the first max-scoring entry in list order, which is deterministic
given input order, but the function documents no defined tie-break rule and the reasoning text
doesn't mention ties, making the winner selection appear arbitrary to callers when scores are equal
(a common case when only 2 jobs are compared with identical metrics or all metrics missing, since
score defaults to 0.0 for every job with total_weight <= 0).
Agent Prompt
## Issue description
When no scoreable job has any usable metric, every job's score computes to 0.0, and `compare_results` still confidently reports a 'winner' (the first job in input order) with reasoning text that doesn't disclose the tie/lack of signal.

## Issue Context
See `_normalize_and_score` and the winner-selection block in `compare_results`.

## Fix Focus Areas
- olive-mcp-server/olive_mcp_server/tools/agent_compare.py[110-141]
- olive-mcp-server/olive_mcp_server/tools/agent_compare.py[261-268]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo Fixer

✅ Committed (4) · ☑ Fixed (4)

Grey Divider

Commits pushed directly to this PR — no separate fix PR opened.

Process — 4 fixed
  • ☑ Fixed: QNN ABI breaks exhaustiveness
  • ☑ Fixed: compare_results registration breaks server via missing agent_planner module
  • ☑ Fixed: Diagnosis uses wrong proxy field
  • ☑ Fixed: KQuant emits unknown parameter
  • ⏭ Skipped (1)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 39

🤖 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 `@olive-mcp-server/olive_mcp_server/knowledge_base/hardware_profiles.json`:
- Around line 120-150: Unify the QNN ABI target name across both knowledge-base
entries so compatibility lookups resolve consistently: update
olive-mcp-server/olive_mcp_server/knowledge_base/hardware_profiles.json lines
120-150 and
olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json lines
1169-1191 to use the same chosen string, following the exact-name convention
used by existing Qualcomm targets.

In `@olive-mcp-server/olive_mcp_server/knowledge_base/troubleshooting.json`:
- Around line 769-777: Update the troubleshooting matcher that evaluates entries
containing _pattern_hit_count so the olive_versions constraint is enforced for
the two version-gated entries in troubleshooting.json. Ensure their guidance is
returned only for Olive versions >=0.13.0, while preserving existing
case-insensitive substring matching and behavior for entries without
olive_versions.
- Around line 781-788: Update the troubleshooting entry’s updated_config object
so trust_remote_code is nested under input_model.config.load_kwargs rather than
directly under input_model.config, while preserving applyable: true and the
existing value.

In `@olive-mcp-server/olive_mcp_server/mcp_server.py`:
- Around line 98-101: Verify that olive_mcp_server.tools.agent_planner exists
and exports plan_optimization; if not, remove its registry entry from
olive-mcp-server/olive_mcp_server/mcp_server.py (lines 98-101) or add the module
in this PR. Also remove "plan_optimization" from
src/server/services/mcp/allowedTools.ts (lines 33-38) until the server-side tool
resolves.

In `@olive-mcp-server/olive_mcp_server/tools/agent_compare.py`:
- Around line 180-221: Add a dedicated test module covering compare_results
validation and scoring behavior, including single-metric jobs, equal metrics,
all jobs excluded, exactly two scoreable jobs, and each preference weighting.
Mock studio_request to isolate the comparison logic, then run the suite from
olive-mcp-server with python -m pytest tests -q.
- Around line 278-279: The top-level handlers return raw internal-error
dictionaries that omit the documented side_effect field. In
agent_compare.py:278-279, agent_execute.py:200-201, and
agent_model_info.py:232-233, replace each raw dictionary with the shared err
helper using the existing error type and message; ensure err includes
side_effect, or update the helper once to provide it, using the documented value
for agent_execute.
- Around line 126-138: Update the equal-value handling in the normalization
logic around the invert_set check so tied metrics receive their intended score
after direction inversion: apply inversion only to non-tied values, while
assigning the tied-case score after determining whether the metric is
lower-is-better. Preserve the existing weighted_sum and total_weight
calculations.
- Around line 44-54: Update _as_float to use math.isfinite(f) for rejecting NaN
and positive or negative infinity, replacing the self-comparison and explicit
infinity checks; import math as needed while preserving the existing None return
behavior.
- Around line 222-238: Update the job-filtering logic around _TERMINAL_STATES so
only status == "completed" proceeds to _extract_metrics and scoreable;
explicitly exclude cancelled (alongside failed and other non-completed states)
with an appropriate exclusion reason, and update the nearby comment to reflect
that only completed jobs are scored.

In `@olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py`:
- Around line 56-70: Update the context construction in the config-context
helper so the hardware probe summary from hardware_probe is appended before
recipe_keys, ensuring truncation preserves hardware-aware matching information.
Keep the existing overall _MAX_CONFIG_CONTEXT_LEN truncation behavior and
formatting unchanged.
- Around line 116-130: Update _validate_fixed_recipe to inspect Studio’s
validation payload: return True only when valid is true and no validation errors
are reported, return False for an explicit invalid result, and return None when
Studio is unreachable or returns an error. Update diagnose_and_fix to preserve
this distinction when setting recipe_validated and fix_confidence.

In `@olive-mcp-server/olive_mcp_server/tools/agent_execute.py`:
- Around line 109-171: The polling loop around studio_request must keep total
blocking time within effective_timeout by deriving each request’s timeout from
the remaining budget and passing it to studio_request, while preserving
terminal-state handling. Update the poll-error response to set timed_out based
on whether the elapsed duration has reached effective_timeout instead of
hardcoding False, and document the maximum blocking duration for MCP callers
near the tool’s timeout configuration or execution entry point.
- Around line 155-158: Update the status response extraction in the agent
execution flow to select exitCode versus exit_code based on key presence rather
than truthiness, preserving a returned exit code of 0 so last_exit_code is
assigned and reported. Apply the same presence-based fallback to latestMetrics
so an empty metrics dictionary is retained.
- Around line 118-119: Remove the unused `elapsed_seconds` assignment at the
start of the `while True` loop in the agent execution flow, while retaining the
later computation that is consumed by the loop logic.

In `@olive-mcp-server/olive_mcp_server/tools/agent_model_info.py`:
- Line 20: Replace the cross-module import of private _normalize_model_type in
get_model_info with a public shared API: rename/promote the function in
strategy_advisor or move it to a shared helper module, then update both its
definition and all callers to use the public symbol without the leading
underscore.
- Around line 119-131: Update _fetch_hf_metadata to validate model_id against
the allowed Hugging Face model-id pattern, rejecting traversal, whitespace,
control characters, and other invalid values before creating the request.
Percent-encode the validated model_id as a URL path segment before interpolating
it into the fixed _HF_API_BASE endpoint, while preserving the existing
None-on-failure behavior.
- Around line 24-108: The duplicated Python and TypeScript model-size and VRAM
heuristics can drift without synchronization coverage. Add a shared
fixture-driven test covering representative model identifiers, explicit size
parsing, family defaults, and the params_b × 2.0 estimate, asserting the Python
_infer_param_billions implementation agrees with the TypeScript vramEstimate
implementation; retain both implementations unless the Studio bridge is used
instead.

In `@src/lib/__tests__/passMigrationIntegration.test.ts`:
- Around line 116-137: The “full pipeline round-trip” test must verify migration
effects in the built recipe, not only its structure. Extend the assertions after
buildOliveRecipe to confirm recipe.passes excludes QairtGenAIBuilder and that
the MobiusBuilder override is applied, while preserving the existing defined,
passes, and input_model checks.

In `@src/lib/__tests__/passMigrationPBT.test.ts`:
- Around line 135-175: Update applyMigrations to accept an optional
migration-table parameter, defaulting to PARAM_MIGRATIONS for existing callers.
In the Property 3 test, pass the synthetic migration table directly to
applyMigrations and remove the in-place PARAM_MIGRATIONS mutation and
restoration logic.
- Around line 152-166: Update PassRecipeOverride in src/types.ts to include an
index signature accepting arbitrary pass configuration keys and unknown values,
matching applyMigrations. In src/lib/__tests__/passMigrationPBT.test.ts:152-166,
rely on the expanded type without adding casts. In
src/lib/__tests__/pipelineValidation.test.ts:804-838, remove the as unknown as
UIState["passRecipeOverrides"] casts at lines 807, 817, and 825; no other
changes are needed there.

In `@src/lib/__tests__/pipelineValidation.test.ts`:
- Around line 749-788: Add tests in the “0.13.0 validation rules” suite for the
mobius-builder-incompatible-qnn rule, covering both its incompatibility case and
an allowed non-conflicting provider case. Use the existing baseState,
basePasses, getPipelineValidation, and issue-ID assertion patterns, and verify
the issue ID is present only when the rule’s inverted provider condition is met.

In `@src/lib/defaultPasses.ts`:
- Line 29: Change the default trustRemoteCode value in the default pipeline
state to false so remote-code execution is opt-in. Ensure it is enabled only
through an explicit user action accompanied by a visible trust warning; if
local-trust policy requires retaining the default, document that policy and
update the review snapshot.

In `@src/lib/oliveRecipeBuilder.ts`:
- Around line 611-619: Update buildOnnxDiscrepancyCheck so it no longer assigns
_state.userScript to config.test_data_dir, since userScript is a Python file
path rather than a directory. Remove this mapping unless a dedicated test-data
directory field already exists in the available state/config symbols, then use
that field instead.
- Around line 698-702: Update the Hugging Face model construction flow in
oliveRecipeBuilder to place trust_remote_code inside HfModel
inputModel.load_kwargs rather than inputConfig. Merge it with the load kwargs
returned by buildHfLoadKwargs() for every Hugging Face build, preserving any
existing memory-offload kwargs instead of overwriting them.
- Around line 151-163: Update both pass-order lists in the surrounding
recipe-building logic so mobius_builder runs in the source-model stage before
ONNX conversion, transformation optimization, and quantization. Make
mobius_builder mutually exclusive with conversion, preserving the existing
ordering of unrelated passes.

In `@src/lib/passCatalog.test.ts`:
- Line 4: Remove the unused PassCatalogEntry type from the import in
passCatalog.test.ts, while preserving the PASS_CATALOG and OLIVE_VERSION
imports.
- Around line 31-34: Update the PASS_CATALOG consistency test to compare pass
identifiers from PASS_CATALOG and passesJson.passes, asserting both sets contain
the same names in both directions rather than checking only their lengths. Keep
the existing test scope and use the identifier field exposed by each entry.

In `@src/lib/passCatalog.ts`:
- Around line 154-160: Update the pass name in the catalog entry for
OnnxKquantQuantization to the registered identifier OnnxKQuantQuantization,
preserving the existing category, description, inputs, and outputs.

In `@src/lib/passMigration.ts`:
- Around line 99-101: Add the ordering constraint to the ParamMigration
documentation: state that PARAM_MIGRATIONS runs after renames and that
migration.passType must use the already-renamed key, such as MobiusModelBuilder.
Keep the migration logic unchanged.
- Around line 83-96: Update the rename branch in the migration loop over
PASS_NAME_MIGRATIONS to detect an existing overrides[migration.newName] before
moving the legacy entry. Preserve the target entry and emit the established
warning or conflict behavior instead of overwriting it, while retaining the
current move-and-delete behavior when no target entry exists.
- Around line 78-80: Update the overrides initialization in passMigration to use
const and clone state.passRecipeOverrides with structuredClone instead of the
JSON round-trip, while retaining the empty-object fallback and preserving
undefined values.

In `@src/lib/pipelineValidation.ts`:
- Around line 696-714: Move the REMOVED_PASSES constant out of getAdvisoryIssues
and define it at module scope alongside the other module constants. Keep its
entries and the existing passRecipeOverrides validation behavior unchanged.
- Around line 460-506: Remove the unnecessary `(provider as string)` casts from
the provider comparisons in the `qairt-pipeline-requires-qnn`,
`simplified-layernorm-requires-qnn`, and `mobius-builder-incompatible-qnn`
validation rules. Compare `provider` directly with `"QnnAbiExecutionProvider"`
so TypeScript can validate the provider name.
- Around line 1023-1028: Update the types used by coercePassFields and the
sanitizer so persisted passes are represented as partial state, allowing
trustRemoteCode to be absent during migration. Preserve the existing HuggingFace
fallback that sets trustRemoteCode to true, while keeping the finalized Passes
type boolean-required after sanitization.

In `@src/lib/stores/pipelineStore.ts`:
- Around line 96-97: Update the rehydration path around applyMigrations and
replaceState so the migration report’s four counters are logged after migrations
complete. Reuse the existing replaceState logging behavior or extract a shared
helper, ensuring renamed and removed pass overrides produce the same signal
during reload.
- Around line 53-63: Update the migration logging in replaceState to use an
ESLint-approved console method, such as console.warn, instead of console.info,
and include the discardedParams count in the message alongside renamedPasses and
removedPasses.

In `@src/server/services/mcp/allowedTools.ts`:
- Around line 33-38: Update the allowlist comment immediately above
execute_and_observe in the relevant tools configuration to explicitly identify
it as write-capable and subject to the appropriate trust boundary, while keeping
the other four read-only tools grouped separately. Do not change tool behavior
or address plan_optimization in this change.

In `@src/server/services/venv/spec.ts`:
- Around line 60-61: Align the Olive version policy across
src/server/services/venv/spec.ts:60-61, scripts/sync-pass-catalog.mjs:132-166,
and src/server/services/venv/spec.test.ts:77-83. Update PINNED_OLIVE_AI_INSTALL
and the catalog-generation validation to use the same supported Olive range,
replace fixed 0.13.0 catalog metadata with the detected supported version, and
adjust the related test expectations accordingly.

In `@src/types.ts`:
- Around line 168-185: Make trustRemoteCode optional in src/types.ts (lines
168-185) so persisted states may omit it while preserving the runtime undefined
guard in src/lib/pipelineValidation.ts (lines 1023-1028). Update every full
passes object literal that omits the six newly required fields—such as
baseState() in src/lib/__tests__/passParameterValidation.test.ts—to provide
mobiusBuilder, qairtPipeline, quantizeEmbeddingInt8, shareEmbeddingLmHead,
simplifiedLayerNormToRMSNorm, and onnxDiscrepancyCheck; no direct change is
required in pipelineValidation.ts beyond retaining its existing guard.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 897ba68f-7546-46c5-b0f0-a5152ed3cc9c

📥 Commits

Reviewing files that changed from the base of the PR and between 91155c3 and 56d03d6.

📒 Files selected for processing (33)
  • olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json
  • olive-mcp-server/olive_mcp_server/knowledge_base/hardware_profiles.json
  • olive-mcp-server/olive_mcp_server/knowledge_base/passes.json
  • olive-mcp-server/olive_mcp_server/knowledge_base/troubleshooting.json
  • olive-mcp-server/olive_mcp_server/mcp_server.py
  • olive-mcp-server/olive_mcp_server/tools/agent_compare.py
  • olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py
  • olive-mcp-server/olive_mcp_server/tools/agent_execute.py
  • olive-mcp-server/olive_mcp_server/tools/agent_model_info.py
  • olive-mcp-server/tests/test_compatibility_matrix.py
  • scripts/sync-pass-catalog.mjs
  • src/lib/__tests__/passMigrationIntegration.test.ts
  • src/lib/__tests__/passMigrationPBT.test.ts
  • src/lib/__tests__/passParameterValidation.test.ts
  • src/lib/__tests__/pipelineValidation.test.ts
  • src/lib/auditAutofix.ts
  • src/lib/chatActions.ts
  • src/lib/defaultPasses.ts
  • src/lib/issueReport.ts
  • src/lib/oliveRecipeBuilder.ts
  • src/lib/passCatalog.test.ts
  • src/lib/passCatalog.ts
  • src/lib/passMigration.ts
  • src/lib/pipelineValidation.ts
  • src/lib/providerRuntimeKind.ts
  • src/lib/qnnReadiness.test.ts
  • src/lib/stores/pipelineStore.ts
  • src/lib/vramEstimate.ts
  • src/server/services/mcp/allowedTools.ts
  • src/server/services/venv/spec.test.ts
  • src/server/services/venv/spec.ts
  • src/server/services/venv/status.ts
  • src/types.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • tonythethompson/QuickShell (manual)
  • tonythethompson/numan (manual)
  • tonythethompson/dependency-chain-substrate (manual)
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Greptile Review
  • GitHub Check: olive-pass-availability
⚠️ CI failures not shown inline (5)

GitHub Actions: CI / 1_python-tests.txt: feat(mcp):_add_execute_and_observe_tool

Conclusion: failure

View job details

##[group]Run python -m pytest tests -q --tb=short
 �[36;1mpython -m pytest tests -q --tb=short�[0m
 shell: /usr/bin/bash -e {0}
 env:
   pythonLocation: /opt/hostedtoolcache/Python/3.12.13/x64
   PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.13/x64/lib/pkgconfig
   Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.13/x64
   Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.13/x64
   Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.13/x64
   LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.13/x64/lib
 ##[endgroup]
 ........................................................................ [ 16%]
 ........................................................................ [ 32%]
 ..........................FFFF....F..................................... [ 48%]
 ........................................................................ [ 65%]
 ........................................................................ [ 81%]
 ........................................................................ [ 97%]
 .........                                                                [100%]
 =================================== FAILURES ===================================
 ________________________ test_docs_shipped_index_loads _________________________
 tests/test_index_store.py:35: in test_docs_shipped_index_loads
     assert loaded is not None
 E   assert None is not None
 ________________ test_get_or_build_uses_shipped_without_encode _________________
 tests/test_index_store.py:51: in test_get_or_build_uses_shipped_without_encode
     pairs, emb = docs_search.get_or_build_kb_index()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 olive_mcp_server/tools/docs_search.py:168: in get_or_build_kb_index
     embeddings = build_kb_index([t for _, t in texts])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 tests/test_index_store.py:48: in boom
     raise AssertionError("should not encode when shipped index matches")
 E   AssertionError: should not encode when shipped...

GitHub Actions: CI / validate: feat(mcp):_add_execute_and_observe_tool

Conclusion: failure

View job details

##[group]Run pnpm lint
 �[36;1mpnpm lint�[0m
 shell: /usr/bin/bash -e {0}
 env:
   PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
 ##[endgroup]
 $ tsc --noEmit && eslint
 ##[error]src/components/features/execute/recipe-graph/RecipeValidationPanel.tsx(71,13): error TS2322: Type '"QnnAbiExecutionProvider"' is not assignable to type 'never'.

GitHub Actions: CI / python-tests: feat(mcp):_add_execute_and_observe_tool

Conclusion: failure

View job details

##[group]Run python -m pytest tests -q --tb=short
 �[36;1mpython -m pytest tests -q --tb=short�[0m
 shell: /usr/bin/bash -e {0}
 env:
   pythonLocation: /opt/hostedtoolcache/Python/3.12.13/x64
   PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.13/x64/lib/pkgconfig
   Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.13/x64
   Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.13/x64
   Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.13/x64
   LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.13/x64/lib
 ##[endgroup]
 ........................................................................ [ 16%]
 ........................................................................ [ 32%]
 ..........................FFFF....F..................................... [ 48%]
 ........................................................................ [ 65%]
 ........................................................................ [ 81%]
 ........................................................................ [ 97%]
 .........                                                                [100%]
 =================================== FAILURES ===================================
 ________________________ test_docs_shipped_index_loads _________________________
 tests/test_index_store.py:35: in test_docs_shipped_index_loads
     assert loaded is not None
 E   assert None is not None
 ________________ test_get_or_build_uses_shipped_without_encode _________________
 tests/test_index_store.py:51: in test_get_or_build_uses_shipped_without_encode
     pairs, emb = docs_search.get_or_build_kb_index()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 olive_mcp_server/tools/docs_search.py:168: in get_or_build_kb_index
     embeddings = build_kb_index([t for _, t in texts])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 tests/test_index_store.py:48: in boom
     raise AssertionError("should not encode when shipped index matches")
 E   AssertionError: should not encode when shipped...

GitHub Actions: CI / 2_validate.txt: feat(mcp):_add_execute_and_observe_tool

Conclusion: failure

View job details

##[group]Run pnpm lint
 �[36;1mpnpm lint�[0m
 shell: /usr/bin/bash -e {0}
 env:
   PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
 ##[endgroup]
 $ tsc --noEmit && eslint
 ##[error]src/components/features/execute/recipe-graph/RecipeValidationPanel.tsx(71,13): error TS2322: Type '"QnnAbiExecutionProvider"' is not assignable to type 'never'.

Commit Status: Vercel: Vercel

Conclusion: failure

Deployment rate limited — retry in 24 hours.
🧰 Additional context used
📓 Path-based instructions (19)
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

src/**/*.{ts,tsx}: Match existing naming, file layout, and TypeScript patterns in src/.
Put shared recipe logic in src/lib/, especially pipelineValidation.ts, oliveRecipeBuilder.ts, and recipePipeline.ts.

src/**/*.{ts,tsx}: Route every UI state mutation through commitUiStateUpdate in src/lib/pipelineValidation.ts so invariants are enforced; use replaceState for recipe imports and preset loads.
Use usePipelineState() as the shorthand hook for reading pipeline state.
Avoid export * barrel imports; import directly from the actual module file.

Follow the React conventions in docs/REACT_BEST_PRACTICES.md, especially eliminating waterfalls, avoiding barrel imports, and deferring non-critical third-party libraries.

src/**/*.{ts,tsx}: Keep pipeline and recipe validation logic in shared libraries rather than duplicating it in IHV cell helpers or inspectors.
Keep the UI AI provider catalog synchronized with the server registry, preferably through a shared provider ID list or a synchronization test; register new providers in both places.
Add coverage for recipe-graph/ and under-tested libraries including passCatalog, oliveRecipeHub, jobHistoryStore, and vramEstimate.
Confirm whether EnterpriseInfraPanel and PerformanceMetrics are required; remove them if they are orphaned and not mounted.

Files:

  • src/lib/issueReport.ts
  • src/lib/__tests__/passMigrationIntegration.test.ts
  • src/server/services/venv/status.ts
  • src/lib/__tests__/passParameterValidation.test.ts
  • src/lib/vramEstimate.ts
  • src/lib/chatActions.ts
  • src/lib/auditAutofix.ts
  • src/server/services/venv/spec.test.ts
  • src/lib/__tests__/pipelineValidation.test.ts
  • src/lib/__tests__/passMigrationPBT.test.ts
  • src/server/services/mcp/allowedTools.ts
  • src/lib/qnnReadiness.test.ts
  • src/lib/providerRuntimeKind.ts
  • src/server/services/venv/spec.ts
  • src/lib/oliveRecipeBuilder.ts
  • src/lib/passCatalog.ts
  • src/lib/defaultPasses.ts
  • src/lib/pipelineValidation.ts
  • src/lib/stores/pipelineStore.ts
  • src/lib/passCatalog.test.ts
  • src/lib/passMigration.ts
  • src/types.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{ts,tsx,js,jsx}: Place imports at the top of modules; use inline imports only for a documented circular dependency.
Run linting and ensure typecheck-related CI checks pass before submitting changes.
For UI or server changes, manually smoke-test development startup, recipe loading/building, validation banners, and live execution when execution behavior is touched.

Files:

  • src/lib/issueReport.ts
  • src/lib/__tests__/passMigrationIntegration.test.ts
  • src/server/services/venv/status.ts
  • src/lib/__tests__/passParameterValidation.test.ts
  • src/lib/vramEstimate.ts
  • src/lib/chatActions.ts
  • src/lib/auditAutofix.ts
  • src/server/services/venv/spec.test.ts
  • src/lib/__tests__/pipelineValidation.test.ts
  • src/lib/__tests__/passMigrationPBT.test.ts
  • src/server/services/mcp/allowedTools.ts
  • src/lib/qnnReadiness.test.ts
  • src/lib/providerRuntimeKind.ts
  • src/server/services/venv/spec.ts
  • src/lib/oliveRecipeBuilder.ts
  • src/lib/passCatalog.ts
  • src/lib/defaultPasses.ts
  • src/lib/pipelineValidation.ts
  • src/lib/stores/pipelineStore.ts
  • src/lib/passCatalog.test.ts
  • src/lib/passMigration.ts
  • src/types.ts
**/*.{js,jsx,ts,tsx,json,md,yaml,yml}

📄 CodeRabbit inference engine (CLAUDE.md)

Use pnpm for project package management and commands; do not use npm install, which is blocked by a preinstall guard.

Files:

  • src/lib/issueReport.ts
  • src/lib/__tests__/passMigrationIntegration.test.ts
  • src/server/services/venv/status.ts
  • src/lib/__tests__/passParameterValidation.test.ts
  • src/lib/vramEstimate.ts
  • src/lib/chatActions.ts
  • src/lib/auditAutofix.ts
  • src/server/services/venv/spec.test.ts
  • src/lib/__tests__/pipelineValidation.test.ts
  • src/lib/__tests__/passMigrationPBT.test.ts
  • src/server/services/mcp/allowedTools.ts
  • src/lib/qnnReadiness.test.ts
  • src/lib/providerRuntimeKind.ts
  • src/server/services/venv/spec.ts
  • src/lib/oliveRecipeBuilder.ts
  • src/lib/passCatalog.ts
  • src/lib/defaultPasses.ts
  • olive-mcp-server/olive_mcp_server/knowledge_base/hardware_profiles.json
  • src/lib/pipelineValidation.ts
  • src/lib/stores/pipelineStore.ts
  • src/lib/passCatalog.test.ts
  • src/lib/passMigration.ts
  • olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json
  • olive-mcp-server/olive_mcp_server/knowledge_base/troubleshooting.json
  • src/types.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Account for React 19 and Vite 8 breaking changes rather than assuming conventions from earlier major versions; consult current documentation when API shapes are uncertain.
Do not trigger live Olive execution or batch runs in CI or virtual machines; limit CI validation to CPU-only recipe building, JSON export, and validation.

Resolve ESLint errors; warnings are acceptable within the configured maximum of 20, but non-zero lint failures and reported errors must not be ignored.

Files:

  • src/lib/issueReport.ts
  • src/lib/__tests__/passMigrationIntegration.test.ts
  • src/server/services/venv/status.ts
  • src/lib/__tests__/passParameterValidation.test.ts
  • src/lib/vramEstimate.ts
  • src/lib/chatActions.ts
  • src/lib/auditAutofix.ts
  • src/server/services/venv/spec.test.ts
  • src/lib/__tests__/pipelineValidation.test.ts
  • src/lib/__tests__/passMigrationPBT.test.ts
  • src/server/services/mcp/allowedTools.ts
  • src/lib/qnnReadiness.test.ts
  • src/lib/providerRuntimeKind.ts
  • src/server/services/venv/spec.ts
  • src/lib/oliveRecipeBuilder.ts
  • src/lib/passCatalog.ts
  • src/lib/defaultPasses.ts
  • src/lib/pipelineValidation.ts
  • src/lib/stores/pipelineStore.ts
  • src/lib/passCatalog.test.ts
  • src/lib/passMigration.ts
  • src/types.ts
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Do not run real Olive jobs in CI or VMs because they download models and CUDA wheels.

**/*: Do not run real Olive GPU workloads or model downloads in CI; use mocks or CPU-only flows.
When changing the threat model or fixing critical findings, update the review snapshot and document the local-trust model in user-facing documentation.

Files:

  • src/lib/issueReport.ts
  • olive-mcp-server/tests/test_compatibility_matrix.py
  • src/lib/__tests__/passMigrationIntegration.test.ts
  • src/server/services/venv/status.ts
  • src/lib/__tests__/passParameterValidation.test.ts
  • src/lib/vramEstimate.ts
  • olive-mcp-server/olive_mcp_server/mcp_server.py
  • src/lib/chatActions.ts
  • scripts/sync-pass-catalog.mjs
  • src/lib/auditAutofix.ts
  • src/server/services/venv/spec.test.ts
  • src/lib/__tests__/pipelineValidation.test.ts
  • src/lib/__tests__/passMigrationPBT.test.ts
  • src/server/services/mcp/allowedTools.ts
  • src/lib/qnnReadiness.test.ts
  • src/lib/providerRuntimeKind.ts
  • olive-mcp-server/olive_mcp_server/tools/agent_execute.py
  • src/server/services/venv/spec.ts
  • src/lib/oliveRecipeBuilder.ts
  • olive-mcp-server/olive_mcp_server/tools/agent_model_info.py
  • src/lib/passCatalog.ts
  • src/lib/defaultPasses.ts
  • olive-mcp-server/olive_mcp_server/knowledge_base/hardware_profiles.json
  • src/lib/pipelineValidation.ts
  • src/lib/stores/pipelineStore.ts
  • olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py
  • olive-mcp-server/olive_mcp_server/tools/agent_compare.py
  • src/lib/passCatalog.test.ts
  • src/lib/passMigration.ts
  • olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json
  • olive-mcp-server/olive_mcp_server/knowledge_base/troubleshooting.json
  • src/types.ts
**/*.{js,jsx,ts,tsx,json}

📄 CodeRabbit inference engine (AGENTS.md)

Use pnpm 11.17 as the package manager; do not use npm install because the preinstall guard blocks it.

Files:

  • src/lib/issueReport.ts
  • src/lib/__tests__/passMigrationIntegration.test.ts
  • src/server/services/venv/status.ts
  • src/lib/__tests__/passParameterValidation.test.ts
  • src/lib/vramEstimate.ts
  • src/lib/chatActions.ts
  • src/lib/auditAutofix.ts
  • src/server/services/venv/spec.test.ts
  • src/lib/__tests__/pipelineValidation.test.ts
  • src/lib/__tests__/passMigrationPBT.test.ts
  • src/server/services/mcp/allowedTools.ts
  • src/lib/qnnReadiness.test.ts
  • src/lib/providerRuntimeKind.ts
  • src/server/services/venv/spec.ts
  • src/lib/oliveRecipeBuilder.ts
  • src/lib/passCatalog.ts
  • src/lib/defaultPasses.ts
  • olive-mcp-server/olive_mcp_server/knowledge_base/hardware_profiles.json
  • src/lib/pipelineValidation.ts
  • src/lib/stores/pipelineStore.ts
  • src/lib/passCatalog.test.ts
  • src/lib/passMigration.ts
  • olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json
  • olive-mcp-server/olive_mcp_server/knowledge_base/troubleshooting.json
  • src/types.ts
src/lib/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Run the relevant targeted unit tests when library code changes rather than unnecessarily running the full slow test suite locally; rely on CI for complete verification.

Files:

  • src/lib/issueReport.ts
  • src/lib/__tests__/passMigrationIntegration.test.ts
  • src/lib/__tests__/passParameterValidation.test.ts
  • src/lib/vramEstimate.ts
  • src/lib/chatActions.ts
  • src/lib/auditAutofix.ts
  • src/lib/__tests__/pipelineValidation.test.ts
  • src/lib/__tests__/passMigrationPBT.test.ts
  • src/lib/qnnReadiness.test.ts
  • src/lib/providerRuntimeKind.ts
  • src/lib/oliveRecipeBuilder.ts
  • src/lib/passCatalog.ts
  • src/lib/defaultPasses.ts
  • src/lib/pipelineValidation.ts
  • src/lib/stores/pipelineStore.ts
  • src/lib/passCatalog.test.ts
  • src/lib/passMigration.ts
olive-mcp-server/**/*.{py,toml,txt}

📄 CodeRabbit inference engine (CLAUDE.md)

Pin the Python mcp dependency to <2, because version 2.x removes mcp.server.fastmcp and breaks imports.

Files:

  • olive-mcp-server/tests/test_compatibility_matrix.py
  • olive-mcp-server/olive_mcp_server/mcp_server.py
  • olive-mcp-server/olive_mcp_server/tools/agent_execute.py
  • olive-mcp-server/olive_mcp_server/tools/agent_model_info.py
  • olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py
  • olive-mcp-server/olive_mcp_server/tools/agent_compare.py
olive-mcp-server/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

olive-mcp-server/**/*.py: Use Python 3.10 or newer for the Olive MCP server and keep the mcp dependency pinned below version 2.
Do not trigger real Olive optimization or batch runs in CI, tests, or VM environments; use CPU-only recipe building, JSON export, and validation flows instead.

Files:

  • olive-mcp-server/tests/test_compatibility_matrix.py
  • olive-mcp-server/olive_mcp_server/mcp_server.py
  • olive-mcp-server/olive_mcp_server/tools/agent_execute.py
  • olive-mcp-server/olive_mcp_server/tools/agent_model_info.py
  • olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py
  • olive-mcp-server/olive_mcp_server/tools/agent_compare.py
olive-mcp-server/tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Run MCP server tests with pytest using python -m pytest tests -q from olive-mcp-server.

Files:

  • olive-mcp-server/tests/test_compatibility_matrix.py
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use the appropriate Vitest configuration for each testing tier: library unit tests, server unit tests, integration tests, or component tests.

Files:

  • src/lib/__tests__/passMigrationIntegration.test.ts
  • src/lib/__tests__/passParameterValidation.test.ts
  • src/server/services/venv/spec.test.ts
  • src/lib/__tests__/pipelineValidation.test.ts
  • src/lib/__tests__/passMigrationPBT.test.ts
  • src/lib/qnnReadiness.test.ts
  • src/lib/passCatalog.test.ts
src/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Vitest for frontend unit and component tests, selecting the appropriate configured test tier (vitest.config.ts or vitest.component.config.ts).

Files:

  • src/lib/__tests__/passMigrationIntegration.test.ts
  • src/lib/__tests__/passParameterValidation.test.ts
  • src/server/services/venv/spec.test.ts
  • src/lib/__tests__/pipelineValidation.test.ts
  • src/lib/__tests__/passMigrationPBT.test.ts
  • src/lib/qnnReadiness.test.ts
  • src/lib/passCatalog.test.ts
src/server/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use the server testing configuration and targeted server tests for changes under src/server/; integration tests must use the existing mocks for child processes, AI providers, and fetch.

Files:

  • src/server/services/venv/status.ts
  • src/server/services/venv/spec.test.ts
  • src/server/services/mcp/allowedTools.ts
  • src/server/services/venv/spec.ts
src/server/services/venv/**/*.{ts,js}

📄 CodeRabbit inference engine (REVIEW.md)

Pin the runtime olive-ai installation to a supported version or version range, and document the supported Olive versions.

Files:

  • src/server/services/venv/status.ts
  • src/server/services/venv/spec.test.ts
  • src/server/services/venv/spec.ts
src/server/**/*.{test,spec}.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use the server Vitest configurations and commands for server unit and integration tests; integration tests should run against a real Express server with external dependencies mocked.

Files:

  • src/server/services/venv/spec.test.ts
src/lib/oliveRecipeBuilder.ts

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When changing how UI state maps to Olive JSON, update oliveRecipeBuilder.ts.

Run recipe validation whenever oliveRecipeBuilder.ts changes and preserve the recipe builder's CPU-only validation behavior.

Files:

  • src/lib/oliveRecipeBuilder.ts
src/lib/pipelineValidation.ts

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Extend validation rules in pipelineValidation.ts when pass-to-provider compatibility changes.

Files:

  • src/lib/pipelineValidation.ts
src/lib/stores/pipelineStore.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Use usePipelineStore as the single Zustand store for application state.

Files:

  • src/lib/stores/pipelineStore.ts
src/lib/stores/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Keep pipeline UI state in the single Zustand store at src/lib/stores/pipelineStore.ts.

Files:

  • src/lib/stores/pipelineStore.ts
🧠 Learnings (1)
📚 Learning: 2026-08-10T03:41:03.611Z
Learnt from: tonythethompson
Repo: tonythethompson/Olive-Studio PR: 203
File: src/components/features/input/GitHubRecipeSync.tsx:5-5
Timestamp: 2026-08-10T03:41:03.611Z
Learning: In the Olive-Studio repository, treat imports from the `@/components/ui` barrel as conforming to the established UI import convention. Do not flag these imports solely because a general guideline prefers importing from concrete modules.

Applied to files:

  • src/lib/issueReport.ts
  • src/lib/__tests__/passMigrationIntegration.test.ts
  • src/server/services/venv/status.ts
  • src/lib/__tests__/passParameterValidation.test.ts
  • src/lib/vramEstimate.ts
  • src/lib/chatActions.ts
  • src/lib/auditAutofix.ts
  • src/server/services/venv/spec.test.ts
  • src/lib/__tests__/pipelineValidation.test.ts
  • src/lib/__tests__/passMigrationPBT.test.ts
  • src/server/services/mcp/allowedTools.ts
  • src/lib/qnnReadiness.test.ts
  • src/lib/providerRuntimeKind.ts
  • src/server/services/venv/spec.ts
  • src/lib/oliveRecipeBuilder.ts
  • src/lib/passCatalog.ts
  • src/lib/defaultPasses.ts
  • src/lib/pipelineValidation.ts
  • src/lib/stores/pipelineStore.ts
  • src/lib/passCatalog.test.ts
  • src/lib/passMigration.ts
  • src/types.ts
🪛 ast-grep (0.45.0)
olive-mcp-server/olive_mcp_server/tools/agent_model_info.py

[warning] 126-126: Request-controlled URL passed to urlopen; validate against an allowlist to prevent SSRF.
Context: urllib.request.urlopen(req, timeout=_HF_TIMEOUT_SECONDS)
Note: [CWE-918] Server-Side Request Forgery (SSRF).

(urlopen-unsanitized-data)


[warning] 52-52: XPath query is request-/variable-derived; use parameterized XPath to prevent injection.
Context: _SIZE_TOKEN_RE.findall(model_id)
Note: [CWE-643] Improper Neutralization of Data within XPath Expressions ('XPath Injection').

(xpath-injection-python)

olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py

[info] 63-63: use jsonify instead of json.dumps for JSON output
Context: json.dumps(hardware_probe, separators=(",", ":"))
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[info] 83-83: use jsonify instead of json.dumps for JSON output
Context: json.dumps(value)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)

🪛 Biome (2.5.6)
src/server/services/venv/spec.test.ts

[error] 52-52: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

(lint/correctness/noSwitchDeclarations)

🪛 Checkov (3.3.9)
olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json

[low] 484-485: Base64 High Entropy String

(CKV_SECRET_6)


[low] 495-496: Base64 High Entropy String

(CKV_SECRET_6)


[low] 506-507: Base64 High Entropy String

(CKV_SECRET_6)


[low] 935-936: Base64 High Entropy String

(CKV_SECRET_6)


[low] 990-991: Base64 High Entropy String

(CKV_SECRET_6)


[low] 1148-1149: Base64 High Entropy String

(CKV_SECRET_6)


[low] 1159-1160: Base64 High Entropy String

(CKV_SECRET_6)

🪛 GitHub Actions: CI / 4_olive-pass-availability.txt
olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json

[error] 1-1: python scripts/check_olive_pass_availability.py failed: the compatibility matrix claims support for passes not present in the pinned Olive 0.12.1 registry: KQuant, MobiusBuilder, OnnxDiscrepancyCheck, OnnxKquantQuantization, QairtPipeline, QuantizeEmbeddingInt8, ShareEmbeddingLmHead, and SimplifiedLayerNormToRMSNorm. Process completed with exit code 1.

🪛 GitHub Actions: CI / olive-pass-availability
olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json

[error] 1-1: Command 'python scripts/check_olive_pass_availability.py olive_mcp_server/knowledge_base/compatibility_matrix.json' failed: the compatibility matrix claims support for passes absent from the pinned Olive 0.12.1 registry: KQuant, MobiusBuilder, OnnxDiscrepancyCheck, OnnxKquantQuantization, QairtPipeline, QuantizeEmbeddingInt8, ShareEmbeddingLmHead, and SimplifiedLayerNormToRMSNorm. Process exited with code 1.

🪛 GitHub Check: CodeFactor
olive-mcp-server/olive_mcp_server/tools/agent_execute.py

[notice] 53-201: olive-mcp-server/olive_mcp_server/tools/agent_execute.py#L53-L201
Complex Method

olive-mcp-server/olive_mcp_server/tools/agent_model_info.py

[warning] 127-127: olive-mcp-server/olive_mcp_server/tools/agent_model_info.py#L127
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected. (B310)


[notice] 44-108: olive-mcp-server/olive_mcp_server/tools/agent_model_info.py#L44-L108
Complex Method

src/lib/stores/pipelineStore.ts

[notice] 58-58: src/lib/stores/pipelineStore.ts#L58
Unexpected console statement. Only these console methods are allowed: warn, error. (no-console)

olive-mcp-server/olive_mcp_server/tools/agent_compare.py

[notice] 63-149: olive-mcp-server/olive_mcp_server/tools/agent_compare.py#L63-L149
Complex Method

src/lib/passCatalog.test.ts

[notice] 4-4: src/lib/passCatalog.test.ts#L4
'PassCatalogEntry' is defined but never used. Allowed unused vars must match /^_/u. (@typescript-eslint/no-unused-vars)

src/lib/passMigration.ts

[notice] 78-78: src/lib/passMigration.ts#L78
'overrides' is never reassigned. Use 'const' instead. (prefer-const)

🪛 GitHub Check: validate
src/lib/__tests__/passMigrationPBT.test.ts

[failure] 165-165:
Property 'otherParam' does not exist on type 'PassRecipeOverride'.


[failure] 161-161:
Property 'modernParam' does not exist on type 'PassRecipeOverride'.


[failure] 153-153:
Object literal may only specify known properties, and 'legacyParam' does not exist in type 'PassRecipeOverride'.

🪛 React Doctor (0.9.3)
src/lib/passMigration.ts

[warning] 79-79: JSON.parse(JSON.stringify(x)) deep-clones by re-serializing: it is slow on large objects and silently drops undefined, functions, Date/Map/Set, and cyclic references. Use structuredClone(x).

Replace JSON.parse(JSON.stringify(value)) with structuredClone(value). It is faster and preserves Dates, Maps, Sets, and cyclic references.

(no-json-parse-stringify-clone)

🪛 Ruff (0.16.1)
olive-mcp-server/olive_mcp_server/tools/agent_execute.py

[warning] 200-200: Do not catch blind exception: Exception

(BLE001)

olive-mcp-server/olive_mcp_server/tools/agent_model_info.py

[warning] 232-232: Do not catch blind exception: Exception

(BLE001)

olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py

[warning] 128-130: Return the negated condition directly

Inline condition

(SIM103)


[warning] 201-201: Do not catch blind exception: Exception

(BLE001)

olive-mcp-server/olive_mcp_server/tools/agent_compare.py

[warning] 50-50: Name compared with itself, consider replacing f != f

(PLR0124)


[warning] 101-104: Combine if branches using logical or operator

Combine if branches

(SIM114)


[warning] 103-106: Combine if branches using logical or operator

Combine if branches

(SIM114)


[warning] 278-278: Do not catch blind exception: Exception

(BLE001)

🔍 Remote MCP Context7, DeepWiki, GitHub Copilot

Additional review context

  • The matching PR is #230. It adds agent_compare.py, but the registry also references agent_planner.py; that module is absent from the PR’s changed-file list. A related review found that MCP startup eagerly resolves registered tools, so missing modules can prevent the server from starting.

  • compare_results treats cancelled as scoreable because it is considered terminal and only failed is explicitly excluded. This conflicts with the stated objective to exclude cancelled jobs. Its top-level exception path also returns an error without side_effect: False.

  • The PR declares no dedicated tests for compare_results; its description says only syntax/import/basic validation were performed and that the full test suite is a follow-up.

  • Current checks show failures in validate, python-tests, docker-build, olive-pass-availability, and CodeFactor; CodeQL and security passed.

  • Olive’s current workflow documentation places Hugging Face’s trust_remote_code under input_model.load_kwargs, while the PR’s recipe test/builder uses input_model.config. This contract should be reconciled before relying on the generated recipe.

  • DeepWiki returned no repository context because tonythethompson/Olive-Studio was not indexed.

🔇 Additional comments (25)
src/lib/qnnReadiness.test.ts (1)

43-43: LGTM!

src/types.ts (1)

41-41: LGTM!

Also applies to: 136-136

src/lib/oliveRecipeBuilder.ts (2)

366-366: LGTM!

Also applies to: 378-378, 593-609, 635-641


408-426: 🗄️ Data Integrity & Integration

No change needed: kquant is not treated as a PyTorch-native quantization method.

			> Likely an incorrect or invalid review comment.
src/lib/auditAutofix.ts (1)

120-120: LGTM!

Also applies to: 200-200

src/lib/chatActions.ts (1)

29-29: LGTM!

src/lib/pipelineValidation.ts (1)

85-89: LGTM!

Also applies to: 129-129, 191-198, 227-230, 596-596, 856-856, 1115-1115

src/lib/vramEstimate.ts (1)

209-209: LGTM!

Also applies to: 294-295

src/lib/__tests__/pipelineValidation.test.ts (1)

160-174: LGTM!

Also applies to: 790-802, 840-869

src/lib/__tests__/passMigrationIntegration.test.ts (1)

12-114: LGTM!

src/lib/__tests__/passMigrationPBT.test.ts (1)

20-53: LGTM!

Also applies to: 99-129, 178-238

src/lib/stores/pipelineStore.ts (1)

6-6: LGTM!

src/lib/issueReport.ts (1)

158-159: LGTM!

src/lib/providerRuntimeKind.ts (1)

25-25: LGTM!

Also applies to: 72-72

src/server/services/venv/status.ts (1)

27-30: LGTM!

Also applies to: 311-312, 347-368, 497-500

src/lib/__tests__/passParameterValidation.test.ts (1)

49-49: LGTM!

src/server/services/venv/spec.test.ts (1)

48-55: 🎯 Functional Correctness

Keep the switch-case scope change only if the test is meant to enforce Biome.

The project lint script runs tsc --noEmit && eslint, and the ESLint config does not enable noSwitchDeclarations or Biome. Biome is not present in the repository dependencies/config, so this does not block the configured lint run.

			> Likely an incorrect or invalid review comment.
olive-mcp-server/olive_mcp_server/knowledge_base/hardware_profiles.json (1)

182-200: LGTM!

Also applies to: 210-441, 451-628

olive-mcp-server/olive_mcp_server/knowledge_base/troubleshooting.json (1)

791-812: LGTM!

olive-mcp-server/tests/test_compatibility_matrix.py (1)

521-521: LGTM!

olive-mcp-server/olive_mcp_server/mcp_server.py (1)

93-97: LGTM!

Also applies to: 102-113

olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py (1)

26-49: LGTM!

Also applies to: 73-113, 150-199

olive-mcp-server/olive_mcp_server/tools/agent_model_info.py (1)

134-163: LGTM!

Also applies to: 170-230

olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json (1)

27-29: 📐 Maintainability & Code Quality

The versioned Olive documentation URLs resolve successfully.

olive-mcp-server/olive_mcp_server/tools/agent_execute.py (1)

145-148: 🗄️ Data Integrity & Integration

No change needed. /api/olive/agent/status returns the existing job.logs, and job.logs is only appended to by pushLog; the assignment is not replacing incremental endpoint output.

			> Likely an incorrect or invalid review comment.

Comment on lines +120 to +150
{
"target": "Qualcomm Snapdragon QNN ABI",
"accelerator": "npu",
"execution_providers": [
"QnnAbiExecutionProvider"
],
"recommended_passes": [
"QairtPipeline",
"SimplifiedLayerNormToRMSNorm",
"OnnxConversion",
"OnnxModelOptimizer"
],
"typical_speedup": "5-12x",
"calibration_size": 128,
"optimal_batch_size": 1,
"memory_gb": 8,
"ops_supported": [
"Conv",
"Gemm",
"Transpose",
"Reshape",
"Softmax",
"RMSNorm"
],
"known_issues": [
"QNN ABI EP requires QAIRT SDK and QNN ABI-compatible runtime.",
"Operator whitelist is narrow; use SimplifiedLayerNormToRMSNorm for graph compatibility.",
"Requires symmetric per-channel quantization."
],
"notes": "New in olive-ai 0.13.0 (PR #2434). ABI-stable QNN execution provider; use QairtPipeline for single-pass LLM quantization+compilation. Prefer over legacy QNNExecutionProvider multi-step workflow."
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

The new QNN ABI hardware target uses two different names across the knowledge base. Both files introduce the QNN ABI path in this PR, but the target strings do not match. Any lookup that joins a compatibility entry to a hardware profile by target name resolves in one file and misses in the other.

  • olive-mcp-server/olive_mcp_server/knowledge_base/hardware_profiles.json#L120-L150: the profile target is "Qualcomm Snapdragon QNN ABI".
  • olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json#L1169-L1191: the hardware key is "Qualcomm QNN ABI".

Pick one string and use it in both files. Existing entries such as "Qualcomm Snapdragon NPU" already match exactly across the two files, which confirms the intended convention.

📍 Affects 2 files
  • olive-mcp-server/olive_mcp_server/knowledge_base/hardware_profiles.json#L120-L150 (this comment)
  • olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json#L1169-L1191
🤖 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 `@olive-mcp-server/olive_mcp_server/knowledge_base/hardware_profiles.json`
around lines 120 - 150, Unify the QNN ABI target name across both knowledge-base
entries so compatibility lookups resolve consistently: update
olive-mcp-server/olive_mcp_server/knowledge_base/hardware_profiles.json lines
120-150 and
olive-mcp-server/olive_mcp_server/knowledge_base/compatibility_matrix.json lines
1169-1191 to use the same chosen string, following the exact-name convention
used by existing Qualcomm targets.

Comment on lines +781 to +788
"updated_config": {
"input_model": {
"config": {
"trust_remote_code": true
}
}
},
"applyable": true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find how the repository models trust_remote_code in generated recipes.
rg -n -C5 'trust_remote_code|trustRemoteCode|load_kwargs' --hidden -g '!node_modules'

Repository: tonythethompson/Olive-Studio

Length of output: 166


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== tracked matching files =="
git ls-files | rg 'troubleshooting\.json|diagnose_and_fix|knowledge_base|recipe|input_model|agent_diagnosis' || true

echo
echo "== troubleshooting entry context =="
if [ -f olive-mcp-server/olive_mcp_server/knowledge_base/troubleshooting.json ]; then
  sed -n '755,805p' olive-mcp-server/olive_mcp_server/knowledge_base/troubleshooting.json | cat -n
else
  echo "missing troubleshooting file"
fi

echo
echo "== targeted text search (repo) =="
rg -n -C3 -i 'trust_remote|load_kwargs|input_model\.config|input_model:|fixed_config|diagnose_and_fix|applyable' --hidden -g '!node_modules' . || true

Repository: tonythethompson/Olive-Studio

Length of output: 50385


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== agent_diagnosis relevant implementation =="
sed -n '120,195p' olive-mcp-server/olive_mcp_server/tools/agent_diagnosis.py | cat -n

echo
echo "== HuggingFace/HfModel model path declarations in recipes =="
python3 - <<'PY'
import json, pathlib
from pathlib import Path
for file in [
    Path("olive-mcp-server/olive_mcp_server/knowledge_base/integration_recipes.json"),
    Path("olive-mcp-server/olive_mcp_server/knowledge_base/troubleshooting.json"),
]:
    data = json.loads(file.read_text())
    for entry in data:
        if not isinstance(entry, dict):
            continue
        cfg = entry.get("updated_config") or entry.get("config") or entry.get("recipe_body")
        # skip unless it has relevant candidate structures
        try:
            if isinstance(cfg, dict) and (
                "input_model" in cfg
                or any("hf" in k.lower() or k.lower() in ("model_path","model_config","hf_config","load_kwargs") for item in json.loads(file.read_text()) for k, v in [(item.get("path",""))]+[] 
            ): 
                pass
        except:
            pass
PY

echo
echo "== files containing HfModel or input_model declarations =="
rg -n -C4 'HfModel|input_model.*config|model_path|hf_config|load_kwargs' --hidden -g '!node_modules' -g '!**/node_modules/**' -g '!public/**' -g '!src/**' olive-mcp-server | head -n 220

Repository: tonythethompson/Olive-Studio

Length of output: 3572


🌐 Web query:

Olive AI HfModel input_model config load_kwargs trust_remote_code

💡 Result:

In Microsoft Olive, when working with the HfModel (Hugging Face model) input type, load_kwargs is an optional dictionary configuration field used to pass additional arguments directly to the Hugging Face transformers from_pretrained method [1][2]. To enable the loading of models that require execution of arbitrary code from the model repository, you must explicitly include trust_remote_code within the load_kwargs dictionary [3]. Example usage within your Olive configuration: { "input_model": { "type": "HfModel", "model_path": "your-model-id-or-path", "load_kwargs": { "trust_remote_code": true } } } Key details: - Purpose: load_kwargs allows you to customize how the model, configuration, and tokenizer are loaded [1]. - Remote Code: For security, Olive does not enable trust_remote_code by default [4][5][6]. It must be explicitly set to true if required by the specific model architecture [3]. - CLI Usage: If using Olive via the command line interface, you can also use the --trust_remote_code flag to achieve the same result [5]. - Other Arguments: You can include other valid transformers arguments in load_kwargs, such as torch_dtype or attention_implementation [1].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== targeted HuggingFace input_model declarations =="
rg -n -C3 -i '["'"'"'}]input_model|input_model|HfModel|model_path|load_kwargs|trust_remote_code' --hidden -g '!node_modules' -g '!public/**' -g '!src/**' olive-mcp-server/olive_mcp_server/knowledge_base/json | head -n 260

Repository: tonythethompson/Olive-Studio

Length of output: 397


🌐 Web query:

site:microsoft.github.io/Olive HfModel input_model config load_kwargs trust_remote_code

💡 Result:

In the context of Olive, a tool for model optimization, HfModel (specifically HfModelHandler) is used to configure and load Hugging Face models [1][2]. The load_kwargs parameter in the HfModel configuration is a dictionary used to pass additional arguments directly to the from_pretrained methods (such as those for the model, config, or tokenizer) when the model is loaded [1][3][4]. Regarding trust_remote_code: 1. It is a boolean parameter used to specify whether to trust remote code execution when loading a Hugging Face model [5][6]. 2. In Olive workflows, it can be passed as a keyword argument within your configuration or, in some cases, directly via command-line flags (e.g., --trust_remote_code) [5][6][7]. 3. Because load_kwargs are passed to the underlying Hugging Face from_pretrained methods, you can include trust_remote_code within the load_kwargs dictionary in your JSON configuration [1][3][4]. Example usage within an Olive configuration: { "type": "HfModel", "model_path": "model_name_or_path", "load_kwargs": { "trust_remote_code": true, "torch_dtype": "float16" } }

Citations:


Use the load_kwargs path for trust_remote_code.

trust_remote_code belongs under input_model.config.load_kwargs for Hugging Face models. With applyable: true, diagnose_and_fix merge-patches this object directly into the recipe, so input_model.config.trust_remote_code leaves the effective config unchanged.

🔧 Candidate correction
       "updated_config": {
         "input_model": {
-          "config": {
+          "load_kwargs": {
             "trust_remote_code": true
           }
         }
       },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"updated_config": {
"input_model": {
"config": {
"trust_remote_code": true
}
}
},
"applyable": true
"updated_config": {
"input_model": {
"load_kwargs": {
"trust_remote_code": true
}
}
},
"applyable": true
🤖 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 `@olive-mcp-server/olive_mcp_server/knowledge_base/troubleshooting.json` around
lines 781 - 788, Update the troubleshooting entry’s updated_config object so
trust_remote_code is nested under input_model.config.load_kwargs rather than
directly under input_model.config, while preserving applyable: true and the
existing value.

Comment on lines +98 to +101
"plan_optimization": (
"olive_mcp_server.tools.agent_planner",
"plan_optimization",
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

plan_optimization is wired into both registries, but agent_planner.py is not in this PR. The server registry and the client allowlist both advertise a tool whose implementation module is unconfirmed. Because _build_mcp resolves every registered tool eagerly, a missing module stops the whole MCP server from starting, not just this one tool.

  • olive-mcp-server/olive_mcp_server/mcp_server.py#L98-L101: confirm olive_mcp_server/tools/agent_planner.py exists on this branch and exports plan_optimization; if it does not, remove this entry or land the module in the same PR.
  • src/server/services/mcp/allowedTools.ts#L33-L38: remove "plan_optimization" from the allowlist until the server-side tool resolves, so the client does not advertise a tool the server cannot serve.
📍 Affects 2 files
  • olive-mcp-server/olive_mcp_server/mcp_server.py#L98-L101 (this comment)
  • src/server/services/mcp/allowedTools.ts#L33-L38
🤖 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 `@olive-mcp-server/olive_mcp_server/mcp_server.py` around lines 98 - 101,
Verify that olive_mcp_server.tools.agent_planner exists and exports
plan_optimization; if not, remove its registry entry from
olive-mcp-server/olive_mcp_server/mcp_server.py (lines 98-101) or add the module
in this PR. Also remove "plan_optimization" from
src/server/services/mcp/allowedTools.ts (lines 33-38) until the server-side tool
resolves.

Comment on lines +44 to +54
def _as_float(val: Any) -> float | None:
if val is None:
return None
try:
f = float(val)
# Reject NaN/inf as non-scoreable
if f != f or f == float("inf") or f == float("-inf"):
return None
return f
except (TypeError, ValueError):
return None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use math.isfinite for the NaN and infinity check.

f != f is a self-comparison. Ruff flags it as PLR0124. math.isfinite covers NaN, inf, and -inf in one expression.

♻️ Proposed refactor
+import math
+
     def _as_float(val: Any) -> float | None:
         if val is None:
             return None
         try:
             f = float(val)
-            # Reject NaN/inf as non-scoreable
-            if f != f or f == float("inf") or f == float("-inf"):
-                return None
-            return f
+            # Reject NaN/inf as non-scoreable
+            return f if math.isfinite(f) else None
         except (TypeError, ValueError):
             return None
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def _as_float(val: Any) -> float | None:
if val is None:
return None
try:
f = float(val)
# Reject NaN/inf as non-scoreable
if f != f or f == float("inf") or f == float("-inf"):
return None
return f
except (TypeError, ValueError):
return None
import math
def _as_float(val: Any) -> float | None:
if val is None:
return None
try:
f = float(val)
# Reject NaN/inf as non-scoreable
return f if math.isfinite(f) else None
except (TypeError, ValueError):
return None
🧰 Tools
🪛 Ruff (0.16.1)

[warning] 50-50: Name compared with itself, consider replacing f != f

(PLR0124)

🤖 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 `@olive-mcp-server/olive_mcp_server/tools/agent_compare.py` around lines 44 -
54, Update _as_float to use math.isfinite(f) for rejecting NaN and positive or
negative infinity, replacing the self-comparison and explicit infinity checks;
import math as needed while preserving the existing None return behavior.

Source: Linters/SAST tools

Comment on lines +53 to +63
replaceState: (next) => {
const { state: migrated, renamedPasses, removedPasses } = applyMigrations(next);
const migratedCount = renamedPasses.length;
const removedCount = removedPasses.length;
if (migratedCount > 0 || removedCount > 0) {
console.info(
`[pipelineStore] Migration applied: ${migratedCount} pass(es) renamed, ${removedCount} pass(es) removed.`,
);
}
set({ state: commitUiStateUpdate(migrated, {}) });
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

console.info is not an allowed console method.

The ESLint no-console rule permits only warn and error. CodeFactor reports this at Line 58. The coding guidelines require resolving ESLint errors.

Also report discardedParams. A non-zero value means the migration dropped user configuration, and the current message hides that.

🐛 Proposed fix
       replaceState: (next) => {
-        const { state: migrated, renamedPasses, removedPasses } = applyMigrations(next);
+        const { state: migrated, renamedPasses, removedPasses, discardedParams } =
+          applyMigrations(next);
         const migratedCount = renamedPasses.length;
         const removedCount = removedPasses.length;
-        if (migratedCount > 0 || removedCount > 0) {
-          console.info(
-            `[pipelineStore] Migration applied: ${migratedCount} pass(es) renamed, ${removedCount} pass(es) removed.`,
-          );
+        if (migratedCount > 0 || removedCount > 0 || discardedParams > 0) {
+          console.warn(
+            `[pipelineStore] Migration applied: ${migratedCount} pass(es) renamed, ${removedCount} pass(es) removed, ${discardedParams} param(s) discarded.`,
+          );
         }
         set({ state: commitUiStateUpdate(migrated, {}) });
       },

As per coding guidelines: "Resolve ESLint errors; warnings are acceptable within the configured maximum of 20, but non-zero lint failures and reported errors must not be ignored."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
replaceState: (next) => {
const { state: migrated, renamedPasses, removedPasses } = applyMigrations(next);
const migratedCount = renamedPasses.length;
const removedCount = removedPasses.length;
if (migratedCount > 0 || removedCount > 0) {
console.info(
`[pipelineStore] Migration applied: ${migratedCount} pass(es) renamed, ${removedCount} pass(es) removed.`,
);
}
set({ state: commitUiStateUpdate(migrated, {}) });
},
replaceState: (next) => {
const { state: migrated, renamedPasses, removedPasses, discardedParams } =
applyMigrations(next);
const migratedCount = renamedPasses.length;
const removedCount = removedPasses.length;
if (migratedCount > 0 || removedCount > 0 || discardedParams > 0) {
console.warn(
`[pipelineStore] Migration applied: ${migratedCount} pass(es) renamed, ${removedCount} pass(es) removed, ${discardedParams} param(s) discarded.`,
);
}
set({ state: commitUiStateUpdate(migrated, {}) });
},
🧰 Tools
🪛 GitHub Check: CodeFactor

[notice] 58-58: src/lib/stores/pipelineStore.ts#L58
Unexpected console statement. Only these console methods are allowed: warn, error. (no-console)

🤖 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 `@src/lib/stores/pipelineStore.ts` around lines 53 - 63, Update the migration
logging in replaceState to use an ESLint-approved console method, such as
console.warn, instead of console.info, and include the discardedParams count in
the message alongside renamedPasses and removedPasses.

Sources: Coding guidelines, Linters/SAST tools

Comment thread src/lib/stores/pipelineStore.ts
Comment on lines +33 to +38
// Phase 3: Agent autonomous loop.
"execute_and_observe",
"plan_optimization",
"diagnose_and_fix",
"compare_results",
"get_model_info",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Mark execute_and_observe as write-capable in the allowlist comment.

Lines 19 and 26 document the trust boundary for write-capable entries: loopback-only proxy, and policy-gated submit and cancel. execute_and_observe submits an optimization job and therefore belongs in that category. The current comment, "Phase 3: Agent autonomous loop", hides that distinction. The other four new tools are read-only and return side_effect: False.

Keep the boundary visible to the next reader.

plan_optimization raises a separate concern; see the consolidated comment.

♻️ Proposed refactor
-  // Phase 3: Agent autonomous loop.
-  "execute_and_observe",
+  // Phase 3: Agent autonomous loop.
+  // Write-capable: submits a job through the loopback bridge, same policy gate
+  // as submit_optimization_job.
+  "execute_and_observe",
+  // Read-only agent tools (side_effect: false).
   "plan_optimization",
   "diagnose_and_fix",
   "compare_results",
   "get_model_info",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Phase 3: Agent autonomous loop.
"execute_and_observe",
"plan_optimization",
"diagnose_and_fix",
"compare_results",
"get_model_info",
// Phase 3: Agent autonomous loop.
// Write-capable: submits a job through the loopback bridge, same policy gate
// as submit_optimization_job.
"execute_and_observe",
// Read-only agent tools (side_effect: false).
"plan_optimization",
"diagnose_and_fix",
"compare_results",
"get_model_info",
🤖 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 `@src/server/services/mcp/allowedTools.ts` around lines 33 - 38, Update the
allowlist comment immediately above execute_and_observe in the relevant tools
configuration to explicitly identify it as write-capable and subject to the
appropriate trust boundary, while keeping the other four read-only tools grouped
separately. Do not change tool behavior or address plan_optimization in this
change.

Comment thread src/server/services/venv/spec.ts
Comment thread src/types.ts
Comment on lines +168 to +185
/**
* Olive 0.13.0 flipped `trust_remote_code` default to `false`.
* When true (the default for HuggingFace sources), the recipe emits
* `trust_remote_code: true` so models requiring custom code still load.
*/
trustRemoteCode: boolean;
/** MobiusBuilder: ONNX export via Mobius producing ORT GenAI composite packages. */
mobiusBuilder: boolean;
/** QairtPipeline: Single-pass QAIRT LLM pipeline (QNN-only). */
qairtPipeline: boolean;
/** QuantizeEmbeddingInt8: Graph surgery for INT8 embedding quantization. */
quantizeEmbeddingInt8: boolean;
/** ShareEmbeddingLmHead: Graph surgery to share embedding/LM-head weights. */
shareEmbeddingLmHead: boolean;
/** SimplifiedLayerNormToRMSNorm: Graph surgery converting SimplifiedLayerNorm to RMSNorm. */
simplifiedLayerNormToRMSNorm: boolean;
/** OnnxDiscrepancyCheck: Validation pass measuring numerical discrepancies. */
onnxDiscrepancyCheck: boolean;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

The new passes fields are declared required, and that breaks the validate check in two ways. src/types.ts adds seven non-optional booleans to UIState["passes"]. Every full passes object literal must now supply all seven, and no code may compare any of them to undefined. Neither constraint holds in the current PR.

  • src/types.ts#L168-L185: make trustRemoteCode optional, and update or fix every full passes literal that omits mobiusBuilder, qairtPipeline, quantizeEmbeddingInt8, shareEmbeddingLmHead, simplifiedLayerNormToRMSNorm, or onnxDiscrepancyCheck — for example the baseState() literal in src/lib/__tests__/passParameterValidation.test.ts.
  • src/lib/pipelineValidation.ts#L1023-L1028: keep the runtime guard for persisted state, but only after trustRemoteCode becomes optional in src/types.ts. TypeScript reports TS2367 for a boolean compared to undefined.
📍 Affects 2 files
  • src/types.ts#L168-L185 (this comment)
  • src/lib/pipelineValidation.ts#L1023-L1028
🤖 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 `@src/types.ts` around lines 168 - 185, Make trustRemoteCode optional in
src/types.ts (lines 168-185) so persisted states may omit it while preserving
the runtime undefined guard in src/lib/pipelineValidation.ts (lines 1023-1028).
Update every full passes object literal that omits the six newly required
fields—such as baseState() in
src/lib/__tests__/passParameterValidation.test.ts—to provide mobiusBuilder,
qairtPipeline, quantizeEmbeddingInt8, shareEmbeddingLmHead,
simplifiedLayerNormToRMSNorm, and onnxDiscrepancyCheck; no direct change is
required in pipelineValidation.ts beyond retaining its existing guard.

Source: Linters/SAST tools

@tonythethompson

Copy link
Copy Markdown
Owner Author

Superseded by consolidated PR #245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant