Skip to content

fix(federation): isolate Filigree MCP Python imports (-I) - #152

Merged
tachyon-beep merged 1 commit into
release/1.6.0from
fix/filigree-mcp-isolated-imports
Sep 1, 2026
Merged

fix(federation): isolate Filigree MCP Python imports (-I)#152
tachyon-beep merged 1 commit into
release/1.6.0from
fix/filigree-mcp-isolated-imports

Conversation

@tachyon-beep

Copy link
Copy Markdown
Collaborator

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 -m put the project root first on sys.path: a repository committing filigree/mcp_server.py would shadow the installed package and execute on the first MCP tool call. The launcher now passes -I (isolated mode: no cwd/script dir on sys.path, PYTHON* env ignored, no user site).

Review notes

  • filigree mcp-status reports 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.
  • The failing check on fix(federation): isolate Filigree MCP Python imports #146 was 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-federation green.

Supersedes #146.

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings September 1, 2026 19:14
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Copilot AI 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.

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 -I isolated mode flag to the python -m filigree.mcp_server invocation to prevent import-path shadowing.
  • Adds a regression unit test asserting the constructed argv includes -I and preserves --project <root>.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tachyon-beep
tachyon-beep merged commit 6f03285 into release/1.6.0 Sep 1, 2026
6 checks passed
@tachyon-beep
tachyon-beep deleted the fix/filigree-mcp-isolated-imports branch September 1, 2026 20:04
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.

2 participants