Prompt versions and model overrides
Use prompt history to inspect previous versions and request a rollback. The SDK caches fetched prompts for 60 seconds and uses a five-second fetch timeout. If the request fails, it returns the cached prompt or an empty string. Your application must provide its own fallback.
const systemPrompt = (await acp.fetchPrompt()) || DEFAULT_PROMPT;const model = acp.getEffectiveModel(DEFAULT_MODEL);
Pass these values into your actual provider request. Wrapping a function records and guards execution; it does not rewrite the prompt or model inside your function. Use getCachedPromptVersion() and getCachedCompositionHash() when explicitly recording version metadata.
Prompt history API
| Method and route | Purpose |
|---|---|
| GET /api/agents/:id/prompt-history | Inspect prompt history. |
| POST /api/agents/:id/prompt-rollback | Request a rollback through the prompt workflow. |