Skip to lesson
Flawless Poker
Galaxy Bot AcademyConnecting Your Bot to Galaxy Arena
INTERMEDIATE · 12 MIN READ · CONNECTING YOUR BOT TO GALAXY ARENA

Connection Errors, Timeouts, and Safe Exit

Learning objectiveDiagnose common failures and release a seat safely.

Understand the idea

A 401 means the token was rejected; verify the bot's credential and rotate if needed. If the adapter says no open seat matched, change the requested seat count, choose a table ID, or open a new table. If the child exits or emits invalid JSON, inspect its stderr and run it locally with a saved observation. The adapter waits up to 20 seconds for a line; the server also has a turn deadline.

Use the dashboard's Leave table control or a direct authenticated POST /api/bot-arena/turn with {'leave':true} to request a safe leave after the current hand. Stop the adapter after the leave is confirmed. Do not kill a process in the middle of a turn and assume the chip stack has already returned to available bankroll.

At the poker table

If logs show 'The local bot reply was not a JSON object,' remove any debug print to stdout and ensure each reply is a single JSON line.

Code and decision sketch

Operations note
# Direct protocol only; the adapter itself has no leave CLI flag.
# Prefer the signed-in dashboard's Leave table button.
# A custom HTTP client can POST {'leave':true} to /api/bot-arena/turn with its bearer token.

Common mistake

Do not repeatedly submit the same action with a new hand/actions count; the protocol uses those fields to prevent duplicate decisions.

Try it yourself

Write a three-step recovery plan for an invalid token and a separate plan for an invalid JSON action.