fix(federation): isolate Filigree MCP Python imports - #146
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR hardens the Filigree MCP launcher used by loomweave-federation by ensuring that when Filigree is launched via Python module execution, it runs in Python isolated mode to prevent project-root import shadowing of the installed filigree package.
Changes:
- Switch the Python-based MCP launcher path to use a centralized helper that adds
python -I -m filigree.mcp_server. - Preserve existing
--project <root>behavior when a project root is available. - Add a regression unit test ensuring the resolved Python command includes the
-Iisolation flag.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Superseded by the rebase onto |
Motivation
filigreePython package when the local Filigree MCP subprocess is launched from the project root, which could enable arbitrary code execution during MCP tool calls.Description
-Ito the Python arguments so the analyzed project is not added to Python's import path (resolve_filigree_mcp_commandnow delegates tofiligree_python_mcp_command).--project <root>argument when a project root is present.filigree_python_mcp_commandhelper to centralize the safe command construction and a regression testpython_mcp_command_isolates_imports_from_project_rootthat verifies the program and args include the isolation flag.filigree-mcpbinary and the MCP subprocess-driving logic remain unchanged.Testing
cargo fmt --check, which succeeded.cargo test -p loomweave-federation filigree::tests::python_mcp_command_isolates_imports_from_project_root -- --exact, which passed.cargo test -p loomweave-federation(full crate suite): the new regression and most tests ran, but several pre-existing HTTP mock tests failed or hung in the parallel full-suite run, so the full run was interrupted; the failures appear unrelated to the Python-launcher change and affect HTTP client/mock expectations.Codex Task