OpenCode provider.
Runs k0rtex sessions in OpenCode. Install it next to
k0rtex-worker; the worker finds it through the k0rtex.providers entry point.
Everything k0rtex knows about OpenCode is in this package:
- the launch:
opencode run --standalone --format json, with the prompt on its input, - how a session’s agents, permissions, skills and MCP servers become
OPENCODE_CONFIG_CONTENT, dialect.py, which reads its JSON events into k0rtex activity, including the MCP calls OpenCode makes from inside itsexecutecode tool,- model discovery through
opencode models.
Where it differs from k0rtex’s own rules #
A headless opencode run cannot pause for the owner. A rule that says ask is therefore
applied as deny, and the run’s transcript names what was denied. Allow it in the agent’s
permissions if the agent needs it. Questions the agent asks through k0rtex’s own MCP tools
are not affected.
Reasoning effort is a model variant (provider/model#effort). When the model has no such
variant, or no model is chosen, the run goes ahead without it and says so in its usage.
Another harness #
Write a package like this one: implement k0rtex_protocol.provider.Provider and register it
under the same entry-point group. Use the transport the harness recommends: cli for a
headless command that streams JSON, with a dialect that reads it, or a2a for an
Agent2Agent endpoint.
This page is backend/packages/provider-opencode/README.md in the k0rtex repository. Suggest a change.