This repository was archived by the owner on Aug 17, 2026. It is now read-only.
Repository navigation
feat(grunt/tui): propagate OPENCODE_SERVER_URL into spawned daemon env - #6
Merged
Merged
Conversation
When patch 2e spawns the serve daemon, explicitly set OPENCODE_SERVER_URL
in the daemon's env. This propagates to all MCP children the daemon
spawns (via sanitizedProcessEnv in opencode's MCP layer), so hivemind-mcp
+ similar coordination MCPs can discover the daemon's HTTP endpoint at
boot to query session info.
Without this, the MCP child has no way to know what port the daemon is on
(other than guessing :4096), and no way to find its session-id.
OPENCODE_PEER_ID was already inheriting via default env (set by
setPeerID() in the wrapper); making it explicit alongside SERVER_URL for
clarity isn't needed (the {...process.env, OPENCODE_SERVER_URL} pattern
keeps PEER_ID flowing naturally).
Refs hivemind anomalyco#224 wakeable-without-typing follow-up.
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
terrxo
added a commit
that referenced
this pull request
May 28, 2026
#6) When patch 2e spawns the serve daemon, explicitly set OPENCODE_SERVER_URL in the daemon's env. This propagates to all MCP children the daemon spawns (via sanitizedProcessEnv in opencode's MCP layer), so hivemind-mcp + similar coordination MCPs can discover the daemon's HTTP endpoint at boot to query session info. Without this, the MCP child has no way to know what port the daemon is on (other than guessing :4096), and no way to find its session-id. OPENCODE_PEER_ID was already inheriting via default env (set by setPeerID() in the wrapper); making it explicit alongside SERVER_URL for clarity isn't needed (the {...process.env, OPENCODE_SERVER_URL} pattern keeps PEER_ID flowing naturally). Refs hivemind anomalyco#224 wakeable-without-typing follow-up.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Pair patch with grunt-it/hivemind-mcp#10.
When patch 2e auto-spawns the serve daemon, we now explicitly set OPENCODE_SERVER_URL in the daemon's env. This propagates to all MCP children the daemon spawns (via sanitizedProcessEnv in opencode's MCP layer), so hivemind-mcp + similar coordination MCPs can discover the daemon's HTTP endpoint at boot.
Together with hivemind-mcp#10's daemon-side session discovery, this completes the 'wakeable before first message' contract:
gruntcode --peer-id nik-tab-foo --project /pathregisters a fully wakeable peer before the user types anything.Refs hivemind anomalyco#224.