Skip to content

Executor plugins

Executors own the provider-specific LLM harness: tool loops, hook injection, session persistence, and telemetry normalisation. The runner orchestrates which executor to call; it never imports Anthropic/OpenAI SDK code directly.

Core interface (PhaseExecutorRuntime)

MethodNotes
executePhase(req)Returns an async iterable of PhaseExecutorEvent chunks (assistant deltas, tool proposals, usage metrics)
listModels()Emits ExecutorModelDescriptor rows for dashboards + alias validation
supports(modelId)Guards unknown models before network I/O

Optional:

  • calculateCost — Tenant-specific pricing adjustments.
  • mcpServer() — Attach executor-local MCP (uncommon).
  • chat(req) — Stateless conversational completion for surfaces that do not need tools, MCP, hooks, or subprocess agents (Coro plan mode on POST /intake/stream). Implementations should call the provider HTTP API directly. Request carries messages, optional systemPrompt, model, maxOutputTokens, and signal; result returns concatenated output plus normalised usage.

PhaseExecutionRequest highlights

Carries HookPolicy (allowedTools, writeRoots, onPreToolUse), resume handles, combined MCP server list, workflow-scoped subagents, and working-directory metadata.

Capability bits (ExecutorCapabilities)

FlagRunner effect
supportsNativeSubagentsLets YAML subagents use the executor’s native Task tooling; otherwise Coro registers run_subagent.
supportsClaudeMdNativeWalkUpWhen true, executor loads .claude/CLAUDE.md hierarchies itself.
supportsNativeFileToolsSuppresses fallback file_* + shell tools if the SDK already exposes them.
supportsSessionResumeClaude-style sessionId persistence.
supportsConversationReplayStateless models replay conversationHistory.
supportsThinkingSurfaces reasoningEffort hints from llm.aliases.
supportsImageInputEnables multimodal blocks.
maxContextTokensHard ceiling enforced before calling upstream APIs.

Exactly one resume strategy should be true for a given plugin build.

Reference packages

PackageRole
@coro-ai/llm-anthropicWraps @anthropic-ai/claude-agent-sdk — native Tasks + CLAUDE.md walk-up.
@coro-ai/llm-openaiOpenAI Responses / chat-completions style loop with conversation replay.

Executors must remain workflow-agnostic: no references to campaign, lane, or business guardrails beyond what the runner already encodes in hooks.