Jobs, streaming, and errors
AUVY execution is job-centric: neuron invokes and receptor fires return ajob_id. Long work streams over SSE or is polled via jobs.getStatus.
Are you an AI agent? See SDK source of truth for exact method names.
Pattern matrix
| Pattern | When | SDK | CLI |
|---|---|---|---|
| Fire-and-forget | You manage stream or status | receptors.fire(id, { stream: true }) → createStream(auvy, job_id) | auvy receptors execute SLUG --async --output json |
| Waiter | Scripts that need full output | receptors.invokeAndStream(...) or streamJobUntilComplete | auvy receptors execute SLUG --stream --output jsonl |
| Poll loop | Custom UI or interventions | jobs.getStatus + jobs.provideInput when waiting | auvy jobs get JOB_ID, auvy jobs input JOB_ID |
Streaming helpers
Whenstream: true on invoke, tokens arrive at GET /v1/jobs/:jobId/stream. The SDK wraps SSE:
createStream(auvy, jobId)— async iterablestreamJobUntilComplete(auvy, jobId, callbacks)— runs until terminal statesubscribeJobStream(auvy, jobId, callbacks, { reconnect: true, resumeAfter })— reconnect-safe
signal: AbortController.signal to cancel. For share flows, use shareCredentialToStreamOptions — see Public API.
Pagination
List endpoints acceptlimit and offset. The SDK provides paginate() and listAll():
Errors and retries
Both SDK packages throw typed errors with stablecode fields. Treat the Retryable column as authoritative.
| HTTP | code | Retryable |
|---|---|---|
| 400 | VALIDATION_ERROR | No |
| 401 | AUTH_REQUIRED | No |
| 403 | FORBIDDEN, trial_expired, cost_cap | No |
| 404 | NOT_FOUND, RESOURCE_NOT_FOUND | No |
| 429 | RATE_LIMIT | Yes |
| 5xx | INTERNAL_SERVER_ERROR | Yes |
| 0 | NETWORK_ERROR | Yes |
ConnectError with CONNECT_ERROR_CODES — see Connect SDK.
| Job status | Meaning |
|---|---|
completed | Success — read result |
failed | Terminal — fix input and re-invoke |
waiting | Needs jobs.provideInput |
Related
- Jobs API — REST status and stream paths
- SDK recipes — copy-paste patterns
- Integrate the API — first invoke walkthrough