Skip to content

feat(opencode/session): default-on hivemind loop primitive (#266 Phase 2)#23

Merged
terrxo merged 1 commit into
devfrom
feat/loop-default-on
May 27, 2026
Merged

feat(opencode/session): default-on hivemind loop primitive (#266 Phase 2)#23
terrxo merged 1 commit into
devfrom
feat/loop-default-on

Conversation

@terrxo

@terrxo terrxo commented May 27, 2026

Copy link
Copy Markdown

Summary

Flip OPENCODE_HIVEMIND_LOOP_ENABLED default from falsetrue. The hivemind loop primitive (anomalyco#266 Phase 1) shipped behind a feature flag; Phase 2 makes it default-on.

Pairs with hivemind-mcp PR #22 (3-turn grace window for missing-loop-goal).

Why now

Phase 1 validation (post-PR #21 merge) proved:

  • The hook is reliably non-fatal — every call is wrapped in Effect.ignore + Effect.forkIn(scope), so the TUI never blocks or sees an exception from a slow/failing hivemind connection.
  • The auto-drive payoff is significant: workers signal 🚦 READY FOR REVIEW and the coord wakes automatically; coordinators auto-continue when there's still work to do; idle-phrase + silent-stall escalations route to parents without manual nudges.

Changes

  • packages/opencode/src/effect/runtime-flags.tshivemindLoopEnabled now Config.boolean(...).pipe(Config.withDefault(true)). Docblock updated to reflect Phase 2 + the opt-out env var.
  • packages/opencode/src/session/hivemind-loop-hook.ts — docblock + per-export comments updated to say "default ON" + "opt out via OPENCODE_HIVEMIND_LOOP_ENABLED=0".
  • packages/opencode/src/session/processor.ts — call-site comment refreshed.
  • GRUNTCODE.md — patch feat(grunt/tui): bare gruntcode auto-spawns serve + attaches (one-command wakeable TUI) #5 description rewritten to reflect default-on + cross-reference the hivemind-mcp grace window.

Opt-out path

To opt out for a specific tab/session:

OPENCODE_HIVEMIND_LOOP_ENABLED=0 gruntcode --peer-id ...

Tests

bun typecheck from packages/opencode is clean.

Pair with

grunt-it/hivemind-mcp#22 — adds the 3-turn grace window so peers that haven't called hivemind_set_loop_goal yet aren't immediately flagged when this default flip lands.

Refs grunt-it/hivemind-mcp#266 Phase 2.

🚦 READY FOR REVIEW

…#266 Phase 2)

Flip OPENCODE_HIVEMIND_LOOP_ENABLED default false → true. Phase 1
validation proved the hook is reliably non-fatal (forkIn(scope) +
Effect.ignore swallow every failure) and the auto-drive payoff is
significant. Users who want to opt out can still set
OPENCODE_HIVEMIND_LOOP_ENABLED=0 in the env.

Pairs with hivemind-mcp PR adding a 3-turn grace window before
'missing-loop-goal' escalation, so peers that haven't called
hivemind_set_loop_goal yet aren't immediately flagged.

Refs: grunt-it/hivemind-mcp#266
@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.

@github-actions

Copy link
Copy Markdown

Hey! Your PR title feat(opencode/session): default-on hivemind loop primitive (#266 Phase 2) 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.

@terrxo terrxo merged commit bec5385 into dev May 27, 2026
3 of 10 checks passed
@terrxo terrxo deleted the feat/loop-default-on branch May 27, 2026 13:24
terrxo added a commit that referenced this pull request May 28, 2026
…#266 Phase 2) (#23)

Flip OPENCODE_HIVEMIND_LOOP_ENABLED default false → true. Phase 1
validation proved the hook is reliably non-fatal (forkIn(scope) +
Effect.ignore swallow every failure) and the auto-drive payoff is
significant. Users who want to opt out can still set
OPENCODE_HIVEMIND_LOOP_ENABLED=0 in the env.

Pairs with hivemind-mcp PR adding a 3-turn grace window before
'missing-loop-goal' escalation, so peers that haven't called
hivemind_set_loop_goal yet aren't immediately flagged.

Refs: grunt-it/hivemind-mcp#266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant