blender-motion-state-inspection
AFaffaan-m/ECC315k3,503 new stars in the last 7 days
Use when the contestant's agent keeps disconnecting from the gateway, a job fails with failure_reason 9 / "tunnel lost: reconnect window expired", or the log shows close 1006 / 1011 / "keepalive ping timeout". Runs read-only local checks (event-loop lag, link loss, throughput during a large frame) to tell "my machine/network" apart from "the platform", and says what evidence to send the organizers.
failure_reason: 9 plus tunnel lost: reconnect window expired only says the platform gave up
waiting — your agent was gone for more than 30 s. It does not say why the socket dropped.
This skill finds the why, from your side, using read-only checks.
Everything here is read-only. Do not resubmit (costs a daily slot) or kill running agents while diagnosing.
[ -f ~/.simubotix-challenge.env ] && . ~/.simubotix-challenge.env
curl -fsS "$BASE_URL/api/challenge/job/$JOB_ID/log" \
-H "Authorization: Bearer $CHALLENGE_TOKEN" | jq '{failure_reason, status, case_id, result}'
failure_reason must be 9. If it is 1/3/4, this is not a connection problem —
go to challenge-troubleshoot row 8.result.error reads tunnel lost: reconnect window expired (or tunnel lost: liveness probe: …),
followed by (last disconnect: …; N disconnect(s) during this run) when the platform has a
disconnect history for that run. result.stdout carries the simulator's last output when it
could be captured. Quote what is actually there.Find the close events in your agent's log and bucket them. The same drop looks different from each side:
| What you see in your agent | Meaning | Go to |
|---|---|---|
close 1006 / no close frame received or sent / unexpected EOF / connection reset | The connection ended without a close frame. 1006 is a placeholder the WebSocket library invents for that situation — it is not a code the other side sent and it carries no cause | Step 2, 3, and "Step 1b" below |
close 1011 / keepalive ping timeout | Your client closed the connection because a ping it sent got no pong within its ping_timeout (that is what the message says; the library docs do not document the close code, so go by the message text) | Step 2, 3 |
close 1000 / 1001 you did not intend | Your code (or a wrapper/supervisor) closed the connection | Step 4 |
Platform side shows server_write_error (in result.error: "the gateway could not write to your agent in time") | The gateway could not push a frame to you within its write window — the downstream link stalled while a large observation frame was in flight | Step 3 |
Process exit (returncode, supervisor restart) | Your process died or was killed | Step 4 |
Two facts about the gateway that matter (full detail: appendix A.5/A.6 of challenge-run-agent):
it pings every 20 s and drops the connection after 45 s with no inbound bytes (pongs, pings and frames all count); after any drop you have
30 s to reconnect with the same agent_id. Short blips that reconnect inside 30 s are harmless —
a failure means one outage (or a reconnect that came late) exceeded the window.
Count them and note how long each took to recover. How many drops there were, and how many came back inside 30 s versus not, tells the organizers more than the last error alone.
A 1006 only tells you the connection vanished. Rule things out in this order; each is something you can read off your own machine:
dmesg | grep -i -E "killed process|oom" (Linux). A killed process closes its
sockets without a close frame — it looks exactly like a network cut.HTTP(S)_PROXY in the environment can reset or time out long-lived connections. Check
env | grep -i proxy and what your VPN/firewall does with idle or long-lived TCP.Only if all four come back clean is it worth sending the evidence in Step 5. Do not pick a cause from the 1006 alone.
(a) Is your event loop stalled? If inference runs on the same asyncio loop that owns the WebSocket, a long step stops pongs. Run a lag monitor next to the agent (or add it in-process):
import asyncio, time
async def loop_lag_monitor(threshold=1.0):
last = time.monotonic()
while True:
await asyncio.sleep(0.5)
now = time.monotonic()
lag = now - last - 0.5
if lag > threshold:
print(f"[loop-lag] event loop blocked {lag:.1f}s at {time.strftime('%X')}")
last = now
Lag spikes that line up with the disconnect times → something is blocking the loop. If that is
synchronous inference, moving it off the loop (asyncio.to_thread(...) for a blocking call, or a
separate process) lets the loop keep answering pings. No spikes → this is not your cause.
(b) Is the link lossy? Run the bundled probe from the machine that runs the agent:
# gateway host = host part of TUNNEL_ENDPOINT (the job response's tunnel_endpoint)
bash scripts/probe_gateway.sh # ICMP loss/rtt, 20x GET /health, mtr if installed
Loss, or /health max far above avg, suggests a lossy or jittery path. A clean result is not
exoneration — a short probe doesn't load the pipe. Go to Step 3.
Observation frames can be several MB each. A WebSocket is a single TCP stream, so bytes queued behind a large message — including a ping or a pong — wait until the bytes ahead of them have been sent. If a big frame is slow enough that a pong arrives later than a peer's deadline, that peer drops the connection even though both processes are healthy. This is one possible explanation for "disconnects only while a request is in flight"; the measurements below tell you whether it applies to you. Check your own frame sizes first — do not assume them.
Measure it instead of guessing. Log, per inbound binary frame: byte size and time from the previous send to receipt. And watch the link while a frame is in flight:
# Linux: live per-connection TCP stats to the gateway (rtt, retrans, delivery_rate, cwnd)
GW_HOST="${TUNNEL_ENDPOINT#*://}"; GW_HOST="${GW_HOST%%/*}"; GW_HOST="${GW_HOST%%:*}"
watch -n 1 "ss -ti dst $GW_HOST"
# whole-NIC throughput while a frame is arriving (is something else eating the uplink/downlink?)
sar -n DEV 1 # or: ifstat 1 / nload
Read it like this (these are things to suspect, not proof — confirm with a second measurement):
| Observation | Suspect |
|---|---|
Frame size ÷ transfer time is far below your line speed, and ss shows retrans growing | Loss or congestion on the path — Step 5 |
| Throughput is low and steady (e.g. a few Mbit/s) | A bandwidth limit somewhere between you and the gateway (shared uplink, proxy/VPN, Wi-Fi, an egress limit) — this table cannot tell which side it is on |
| Several agents on one host, drops when two receive at once | They are competing for the same uplink |
| A frame takes longer than the gateway's read deadline, then the drop follows | Heartbeat starvation; a client-side ping_timeout change cannot lengthen the gateway's deadline, so a transfer that slow needs a faster path |
| Frames arrive in a few seconds, drops still happen | Bandwidth is unlikely to be the cause — back to Step 1b, Step 2(a) or Step 4 |
What you can change in the client: if you set ping_timeout to a small value, your client will itself abort whenever a pong is late by that much — including
while a big frame is still arriving. For Python websockets, its own documentation says setting
ping_timeout=None "disables only timeouts. This enables keepalive, to keep idle connections open,
and disables heartbeat, to support large latency spikes", and suggests raising it if traffic spikes
cause unwanted timeouts. That removes your client's own aborts; it does not change the gateway's
read deadline, so it cannot rescue a transfer that is too slow for that.
close 1000/1001 in your log with no drain before it: first check whether your own side
closed the socket — leaving an async with ws_connect(...) block (including via an unhandled
exception), a supervisor restart, a health-check killing the process, Ctrl-C/SIGTERM
(returncode -15). Your agent log usually shows whether your code initiated it
(sent_close_code vs received_close_code, if your client logs them). If it clearly did not,
say so in Step 5 — that is something only the organizers can check on their side.returncode, supervisor logs, dmesg | grep -i -E "killed process|oom".agent_id. A backoff that grows
toward 30 s, or a restart that has to reload a model before it redials, can miss the 30 s window.
Keep the connection logic separate from the model load.If Steps 2–4 point at the path to the gateway (or you can't explain it), send:
JOB_ID, and the UTC+8 times of the failures.failure_reason, result.error).ss -ti / sar output captured during
one.probe_gateway.sh output, ideally from your normal network and from another network (e.g. a
phone hotspot) — a difference between the two separates your LAN/ISP from the platform.Items 3–5 give the organizers something concrete to compare with the platform's own connection records.
reconnect window expired alone; check /health
and whether other things work first.AFaffaan-m/ECC315k3,503 new stars in the last 7 days
Generate flow fields and particle systems with p5.js, using seeded randomness for original algorithmic art.
ANanthropics/skills203k2,822 new stars in the last 7 days
ANanthropics/skills203k2,822 new stars in the last 7 days
HAharry0703/MoneyPrinterTurbo147k1,401 new stars in the last 7 days
SHShubhamsaboo/awesome-llm-apps147k818 new stars in the last 7 days
GAgarrytan/gstack143k524 new stars in the last 7 days