‘The session is still starting. Try again in a few seconds.’ (409 session-not-ready)
You might be here because: “The session is still starting. Try again in a few seconds.” · “409 session-not-ready” · “session_not_ready” · “SessionNotReadyError” · “my first message right after launch failed” · “This turn stopped before it finished, and no steps are shown”
Short answer
A new session takes a little while before its browser is ready. A message sent before then waits for it — up to 45 seconds on a streamed response, 20 seconds otherwise — and runs as soon as the browser is ready. If the browser is still starting after that wait, the message is refused with 409 session-not-ready and “The session is still starting. Try again in a few seconds.” Nothing ran, so send the same message again.
Check first
- Did you send the first message straight after launching? Give the session a few seconds, then send it again.
- Does the session use a VPN? A VPN connection can take longer to come up than a proxy.
Likely causes and fixes
- From code:
409 session-not-ready. The body carriescode: "session_not_ready",retryable: trueandretry_after_seconds: 5, and theRetry-Afterheader carries the same wait. Wait that long and send the same message again; the sameIdempotency-Keyis fine because nothing ran (which routes honour the header, and how it is scoped, is listed on the Idempotency reference). The SDKs raiseSessionNotReadyError. To avoid it, wait for the session’sreadyto readtruebefore the first message. - In the desktop app the turn ends with “This turn stopped before it finished. The steps above are what ran.” and no steps above it. Nothing ran: send the message again in a few seconds.
- It keeps happening on the same session. If messages are still refused a minute after launch, the session never became ready. End it and launch a new one.
If it still fails
If new sessions on the same profile keep refusing messages as still starting, press Talk to a person in this chat (or open Help) and include the session ids and the time you launched them.