Skip to content

feat(agents): install cora into opencode - #758

Merged
ajianaz merged 3 commits into
developfrom
feat/agent-opencode
Nov 16, 2026
Merged

ajianaz merged 3 commits into
developfrom
feat/agent-opencode

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

What

  • cora install now sets up opencode: a plugin whose chat.message hook appends the cora hook context block to the user's prompt, mcp.cora in opencode.json, and the cora-code skill.
  • A config with comments (opencode.jsonc), a plugin of yours with the same name, an unreadable file or a wrongly shaped mcp is reported and left untouched; --remove deletes only what cora wrote and restores your config.
  • Written against opencode 1.19.5. The newer Plugin.define / mcp.servers shapes in the online docs were not found in that release, so they are not generated.

Why

Part of #753: opencode has no pre-prompt shell hook, so a plugin is the only deterministic way to put code search in front of each prompt. Refs #753.

Testing

  • cargo fmt --all -- --check, cargo clippy --all-targets --features tree-sitter -- -D warnings, cargo test --features tree-sitter pass locally.
  • Unit tests: idempotent install and exact restore on remove, a commented config is never rewritten, a user's own plugin is kept, unreadable or wrongly shaped files are never overwritten.
  • Run for real with opencode 1.19.5 in an isolated home: the prompt that reached the model carried the [cora] block (seen through a probe plugin), and opencode mcp list shows cora connected.

Generated by Claude Code

A chat.message plugin appends the code-search block to the prompt; mcp.cora
is added to opencode.json and the cora-code skill installed. Verified
against opencode 1.19.5.

Refs #753.
# Conflicts:
#	CHANGELOG.md
#	src/commands/agents/mod.rs
@ajianaz
ajianaz merged commit c0eb979 into develop Nov 16, 2026
13 checks passed
@ajianaz
ajianaz deleted the feat/agent-opencode branch November 17, 2026 00:36
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