Miner coding-agent driver
Choose a production provider, override the right model and timeout knobs, and recognize credential failures before you chase the wrong layer.
The miner resolves MINER_CODING_AGENT_PROVIDER as a comma-separated preference list. The first configured name wins, unknown names are skipped, and an empty or unset list leaves production construction fail-closed instead of guessing a default backend.
Provider selection
- noop
- Fail-closed stub. Useful when you want the miner to stay off or you are running tests.
- claude-cli
- Spawns the local `claude` CLI subprocess. Uses `MINER_CODING_AGENT_CLAUDE_MODEL` when set.
- codex-cli
- Spawns the local `codex` CLI subprocess. Uses `MINER_CODING_AGENT_CODEX_MODEL` when set.
- agent-sdk
- Runs the in-process Agent SDK path. It ignores the model and timeout overrides on this seam.
# Prefer Claude Code, fall back to Codex if Claude is unavailable.
MINER_CODING_AGENT_PROVIDER=claude-cli,codex-cli
MINER_CODING_AGENT_CLAUDE_MODEL=<optional-claude-model>
MINER_CODING_AGENT_TIMEOUT_MS=120000
# Prefer Codex, fall back to Claude.
MINER_CODING_AGENT_PROVIDER=codex-cli,claude-cli
MINER_CODING_AGENT_CODEX_MODEL=<optional-codex-model>agent-sdk ignore the model and timeout knobs. Only the CLI subprocess providers consume them.Model and timeout overrides
The only driver-specific knobs today are the provider-specific model overrides and the shared wall-clock timeout. Anything else is task-level orchestration, not provider config.
| Env var | Applies to | Default | Notes |
|---|---|---|---|
| MINER_CODING_AGENT_PROVIDER | All production provider selection | unset / empty | Comma-separated preference list. The first configured name wins; unknown names are skipped. |
| MINER_CODING_AGENT_CLAUDE_MODEL | claude-cli | CLI default | Optional override for the Claude Code subprocess. Ignored by noop, codex-cli, and agent-sdk. |
| MINER_CODING_AGENT_CODEX_MODEL | codex-cli | CLI default | Optional override for the Codex subprocess. Ignored by noop, claude-cli, and agent-sdk. |
| MINER_CODING_AGENT_TIMEOUT_MS | claude-cli / codex-cli | 120000 ms | Positive integer wall-clock ceiling. Unset or invalid falls back to the CLI driver's default timeout. |
Recognizing a stale or missing credential
The shared troubleshooting table for Claude Code and Codex lives on Self-host AI providers. This page keeps the miner-specific reminder: the credential lives on the operator's machine or mounted volume, not in repo config.
- claude_code_no_oauth_token
- Claude Code cannot find a runtime token. Re-run `claude setup-token` and keep the credential operator-owned.
- claude_code_error_401
- Claude rejected the token. Generate a fresh one with `claude setup-token` and replace the old secret.
- codex_no_auth
- Codex cannot find `auth.json`. Re-run `codex auth` on the mounted CLI home or volume.
- codex_credential_isolation_required
- The Codex home or auth path is not isolated from operator-owned storage. Remove the unsafe override.
Related docs
- Miner quickstart by lane — install and verify the miner before you wire a coding agent.
- Miner workflow — the rest of the contributor loop after the driver is configured.
- Self-host AI providers — the broader credential and provider reference that shares the troubleshooting table above.