Skip to main content

Why am I not getting any WebSocket messages for my task?

Check which token you register with, when you register, and which event you wait for.

Usually the socket doesn't know which task to follow, or started listening too late. Check these:

  1. Token: connect to wss://socket.wiro.ai/v1 and send {"type": "task_info", "tasktoken": "..."} with the socketaccesstoken from the Run response, not the taskid. A missing token returns token-invalid; a wrong one is accepted but receives nothing. There's no test token, so run a cheap model to get one.

  2. Timing: register right after Run. Earlier events aren't replayed, so a finished task sends nothing; get its result from Task/Detail.

  3. Final event: don't stop at task_end. Wait for task_postprocess_end: exitCode 0 means success, and message holds the outputs. A cancelled task ends with task_cancel instead. task_error isn't a failure, so keep listening.

  4. Reconnects: send task_info again, and use Task/Detail for anything you missed.

Don't need live updates? Polling Task/Detail or a callbackUrl is simpler. Details: WebSocket flow and message types.

Did this answer your question?