Skip to content

feat: inject oh-my-opencode-slim roles into Agent-tool description#18

Open
mortonbaker wants to merge 1 commit into
dotCipher:mainfrom
mortonbaker:feat/slim-pantheon-support
Open

feat: inject oh-my-opencode-slim roles into Agent-tool description#18
mortonbaker wants to merge 1 commit into
dotCipher:mainfrom
mortonbaker:feat/slim-pantheon-support

Conversation

@mortonbaker
Copy link
Copy Markdown

Summary

When the bridge is used together with oh-my-opencode-slim, Claude (as orchestrator) can't spawn slim pantheon subagents (@explorer, @fixer, @oracle, etc.) — even though opencode's task tool would dispatch them correctly. The reason is that the captured Agent-tool description hardcodes only the four Claude Code SDK built-ins, so the model self-restricts.

This PR makes the Agent-tool description preset-aware:

  • At module load, read ~/.config/opencode/oh-my-opencode-slim.json
  • Walk the active preset, list each non-orchestrator role with its bound model
  • Append those lines to the Agent description so Claude knows the roles exist
  • The inbound translation layer already passes unknown subagent_type values through unchanged (AGENT_TYPE_CLAUDE_TO_OPENCODE lookup → if (mapped) guard), so no other change needed
  • Falls back to the unmodified description if the slim config is absent or the marker shifts

The schema's subagent_type is type: "string" with no enum, so the API accepts any value — the description is the only gate.

Test plan

  • npm run typecheck clean
  • npm test — 109/109 pass (no upstream tests broken)
  • Built dist/; verified Agent description now includes explorer/fixer/designer bound to minimax-coding-plan/MiniMax-M2.7-highspeed, plus oracle/observer bound to their preset models
  • Verified fallback path: with no slim config, description equals upstream byte-for-byte

Motivation

This unlocks orchestrator-on-Claude + specialists-on-MiniMax — high-judgment work stays on Claude, high-volume read/edit goes through the cheaper MiniMax quota. Big cost saving for users on the Claude Max + MiniMax Max-Highspeed stack.

Claude (as orchestrator via this bridge) was unaware of the slim pantheon
subagents because the captured Agent-tool description only documents the
four Claude Code SDK built-ins. The schema's subagent_type is `type: string`
with no enum, and the inbound translation layer already passes unknown
values through unchanged — so the only missing piece was telling Claude
those roles exist.

Reads ~/.config/opencode/oh-my-opencode-slim.json at module load, walks
the active preset, and appends each non-orchestrator role to the Agent
description with its bound model. Falls back to the unmodified description
if config is missing/malformed or the marker shifts upstream.

- typecheck: clean
- npm test: 109/109 pass
- verified compiled dist injects roles: oracle, librarian, explorer,
  designer, fixer, observer all listed with model bindings

This unlocks orchestrator-on-Claude-opus + specialists-on-MiniMax, which
keeps high-judgment work on Claude while routing high-volume read/edit
tasks through the cheaper MiniMax quota.
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