Skip to content

fix(mcp): initialize environment before handling requests - #410

Merged
forketyfork merged 1 commit into
mainfrom
fix/mcp-env-initialization
Sep 13, 2026
Merged

forketyfork merged 1 commit into
mainfrom
fix/mcp-env-initialization

Conversation

@forketyfork

Copy link
Copy Markdown
Owner

Issue

Homebrew-installed architect-mcp accepted initialization and tool-list requests but aborted on tools/call because control-socket discovery accessed the process environment before it was initialized. MCP clients reported the resulting process exit as Transport closed.

Solution

Initialize the process environment from std.process.Init before the MCP stdio loop starts, and register the shared environment module for the MCP target. Add an end-to-end regression that invokes the real entrypoint with isolated runtime state and verifies the structured app_not_running response.

Context

The helper forwards spawn_session requests to a running Architect instance through the local control socket. No issue link was provided.

Issue: Homebrew-installed architect-mcp aborted during tools/call because control-socket discovery accessed env before the MCP entrypoint initialized it.

Solution: Initialize the process environment from std.process.Init before entering the stdio request loop and register the shared environment module for the MCP target. Add an end-to-end regression that invokes the real entrypoint with isolated runtime state and verifies the structured app-not-running response.
@forketyfork
forketyfork marked this pull request as ready for review September 13, 2026 07:06
@forketyfork
forketyfork merged commit d5793c6 into main Sep 13, 2026
4 checks passed
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.

1 participant