跳到正文
FunCoding

challenge-poll-result

Use to track a Simulation Challenge job's progress — list jobs, watch a job's status until terminal, fetch its per-task scores, or pull execution logs when it failed. Read-only; safe to run without confirmation.

Star
1,857
分类
其他
最近提交
2026年11月24日

source/geniesim_benchmark/skills/robocoliseum/challenge-poll-result/SKILL.md

在 GitHub 上查看

challenge-poll-result — Track job status, scores, and logs

All endpoints here are read-only — run them directly and report findings to the user.

Preconditions

  • CHALLENGE_TOKEN set (else → challenge-login).
  • JOB_ID set (else → challenge-submit-job, or list jobs first to find one).

Every Bash call should start with:

[ -f ~/.simubotix-challenge.env ] && . ~/.simubotix-challenge.env

(See README "State file" — AI assistants spawn each command in a new subshell, so file-backed state is the only reliable handoff.)

Two job identifiers — do not mix them up

VariableShapeUsed for
JOB_IDinteger (e.g. 42), from the submit response's .idevery HTTP path here: /job/{JOB_ID}/result, /log, /episodes/videos
JOB_UUIDUUIDv4 string, from the submit response's .uuidonly the WebSocket tunnel dial (challenge-run-agent)

The path segment is parsed as an unsigned integer. Passing the UUID returns 400 {"status":"error","error":"invalid job_id: <uuid>"} — under curl -fsS that surfaces only as exit code 22, which reads like a server fault. If a call fails, check you used the numeric id first.

Which endpoint answers which question

You want to knowCallRead
Is it finished? Which state? How far along?GET /api/challenge/jobsdetailed_status, progress, score on your job's item
Per-task / per-step scoresGET /api/challenge/job/{JOB_ID}/resulttasks, total
Why did it fail?GET /api/challenge/job/{JOB_ID}/logfailure_reason, result

Status is on the job list; /result is the scores endpoint and deliberately has no status field. Don't tell the user "the API doesn't expose status" — it does, just not on /result. There is no single-job status endpoint, so fetch the list and pick your job by id (below).

[ -f ~/.simubotix-challenge.env ] && . ~/.simubotix-challenge.env
curl -fsS "$BASE_URL/api/challenge/jobs?season=${JOB_SEASON:-2}&page=1&per-page=20" \
  -H "Authorization: Bearer $CHALLENGE_TOKEN" | jq

The list is per season. season=2 (default when omitted) returns only Season II jobs; season=1 returns only Season I jobs. The two seasons score differently, so they are never mixed in one list. JOB_SEASON is saved by challenge-submit-job Step 4; a Season II job polled without season=2 is simply not in the list. Any other value → 400 invalid season: <v> (want 1 or 2).

Query param is per-page with a hyphen. The server reads per-page; per_page is silently ignored and you get the default page size of 20. The response echoes it back as per_page (underscore) — the asymmetry is real, don't "fix" it in either direction.

Response envelope:

{ "items": [ … ], "total": 7, "page": 1, "per_page": 20, "total_pages": 1 }

Each item, with the fields that matter for polling:

{
  "id": 42,
  "uuid": "3f7a18c2-8e1d-4bd9-9a42-9a14c0b7a7b1",
  "name": "challenge_test",
  "model_name": "test",
  "board": "instruction",
  "model_type": "policy",
  "status": 1,
  "detailed_status": "evaluating",
  "progress": { "done": 3, "total": 12 },
  "score": 0,
  "time_cost": 0,
  "created_at": "…",
  "list_on_leaderboard": true
}

Season II jobs ("board": "v2") additionally carry the review state:

{
  "board": "v2",
  "model_type": "agent",
  "review_status": "rejected",
  "review_rejected_reason": "…",
  "boards": [
    {"board": "finemanip", "score": 61.2},
    {"board": "crsemb", "score": 48.0},
    {"board": "wbc", "score": 55.5},
    {"board": "dexmanip", "score": 40.1}
  ],
  "paper_link": ""
}
  • model_type: the model type (policy / agent) in the submitter's account profile; empty if the profile has none.
  • review_status: empty = not submitted for review, pending, approved (listed), rejected (see review_rejected_reason; can be re-submitted via challenge-submit-job Step 6). A completed Season II job is on the leaderboard only once approved.
  • boards: the four sub-board scores of this job, always in the order finemanip / crsemb / wbc / dexmanip. Computed live from all tasks, so it moves while the job is running; a sub-board with no finished task shows 0.
  • paper_link: for Season II jobs, the paper link the organizers attached when approving the result; empty unless review_status is approved.

Other query params: model_name (fuzzy match), order / sort-by (col:dir, comma-separated). There is no id filter — select client-side with jq.

status is an integer, not a string

statusNameMeaning
0ReadyCreated, nothing dispatched yet
1RunningAt least one case dispatched
2SucceedAll cases landed successfully
3StoppedStopped by user or system
4FailedA case exhausted its retries → the whole job is dead
5WaitingForStopStop requested, teardown in flight

Do not compare it against "Finished" / "Pending" / "Cancelled" — those strings exist nowhere in this API.

detailed_status is the string you should actually branch on

detailed_statusMeaningNext action
pendingNo agent has ever connected for this jobLaunch agents (challenge-run-agent). Cases sit in queue until one is online.
queuedAn agent tunnel is live (connected, warming up, or idle) but no case is executing yet — usually waiting for a free GPU cluster-wideKeep the agents alive and keep polling. Nothing to fix.
evaluatingAt least one case is executingKeep polling.
inference_disconnectedAn agent connected earlier but none is live nowCheck the agent processes; see challenge-troubleshoot.
completedTerminal — all cases landed, or job reached Succeed/StoppedStop polling. Fetch /result, then suggest challenge-ranking.
failedTerminal — job is deadStop polling. Pull /log and route to challenge-troubleshoot.

Terminal set is exactly {completed, failed}. failed is checked before the "all cases done" rule, so a job whose cases all landed but which was judged failed still reports failed — trust detailed_status, not progress.

progress is case-level X/N. On a failed job it freezes at the real count (aborted in-flight cases count as done; never-started ones don't), so done < total on a failed job is expected, not a bug.

Polling loop

Poll every 2–5 seconds until detailed_status is terminal. Don't poll faster — the platform doesn't change state that quickly and you'll burn rate budget.

while true; do
  [ -f ~/.simubotix-challenge.env ] && . ~/.simubotix-challenge.env
  JOB=$(curl -fsS "$BASE_URL/api/challenge/jobs?season=${JOB_SEASON:-2}&page=1&per-page=100" \
    -H "Authorization: Bearer $CHALLENGE_TOKEN" \
    | jq -c --argjson id "$JOB_ID" '.items[] | select(.id == $id)')
  if [ -z "$JOB" ]; then
    echo "job $JOB_ID not found on page 1 — check JOB_SEASON (Season I needs season=1), widen per-page, or check the id"; break
  fi
  DS=$(echo "$JOB" | jq -r '.detailed_status // "?"')
  PROG=$(echo "$JOB" | jq -r '"\(.progress.done)/\(.progress.total)"')
  SCORE=$(echo "$JOB" | jq -r '.score')
  printf "detailed_status=%-22s progress=%-8s score=%s\n" "$DS" "$PROG" "$SCORE"
  case "$DS" in
    completed|failed) break ;;
  esac
  sleep 3
done

--argjson (not --arg) matters: .id is a JSON number, and select(.id == "42") never matches a string.

If the job might be off page 1 (many submissions), either raise per-page or add &sort-by=id:desc.

When you call this from an AI assistant, do not loop indefinitely without checking in — every ~30 seconds report progress (detailed_status, progress, score) so the user can interrupt if something looks wrong (e.g. stuck at pending because no agent is connected).

Fetch a job's scores

curl -fsS "$BASE_URL/api/challenge/job/$JOB_ID/result" \
  -H "Authorization: Bearer $CHALLENGE_TOKEN" | jq

Exact response shape — two keys (tasks, total); status is on the job list, not here:

{
  "tasks": {
    "pick_block_color": { "score": [95.0, 92.0, 88.0], "total": 91.67 },
    "place_on_plate":   { "score": [100.0, 100.0, 98.0], "total": 99.33 }
  },
  "total": 191.0
}
  • Keys of tasks are task names (EmuTask.Name), which vary by board — don't hard-code them.
  • tasks[…].score is a per-step average across the task's latest episodes (element i is the mean of step i), not a per-case score list.
  • tasks[…].total is the mean of those episodes' average scores.
  • Top-level total is the job's stored score. It is 0 until scoring lands, so a 0 here on a still-running job means "not scored yet", not "scored zero".
  • For a Season II job, total is the average of the four sub-board scores, not of all task totals — don't recompute it from tasks. The per-sub-board split is on the Season II leaderboard detail (challenge-ranking).
  • A job with no episodes yet returns {"tasks":{},"total":0} — that is a success, not an error.

/result answers "what are the scores", not "is it done", so never use it to decide whether to keep polling. Check detailed_status on the job list first, and call /result once it reaches completed.

Fetch failed-job log

Only meaningful when detailed_status == "failed":

curl -fsS "$BASE_URL/api/challenge/job/$JOB_ID/log" \
  -H "Authorization: Bearer $CHALLENGE_TOKEN" | jq

Returns the newest failed case's EmuCaseExecLog:

{
  "id": 913,
  "job_id": 42,
  "task_id": 88,
  "case_id": 401,
  "run_instance_id": 7,
  "worker_id": 3,
  "status": 1,
  "failure_reason": 1,
  "result": { "stdout": "https://…presigned…" },
  "created_at": "…"
}
  • If the job has no failed case log, the endpoint errors (HTTP 500, body {"status":"error","error":"failed to get case exec log…"}). Check detailed_status first rather than probing.

  • status: 0 success, 1 failed, 2 running. This endpoint only serves 1.

  • failure_reason is the platform's own classification — read it before reading any log text:

    ValueMeaning
    0none
    1execution error (your code or the sim crashed)
    2submit error
    3timeout
    4terminated by signal
    5startup timeout — the pod never reported started
    6stale placement — the pod started then hung
    7manual reap by an operator
    8job already dead; this case was aborted as an in-flight sibling
    9tunnel lost — your agent disconnected and did not return within the 30 s reconnect window

    5/6/7/8 are platform-side teardowns, not your bug — for 8 in particular the real root cause is a different case, so don't debug this log. 1/3/4 point at your inference code or the case itself. 9 is usually on your side: the agent dropped the tunnel (process exit, OOM, or a long inference call starving the heartbeat). Read the sub-reason in result.error: reconnect window expired means the agent was gone for more than 30 s; liveness probe: last_seen stale means the platform's database-side check saw no sign of life from the tunnel. A (last disconnect: …) suffix, when present, says how it dropped.

  • result is a free-form JSON map written by the worker. There is no guaranteed exit_code or stderr key — inspect what's actually there (jq '.result | keys') instead of assuming.

  • result.stdout is usually a URL, not the log text. When the worker archived stdout to object storage, the platform rewrites it into a 1-hour HTTP presigned link, so you must fetch it separately:

    LOG=$(curl -fsS "$BASE_URL/api/challenge/job/$JOB_ID/log" \
      -H "Authorization: Bearer $CHALLENGE_TOKEN")
    echo "$LOG" | jq '{failure_reason, status, case_id, run_instance_id}'
    URL=$(echo "$LOG" | jq -r '.result.stdout // empty')
    case "$URL" in
      http*) curl -fsS "$URL" | tail -100 ;;
      error) echo "platform failed to sign the stdout URL — report to organizers" ;;
      *)     echo "$LOG" | jq -r '.result' ;;
    esac
    

    The literal string "error" means presigning failed platform-side. Platform-generated logs (e.g. a manual reap) put a plain message under result.error instead.

When the log is large, don't dump everything. Surface the load-bearing tail:

  1. failure_reason and status (always include).
  2. The last Traceback (most recent call last): block, if present, in full — that's the actual failure.
  3. The last ~20 lines around it for context.

A common failure pattern: a Traceback in the observation-decode / handler path during a case that started with an empty frame is the warmup empty-frame bug — see challenge-troubleshoot row #11. It can surface as failed mid-job, not only as "stuck in WARMUP".

Episode videos (optional)

curl -fsS "$BASE_URL/api/challenge/job/$JOB_ID/episodes/videos" \
  -H "Authorization: Bearer $CHALLENGE_TOKEN" | jq

Returns {job_id, status, expires_in, episodes:[{task_name, episode_uuid, task_id, case_id, score, head}]}. Here status is a video-availability code, unrelated to job status: 0 normal, 1 past the 72-hour retention window (head is an empty string), 2 evaluation didn't finish successfully. Links expire after expires_in seconds (8h).

Hand-off

  • completed → fetch /result, then suggest challenge-ranking to see where the score lands. For a Season II job, offer to submit it for review (challenge-submit-job Step 6; ask first).
  • failed → pull /log, read failure_reason first, then challenge-troubleshoot.
  • pending / inference_disconnected for more than a few minutes → challenge-troubleshoot (no agent connected, or all dropped past the gateway's 30 s reconnect window).
  • queued → nothing is wrong; an agent is attached but no case is running yet (usually no free GPU). Keep agents online and wait.

相似的 Skill

software-factory

MAmattpocock/skills336k近 7 天新增 4,217 个 star

claude-handoff

MAmattpocock/skills336k近 7 天新增 4,217 个 star

agent-payment-x402

AFaffaan-m/ECC314k近 7 天新增 3,503 个 star

agent-self-evaluation

AFaffaan-m/ECC314k近 7 天新增 3,503 个 star

bengali-nlp

AFaffaan-m/ECC314k近 7 天新增 3,503 个 star

ponytail-gain

DIDietrichGebert/ponytail202k近 7 天新增 4,226 个 star