Skip to content

Troubleshooting & FAQ ​

Symptoms first, then the answers to the questions that come up most. Every row links to the page that explains the setting behind it. For the complete list of error codes see Error Handling.

The server does not start ​

createAgentServer and the register* methods validate their input and throw at startup, so a bad configuration fails before the first request:

Message (shortened)Cause and fix
auth.enabled needs auth.provider ...Token auth is switched on with nobody to check tokens. Add a provider, or set enabled: false and use resolveUserId / resolveContext (Authentication).
limits.maxFileSize (...) is larger than the ... bytes this storage provider can hold (also files.maxFileSize, limits.maxStateBytes)A limit above what the provider holds. Lower it, or use a provider that holds more (Storage Providers).
The server has a budget but no pricing / Agent "x" has a budget but no pricingA budget needs a pricing function, the server's or the agent's (Usage & Budgets).
titleGeneration needs baseUrl and model ..., or a generate functionThe title settings are incomplete (Chat experience).
A host agent needs info.id / Host agent "x" needs an invoke functionThe host-backed definition cannot work (Host-backed agents).
JWTAuthProvider needs a secret ...createJWTAuthProvider without a key, or with a key of the wrong kind for the algorithm.
Storage provider is not connected (a 500)await storage.connect() before the first request.

A request is refused ​

AnswerWhat it meansFix
401 identity_requiredA list request that names no userResolve a user for every request, or set allowAnonymousList: true on a single-user server (Request Context)
401 AUTHENTICATION_ERRORNo or invalid token, or resolveContext returned nullCheck the header and the token (Authentication)
403 FORBIDDENThe conversation, task or file belongs to someone elseConversations belong to the user id the server resolved; keep it stable between requests
404 NOT_FOUNDUnknown, or not yours (a file of someone else answers like a missing one), or an agent not served to this request
402 budget_reachedThe conversation's budget is used upRaise it and continue (Usage & Budgets)
409 conversation_busyA turn is running in that conversationWait, follow it, or POST .../cancel (Runs)
409 action_pendingA tool approval or question is openAnswer it, or cancel it (Approvals)
410 action_expiredThe request lapsedReload the conversation; hitl.onTimeout has been applied
413 PAYLOAD_TOO_LARGEThe body is over the adapter's limitlimits.maxBodySize, uploadBodyLimit (Fastify) (Files)
413 STORAGE_LIMIT_EXCEEDEDThe provider cannot hold the file or the stateStorage Providers
415 unsupported_media_type / unsupported_file_typeA form upload / a type the agent does not acceptSend the bytes as the body, check allowedMimeTypes
429 rate_limitedYour rateLimit hook refusedWait Retry-After (Embedding & limits)
501 export_format_unsupportedformat=pdf without export.renderPdfUse format=html&print=1

A turn does not behave ​

SymptomRead
The answer is lost when the tab closes, or a Stop button does nothingRuns, Cancel & Reattach
The tool runs without asking, or an approval cannot be answeredApprovals & Questions
No costUsd, or the budget does not stop a turnUsage & Budgets
The agent does not read the file I attachedFiles
A custom handler does not streamCustom Agents
My backend agent behaves differently from an SDK agentHost-backed agents
The browser blocks the chat, or an embedded chat gets 401Embedding & limits

FAQ ​

What does stopReason mean? ​

It is why the last turn stopped, on the assistant message (metadata.stopReason), on the response and stream.done, in session.status_idle events and in conversation.runtime.stopReason:

stopReasonMeaning
end_turnThe agent finished its answer
requires_actionThe turn paused for an approval, a question or a client tool
cancelledSomeone pressed Stop (POST .../cancel), or an unanswered request was dropped under hitl.onTimeout: "cancel"
max_turns, limitThe agent stopped on its own limits: an agent-sdk run that breached a limit (limit), or a handler or host agent reporting max_turns / limit itself
budget_reachedThe conversation's budget ended the turn
errorThe turn failed; runtime.error says why (run_interrupted is a run whose server died)

Do I need a database? ​

For development, createInMemoryProvider() needs nothing and loses everything on restart. SQLite (better-sqlite3) is one process and one file. PostgreSQL or MongoDB are for production and for more than one server instance (Storage Providers).

Can I run several instances? ​

Yes, on PostgreSQL or MongoDB shared by all of them: one turn per conversation holds across instances through leases, cancel reaches a run on another instance, and the event stream can be served by any instance. Keep the clocks within a few seconds (Architecture).

Does an approval survive a restart? ​

With every built-in provider except memory, yes: the paused state is stored with the conversation, and a new server on the same database resolves a pause the old one started (Approvals & Questions).

Where is tenant isolation? ​

The server separates users, not tenants. Run a server per tenant, put the tenant in the user id, or scope in your own storage provider (Request Context).

How long is data kept? ​

Files: files.retentionDays (30; 0 for ever). Events: runs.eventRetentionDays (30; 0 for ever). Conversations and messages are kept until deleted. Approval requests lapse after hitl.timeoutMinutes (1440; 0 never).

How do I see what a conversation did? ​

Read its event log: GET /conversations/:id/events (or follow it with .../events/stream). It records the person's message, every tool call and result, usage, approvals and how each turn ended (Runs).

Is the task callback signed or retried? ​

No. It is one POST with no credential and no retry; a failure is only logged. Read the task from the API when it arrives (Task System).

Can I restrict who answers an approval? ​

Yes: hitl.authorizeResolve(ctx, { conversation, action }) decides for everyone, the owner included (Approvals & Questions).

Can a conversation cost more than its budget? ​

By at most one model call for an agent-sdk agent that has a costEstimator; by the turn that crosses the limit for a handler or host agent, which cannot be stopped in the middle (Usage & Budgets).

Where do I report a problem? ​

On GitHub Issues. Include the package version, the storage provider, the adapter, and the error.code and runId of the failing request.

Studio · Pulse · Console · Agent SDK and more — the Cognipeer documentation hub