- Duale AI
- Documentation
- Python SDK
- SDK troubleshooting
Troubleshoot the SDK: task outcomes and error fixes
Maps Duale AI SDK symptoms to causes and fixes for model() outcomes, credential errors, Library calls, and Tool Host failures.
This guide covers model() error handling, task submission outcomes, credentials and access, libraries and documents, Tool Host errors, and support requests.
- model() error branches and task submission outcomes.
- Credentials and access error resolution.
- Libraries and documents troubleshooting.
- Tool Host startup and runtime errors.
- Support request details and required identifiers.
Summaries were generated by AI.
Keep response.task_id before anything else: you need it to find what happened to the Task. An AgentResponse alone
does not prove that Duale AI accepted the Task. Start from what your application observed, then follow the matching
branch. SDK errors lists every exception, field, and code named here.
Decide what to do when model() raises
The SDK’s own stream recovery has already run when model() raises. Any repeat you decide on is new work, with your
own backoff: a failed Task carries no retry_after_seconds. This excerpt follows the same order and uses your
response and application handlers:
from dualeai import (
DualeAIAuthError,
DualeAIConnectionError,
DualeAIError,
TaskStoppedError,
ValidationError,
)
task_id = response.task_id
try:
result = await response.model()
except DualeAIConnectionError:
# Observation failed; the Task can still finish. Check before new work.
record_unobserved_task(task_id)
except DualeAIAuthError:
fix_credential_or_permission(task_id)
except TaskStoppedError as stopped:
record_stopped_task(task_id, stopped.reason)
except ValidationError:
review_response_model(task_id)
except DualeAIError as exc:
details = exc.problem_details
if details is not None and details.owner_action_required:
notify_configuration_owner(task_id, details)
elif details is not None and details.retryable:
schedule_resubmission(task_id) # Your own backoff.
else:
change_the_request(task_id, details)Check. Each handled branch records the task_id and the outcome before your application submits new work.
Task submission and outcomes
- Symptom
await response.model()has not returned when expected- Cause
- The SDK has not observed a final event; final-answer writing can continue briefly after the deadline.
- Fix
model()has no separate timeout. Keepresponse.task_idand allow for that writing (deadlines). To end the work, request a Stop; to stop waiting only, cancel your local wait (Observe the Task outcome).
- Symptom
ValidationErrorfrommodel()- Cause
- The result did not match the response model.
- Fix
- Align the model with the Task, or drop
resand read the raw completion.
- Symptom
DualeAIConnectionErrorduring a Task stream- Cause
- Observation failed after recovery attempts or a non-retryable error.
- Fix
- Read the stream error context and any problem details. Preserve the Task ID; this exception does not prove a failed Task. Check the reported HTTP status or typed cause before repeating work.
- Symptom
error_codeisCONTENT_FILTERED- Cause
- No selected model produced an acceptable response; not retryable.
- Fix
- Do not retry unchanged. Inspect
problem_detailsand adjust the request.
- Symptom
TASK_DEADLINE_EXCEEDEDwith no Tool Call recorded- Cause
- The Agent Identity’s Tools grew past the bound on what it can hold.
- Fix
- Remove an assignment; see Tool limits.
- Symptom
- A submission raises
RuntimeError - Cause
- The SDK’s circuit breaker is open after repeated failures.
- Fix
- Wait for the recovery delay, then let one submission check recovery.
Credentials and access
The SDK obtains a platform token before its first protected request and renews it before expiry. Issuance and
mandatory renewal raise DualeAIAuthError for 401/403, or DualeAIConnectionError for other failures, including
network errors and unusable responses. A failed early renewal can leave a valid token in use. See Credentials and
lifecycle before replacing or revoking the API token.
- Symptom
DualeAIAuthErrorwith status401- Cause
- The server rejected the token. On a Library call,
DUALEAI_TENANT_IDcan also name a tenant the token was not issued for, or be malformed. - Fix
- For a Library call, first check that
DUALEAI_TENANT_IDis the tenant the token was issued for. Otherwise ask someone withagent:create_tokento issue a replacement Agent Identity token, then revoke the old token if still active. SetDUALEAI_TOKENto the replacement, including itsdualeai_prefix.
- Symptom
ACR_STEPUP_REQUIRED- Cause
- The operation needs a higher authentication level than an API token reaches, such as deleting a whole Library.
- Fix
- Use the Dashboard.
- Symptom
DualeAIAuthErrorwith status403- Cause
- The token’s caller lacks the action required by that operation.
- Fix
- For a Library call, find the checked action in Library actions, then correct the Grant or policy. For a Task call, find it in Task actions. For another operation, verify the caller and its documented access before repeating it.
- Symptom
- Configuration error at startup
- Cause
- A required setting is missing or malformed.
- Fix
- Follow Exceptions outside the hierarchy and check the environment variables.
Libraries and documents
- Symptom
BusinessErrorduring a Library call- Cause
- The Library rejected the operation with a
4xx. - Fix
- Read
problem_details.error_codeand follow its row in Library request codes.
- Symptom
DualeAIConnectionErrorwhile connecting, renewing credentials, or calling a Library- Cause
- Issuance failed outside
401/403, the network failed, or the Library returned5xx. - Fix
- Check
DUALEAI_ENDPOINTand network egress. If problem details exist, retry only whenretryableis true. Without problem details, retry safe reads. Before repeating a write whose outcome is unknown, follow that operation’s recovery steps.
- Symptom
LibraryUploadError- Cause
- A local file read or an upload part failed.
- Fix
- Read
attachment_keyandpart_number; preservecompleted_receipts, then recover the partial upload.
- Symptom
wait_for_document()returns afaileddocument- Cause
- The document failed processing.
- Fix
- Follow its row in Document ingestion failures.
- Symptom
wait_for_document()raisesTimeoutError- Cause
- The client wait ended; processing can still continue.
- Fix
- Poll the same document with
get_document(); do not upload it again.
- Symptom
- A
readydocument preview shows only an encryption type or rights label - Cause
- A password or a rights label protects the file.
- Fix
- Duale AI made only that protection metadata searchable. Remove the protection, upload the file again, and confirm that the preview now contains the source text.
- Symptom
- A
readyscan or figure gives no visual answer - Cause
- No configured route carried the picture, or a route limit dropped it.
- Fix
- Configure an image-capable Model Route whose limits admit the pictures, then repeat a question that only one picture answers. Images in a document covers the setup.
Tool Host
- Symptom
- Serving Tools raises an error about
agent_id - Cause
- No Agent Identity identifier is configured.
- Fix
- Set
DUALEAI_AGENT_IDto a provisioned Agent Identity beforesdk.serve().
- Symptom
sdk.serve()raisesBusinessErrorat startup- Cause
- Duale AI rejected the manifest.
- Fix
- Read
problem_details.error_codeand follow its row in Tool Host errors.
- Symptom
@toolraisesValueErrorwhen the function is declared- Cause
- The function uses a reserved Tool name.
- Fix
- Rename the function; Tool Host errors lists the reserved names.
- Symptom
sdk.serve()stops after failed heartbeats- Cause
- Three consecutive heartbeats failed, for example with
RATE_LIMIT_EXCEEDEDwhen several processes serve one Agent Identity, or two were refused with401or403. - Fix
- Run one Tool Host process per Agent Identity. For a refusal, check the token and its
agent:heartbeatpermission. Then restartserve().
- Symptom
- A Tool Result submission fails with
REQUEST_BODY_TOO_LARGE - Cause
- The result is larger than one submission accepts.
- Fix
- Return identifiers, summaries, or rows instead; see Keep the Tool Result small.
- Symptom
- Built-in
TimeoutErrorfrom an@activity - Cause
- The wait for scheduled activity work exceeded
job_timeout. - Fix
- Treat the Effect as uncertain. Cancellation cannot roll back an external action that already completed. Activity caching explains the timer.
Ask for support
If a failure persists, email technical support with the task_id, the
error_code, the trace_id and span_id when present, the request_id for an HTTP rejection, and the stream
context’s operation, retry_attempt, and HTTP status. Never send the API token or a platform token.