Skip to content

feat(desktop): add Project connection setup - #4588

Open
wolfyy970 wants to merge 7 commits into
block:mainfrom
wolfyy970:codex/project-connections
Open

feat(desktop): add Project connection setup#4588
wolfyy970 wants to merge 7 commits into
block:mainfrom
wolfyy970:codex/project-connections

Conversation

@wolfyy970

@wolfyy970 wolfyy970 commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Adds Connections to each Project so a stdio MCP service can be configured and tested once instead of being recreated for every agent.

Connections and credentials stay local to the Project, outside portable agent configuration. This slice covers secret handling, connection testing, tool discovery and removal. Agent bindings follow separately.

This keeps credentials out of portable templates and gives later agent bindings one Project-owned connection model. HTTP support remains with #4271 and the shared transport schema in #4164.

Related issue

#4301

This complements #4571, which configures remote MCP servers on individual Fly agents. This PR establishes the reusable Project-owned connection boundary.

Testing

  • 28 focused Rust tests
  • clippy
  • desktop checks and typecheck
  • E2E build and screenshot test

@wolfyy970

Copy link
Copy Markdown
Author

Screenshots

Project connection ready

01-ready-connection

Add a Project connection

02-add-connection

Remove connection confirmation

03-remove-connection-confirmation

@wolfyy970
wolfyy970 marked this pull request as ready for review August 3, 2026 19:59
@wolfyy970
wolfyy970 force-pushed the codex/project-connections branch from 2f9a95a to 730c235 Compare August 3, 2026 19:59
@wolfyy970
wolfyy970 requested a review from a team as a code owner August 3, 2026 19:59

@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: 730c235447

ℹ️ 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 thread desktop/src-tauri/src/managed_agents/project_connections.rs Outdated
Comment thread desktop/src-tauri/src/managed_agents/project_connections.rs
Comment thread desktop/src-tauri/src/managed_agents/project_connections.rs Outdated
@wolfyy970
wolfyy970 force-pushed the codex/project-connections branch 2 times, most recently from a303c0d to d16e33a Compare August 3, 2026 21:15

Copy link
Copy Markdown
Author

@Annedaynl @custard-pirate, this is the Project-owned stdio connection half of the MCP work in #4571 and #4271. I would value your read on the boundary before I add agent bindings.

@matthewdonsemail-lab

Copy link
Copy Markdown

Great work on this — merge this so Desktop can have properly scoped MCP connections!

Our exact pain point (reproduced today):

We're running a managed Buzz agent (Social Media Outreacher) that needs persistent browser automation via @playwright/mcp. The workflow:

  1. We added the playwright MCP server to .mcp.json in the agent's working directory with the correct --user-data-dir and --executable-path args.
  2. Restarted Buzz Desktop multiple times.
  3. The agent session reports zero playwright tools available — only the built-in buzz-dev-mcp tools appear.

The root cause we identified: there is no path in the current Desktop for an agent session to consume an .mcp.json-defined stdio server. The server runs fine when launched manually (node cli.js ... exits cleanly), so it is not a startup crash — the Desktop simply never wires the tools through to the agent.

This forces a painful workaround: chain all browser automation steps into a single shell call (open --headed & sleep 4 && goto && snapshot), because the browser is a child process of the shell and is killed when the shell exits. Multi-step interactive sessions are impossible this way.

Why this PR directly fixes it:

This PR establishes a Project-owned connection model for stdio MCP servers — configured and tested once, discoverable by agents bound to that project. That is exactly the missing layer. Once agent bindings land on top of this, the playwright server will be visible to the agent session without any shell workaround.

Suggested follow-up after merge:

  • Surface a UI indicator in Desktop when a Project MCP connection is active and its tools are injected into an agent session (right now there is no feedback — you have no idea if the server loaded or silently failed).
  • Document the end-to-end flow: add connection → bind agent → confirm tools visible in session. Issue Docs: how to connect an external MCP server (Olostep) to Buzz agents? #4515 tracks this doc gap.

Looking forward to the agent bindings PR.

Copy link
Copy Markdown
Author

Thanks for documenting the repro. It confirms the split I’m implementing: this PR gives a Project tested, device-local MCP connections; the follow-up binds selected connections to an agent and carries them through the shared LaunchSpec. I’m restacking both on current main. I’ll link the replacement binding PR here and on #4852 once it is clean.

@wolfyy970
wolfyy970 force-pushed the codex/project-connections branch from 71e0287 to 1fe8df2 Compare August 5, 2026 14:46
Signed-off-by: KC <79471844+wolfyy970@users.noreply.github.com>
(cherry picked from commit 531a5bd)
Signed-off-by: KC <79471844+wolfyy970@users.noreply.github.com>
(cherry picked from commit d8907c1)
Signed-off-by: KC <79471844+wolfyy970@users.noreply.github.com>
(cherry picked from commit e4095d8)
Signed-off-by: KC <79471844+wolfyy970@users.noreply.github.com>
(cherry picked from commit 3cb59fd)
Signed-off-by: KC <79471844+wolfyy970@users.noreply.github.com>
(cherry picked from commit efd893b)
Signed-off-by: KC <79471844+wolfyy970@users.noreply.github.com>
@wolfyy970
wolfyy970 force-pushed the codex/project-connections branch from 1fe8df2 to 43fb782 Compare August 6, 2026 10:59
@ScaleLeanChris

Copy link
Copy Markdown

Tested current head 43fb7825 on Apple Silicon macOS with the focused Project connection gates.

  • Project connection secret validation: 7/7 passed
  • Desktop E2E build: passed
  • Project connection interaction scenarios: 11/11 passed
  • Focused Tauri backend checks: 27/27 passed
  • Synthetic MCP initialize + tools/list discovery: passed

The interaction run covered setup, verification, removal, stale approval review, per-row progress, tool inspection, recoverable failures, maximum text zoom, validation boundaries, and a Project with zero repositories.

One local test-portability finding: with the normal Homebrew PATH, resolve_command("node") returns the symlink /opt/homebrew/bin/node. The synthetic probe test stores that noncanonical path directly, while verify_saved_executable canonicalizes it to the Cellar binary and then rejects the fixture as changed. Running the same test with the canonical Cellar Node path passes. The production create/update paths already call canonical_connection_command, so this appears limited to the test fixture. Using canonical_connection_command in synthetic_server_proves_initialize_and_tool_discovery, as the neighboring approval tests do, should make the focused test reproducible on Homebrew installations.

No source changes made.

Signed-off-by: KC <79471844+wolfyy970@users.noreply.github.com>
Signed-off-by: wolfyy970 <79471844+wolfyy970@users.noreply.github.com>

Copy link
Copy Markdown
Author

Thanks, this was a real portability bug in the fixture. Fixed in 6687805: the test now canonicalizes the resolved executable before storing the command and computing its approval hash. The focused synthetic MCP test passes cleanly on Apple Silicon.

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.

3 participants