Skip to content

feat(core): deliver CodeMode catalog through instructions - #38003

Merged
rekram1-node merged 2 commits into
v2from
codemode-instructions
Jul 21, 2026
Merged

rekram1-node merged 2 commits into
v2from
codemode-instructions

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Moves the dynamic CodeMode tool catalog out of the execute tool description and into a durable Instruction source, per the CodeMode catalog design (#36196).

Changes

  • Stable execute description: CodeMode.description in @opencode-ai/codemode is now invariant guidance (runtime, tools.* paths, search, Promise.all). The provider tool definition no longer changes when the catalog changes.
  • New core CodeMode.Service (packages/core/src/codemode.ts): owns CodeMode tool registrations (scoped, latest-active-wins) and materialization. ToolRegistry.register delegates codemode: true registrations to it; the registry keeps only native/direct tools.
  • New CodeModeInstructions source (core/codemode): renders the permission-filtered catalog as an agent-scoped Instruction, with initial, changed ("catalog has changed... supersedes the previous"), and removed renderings. Wired into session context loading alongside the other instruction sources.
  • ExecuteTool now exposes instructions(registrations) separately from tool creation, so the catalog renders without constructing a discovery runtime inside the tool description.

Tests

  • CodeMode.Service registration + materialization
  • CodeModeInstructions initial/changed/removed rendering
  • Codemode package: stable description stays independent of the catalog
  • Updated MCP + tool-registry tests to assert the catalog no longer rides in execute.description

bun typecheck clean in packages/codemode and packages/core. Full suites pass in both (one pre-existing unrelated failure in test/config/plugin.test.ts, fails identically without these changes).

@rekram1-node
rekram1-node changed the base branch from dev to v2 July 21, 2026 03:36
@rekram1-node
rekram1-node force-pushed the codemode-instructions branch from 534343d to d98e51d Compare July 21, 2026 03:42
@rekram1-node
rekram1-node merged commit 7ec1b6e into v2 Jul 21, 2026
8 checks passed
@rekram1-node
rekram1-node deleted the codemode-instructions branch July 21, 2026 19:46
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
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