fix(mcp): tolerate workflows without aliases - #2097
Conversation
Signed-off-by: Ching Wei Kang <WilliamK112@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
WalkthroughUpdated ChangesWorkflow Alias Fallback Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Label Checker is currently failing because external contributors cannot add repo labels. This PR should be labeled |
|
/ok to test 9f0a047 |
|
/merge |
## Summary - avoid reading `workflow_alias` directly on FastMCP function-style workflow configs - fall back to the workflow type when a FastMCP workflow config does not define an alias - add a regression for `langgraph_wrapper`-style configs without `workflow_alias` Complements #2097 by covering the FastMCP worker side of #1991. ## Testing - `python3 -m py_compile packages/nvidia_nat_fastmcp/src/nat/plugins/fastmcp/server/front_end_plugin_worker.py packages/nvidia_nat_fastmcp/tests/test_fastmcp.py` - `git diff --check upstream/develop...HEAD` Authors: - Kiwi (https://github.com/kiwigitops) Approvers: - Will Killian (https://github.com/willkill07) URL: #1993
Description
The MCP frontend now handles workflow configs that do not define
workflow_aliasby falling back to the workflowtype. This keeps agent workflows that do define an alias unchanged while allowing FunctionBaseConfig-backed workflows such aslanggraph_wrapperto be exposed as MCP tools instead of crashing during route registration.Adds a regression test covering a workflow config object with only
type=langgraph_wrapper.Closes #1991
Testing
PYTHONUTF8=1 UV_PROJECT_ENVIRONMENT=<repo>\packages\nvidia_nat_mcp\.venv uv run --project packages/nvidia_nat_mcp --all-groups --all-extras -- pytest -q packages/nvidia_nat_mcp/tests/server/test_mcp_front_end_plugin.py(8 passed)uvx ruff==0.15.0 check packages/nvidia_nat_mcp/src/nat/plugins/mcp/server/front_end_plugin_worker.py packages/nvidia_nat_mcp/tests/server/test_mcp_front_end_plugin.pyuvx yapf==0.43.0 --diff packages/nvidia_nat_mcp/src/nat/plugins/mcp/server/front_end_plugin_worker.py packages/nvidia_nat_mcp/tests/server/test_mcp_front_end_plugin.pygit diff --checkNote:
python ci/scripts/run_tests.py --project nvidia_nat_mcp --exitfirst -- packages/nvidia_nat_mcp/tests/server/test_mcp_front_end_plugin.pysynced successfully withPYTHONUTF8=1, but the helper appends the full package path after the requested file and therefore also ran unrelated package tests; it stopped at an existing OAuth TTL test failure intest_mcp_auth_provider.py. The targeted MCP frontend test above passed.By Submitting this PR I confirm:
Summary by CodeRabbit
Bug Fixes
Tests