A production-focused bridge for users who work across both opencode and Codex app-server.
It gives you a cleaner integration path between opencode and ai-sdk-provider-codex-cli, including:
- Provider option field mismatch (for example
reasoningEffort/reasoningSummary) - Tool name mismatch (
execvsbash) - Inconsistent historical
tool-resultshapes during session resume - Repeated approvals inside the workspace
- You primarily operate in
opencodebut depend on Codex app-server models - You want Codex integration through a published npm package without local wrapper maintenance
- You need fewer runtime surprises in tool calls, session resume, and workspace approvals
npm install @zmide/opencode-codex-providerPoint both provider and plugin to the same npm package:
Notes:
- Keep
plugin[]andprovider.codex-app-server.npmthe same package. - Set
modeltoprovider-id/model-id, and keep the entry underprovider.codex-app-server.modelskeyed by the unprefixed model id. - Replace
codexPathandconfigOverrideswith values for your environment.
Verify Codex CLI first:
codex exec --ephemeral --skip-git-repo-check -m gpt-5.3-codex "Reply with exactly: same-model-ok"Then verify opencode with the same prompt:
opencode run -m codex-app-server/gpt-5.3-codex "Reply with exactly: same-model-ok"- Rewrites compatibility fields under
providerOptions["codex-app-server"] - Removes unsupported provider options before sending to base provider
- Normalizes tool names from
exectobashfor generated and streaming outputs - Normalizes provider-executed
tool-resultpayloads - Injects workspace-aware approval handlers
- Exports an
opencodeplugin to repair malformed historical tool parts
- Command approvals are
acceptForSessionwhencwdis inside the current workspace - File-change approvals are
acceptForSessionwhengrantRootis inside the current workspace - Network approvals are
decline - Execution policy amendments are
decline - If your custom approval handlers return a decision, that decision wins
npm run validateThis runs format, lint, typecheck, test coverage, and build.
{ "plugin": ["@zmide/opencode-codex-provider"], "model": "codex-app-server/gpt-5.3-codex", "provider": { "codex-app-server": { "name": "Codex App Server", "npm": "@zmide/opencode-codex-provider", "models": { "gpt-5.3-codex": { "name": "gpt-5.3-codex", "options": { "approvalPolicy": "on-request", "sandboxPolicy": "workspace-write", "threadMode": "stateless", "minCodexVersion": "0.105.0", "effort": "medium", "codexPath": "/absolute/path/to/codex", "configOverrides": { "example_provider": "example-provider", "example_provider_feature_flag": false } } } } } } }