Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.

feat(grunt/tui): propagate OPENCODE_SERVER_URL into spawned daemon env - #6

Merged
terrxo merged 1 commit into
devfrom
grunt-feat/propagate-server-url
May 26, 2026
Merged

terrxo merged 1 commit into
devfrom
grunt-feat/propagate-server-url

Conversation

@terrxo

@terrxo terrxo commented May 26, 2026

Copy link
Copy Markdown

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 /path registers a fully wakeable peer before the user types anything.

Refs hivemind anomalyco#224.

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.
@github-actions

Copy link
Copy Markdown

Hey! Your PR title feat(grunt/tui): propagate OPENCODE_SERVER_URL into spawned daemon env doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

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
terrxo merged commit c3d6cd3 into dev May 26, 2026
3 of 10 checks passed
@terrxo
terrxo deleted the grunt-feat/propagate-server-url branch May 26, 2026 22:06
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant