Expand description
Agent backends for okbot: agent CLIs through agent-call, fallback chains and CLI detection.
CliBackendruns one agent CLI (Claude Code, Codex, OpenCode, Devin) per turn.AgentChaintries backends in order, enforces the tool policy and limits concurrency.ScriptedBackendanswers from rules instead, for scripts and CI (okbot chat --replies).detectfinds installed CLIs and whether they are logged in, forokbot initanddoctor.
Modules§
- detect
- Finding installed agent CLIs (design §6.3.1).
Structs§
- Agent
Chain - Tries backends in order until one answers.
- CliBackend
- An agent CLI run through agent-call. Each turn starts a fresh process.
- CliBackend
Config - How to run one agent CLI.
- EnvScrub
- Decides which environment variables are removed before an agent CLI starts.
- Machine
Slots maxslots indir.- Scripted
Backend - An
AgentBackendthat answers from rules (see the module documentation). - Slot
- A held slot; dropping it frees the slot.
Enums§
Constants§
- PROVIDERS
- Every provider okbot knows, in the order the setup wizard lists them.
Functions§
- inline_
system_ prompt - Combines a system prompt and a user prompt for backends without a separate system prompt.
- model_
parts - Splits the model and effort for CLIs that support
model@effort. - parse_
provider - Parses a provider name as used in configuration (
claude,codex,opencode,devin). - provider_
name - The configuration name of a provider.
- validate_
model - Validates adapter syntax without guessing model availability or calling a provider.