fix(federation): isolate Filigree MCP Python imports (-I) - #152
Merged
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 subprocess launcher in loomweave-federation by running the installed filigree.mcp_server module in Python isolated mode (-I), preventing an analyzed project’s working directory from shadowing the trusted installed Filigree package during module resolution.
Changes:
- Refactors MCP launcher construction into a dedicated helper (
filigree_python_mcp_command). - Adds Python
-Iisolated mode flag to thepython -m filigree.mcp_serverinvocation to prevent import-path shadowing. - Adds a regression unit test asserting the constructed argv includes
-Iand preserves--project <root>.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebase of #146 (Codex) onto
release/1.6.0, the working release branch. Same single commit.What
The resolved Filigree MCP launcher (
<python> -m filigree.mcp_server --project <root>) runs with the analyzed project as its working directory, so-mput the project root first onsys.path: a repository committingfiligree/mcp_server.pywould shadow the installed package and execute on the first MCP tool call. The launcher now passes-I(isolated mode: no cwd/script dir onsys.path,PYTHON*env ignored, no user site).Review notes
filigree mcp-statusreports the interpreter Filigree itself runs under (a uv/pipx venv in every supported install), so dropping user-site is not a regression for supported installs.serve::tests::bootstrap_spawns_worktree_analyze_with_exact_argv_when_unbuilt, unrelated to this change; the crate suite (155) passes locally on this base.cargo fmt --check,clippy -D warnings(loomweave-federation),nextest -p loomweave-federationgreen.Supersedes #146.
🤖 Generated with Claude Code