Integrate

SDK, paste-to-AI, or manual

The SDK is the preferred path. ACP also generates a deterministic long-form client plus an instruction prompt you can paste into a coding agent, or you can wire the pieces yourself.

Wrap the call you already have

wrapAgentRun refuses to run while the agent is paused or stopped, times the call, reads token counts and the answer text from OpenAI, Anthropic and Google Gemini responses, and reports the run. Errors are reported and rethrown. In Python the same wrapper is wrap_agent_run (and wrap_agent_run_async), which raises AgentPausedError without calling your function.

agent-control-panel · run wrapper
import { acp } from "./acp";

// Your application supplies the fallback and provider call.
const systemPrompt = (await acp.fetchPrompt()) || DEFAULT_PROMPT;
const model = acp.getEffectiveModel(DEFAULT_MODEL);

const answer = await acp.wrapAgentRun(
  () => callYourModel({ model, systemPrompt, input }),
  { inputSummary: input.slice(0, 500), modelUsed: model }
);

// For a run you time yourself, use reportRun instead.
// Include fullInput/fullOutput and promptVersion explicitly
// when you need recorded content and version attribution.
Python · run wrapper
from agent_control_panel import AgentPausedError

def handle(question: str) -> str:
    try:
        return acp.wrap_agent_run(
            lambda: my_agent(question, system_prompt=acp.fetch_prompt() or DEFAULT_PROMPT),
            user_input=question,
            model_used=acp.get_effective_model("gpt-4o-mini"),
        )
    except AgentPausedError:
        return "This assistant is paused. Please try again later."
Batching

Runs buffer and flush every 5 seconds, or immediately at 50 buffered. The buffer is capped at 200; excess drops oldest first.

Retries

A failed flush retries four times with jittered backoff, then drops the batch and logs the count. Reporting never throws into your code.

Shutdown

The client flushes on beforeExit and on acp.stop(), so the last runs of a process still arrive.