Playgrounds Debug
[MODE:DIALOG] Read-only, idempotent. Tier: brownfield.
Returns the unified Playground diagnostic envelope. Maps to Rails GET /api/playgrounds/:id/debug (Api::PlaygroundsController#debug). Two paths:
refresh:false— read DB-cached diagnostics computed at last refresh (fast, returns immediately).refresh:true(default) — enqueuePlaygroundDebugRequestJob, poll request status until terminal, then return the fresh diagnostics.
When to use
- Anything wrong with a Playground (missing URL, container crashing, stale state).
- First call when investigating any service issue — gives you names/ports/labels in one shot, avoiding manual
docker psgrepping. - Right after
fibe_playgrounds_actionreports failure.
Inputs
| Field | Type | Required | Notes |
|---|---|---|---|
playground_id | number | one of | Numeric ID |
playground_identifier | string | one of | Numeric ID or slug-safe name |
mode | enum | no | summary (default) or full — full includes raw compose / volumes / network details |
refresh | bool | no | Default true. Set false for cached read. |
service | string | no | Restrict diagnostics to one Compose service |
logs_tail | number | no | Include last N log lines per service (clamped to MAX_LOG_TAIL) |
Output (summary, fresh)
{
"playground": {
"id": 42, "name": "...", "status": "running",
"marquee_id": 7, "playspec_id": 13,
"compose_project": "fibe_42",
"urls": [ ... ],
"expires_at": "..."
},
"services": [
{
"name": "web",
"image": "ruby:3.3",
"container_name": "fibe_42_web_1",
"container_status": "running",
"exit_code": null,
"ports": [ { "container":3000, "published":80 } ],
"labels": { "fibe.gg/...": "..." },
"logs": "..." // present when logs_tail set
}
],
"issues": [ { "level":"warn", "message":"..." } ],
"host": { "marquee_root_domain":"...", "docker_version":"..." }
}
mode:"full" adds raw compose YAML, volume mounts, network IPs, env (with secrets redacted).
Async refresh flow
The default refresh:true path:
- SDK calls
GET /api/playgrounds/:id/debug?refresh=true&service=...&logs_tail=.... - Rails enqueues
PlaygroundDebugRequestJob, returnsrequest_id+status_url. - SDK polls
GET /api/playgrounds/:id/debug/:request_iduntil terminal. - Returns the final payload.
Cached read (refresh:false) skips the job and uses PlaygroundDiagnosticsService synchronously.
Gotchas
- The Marquee must be reachable via SSH for
refresh:trueto succeed; if it's down, expectplayground_debugto error. logs_tailis clamped server-side toPlaygroundDiagnosticsService::MAX_LOG_TAIL(currently a few hundred). Usefibe_playgrounds_logsfor larger tails.servicefilter narrows the response but doesn't speed up the refresh meaningfully (Marquee-side debug runs all services anyway).summaryis what 95% of agent flows want. Usefullonly when summary's redacted/elided fields aren't enough.- Cached debug is per-Playground, single-slot — frequent
refresh:falsecalls return identical payloads until someone refreshes.
Recipe
fibe_playgrounds_debug({ playground_id, mode:"summary" })— first.- If a service shows
container_status:"exited"with non-zero exit code →fibe_playgrounds_logs(service:"<name>", tail:200). - If still unclear →
fibe_playgrounds_debug({ ..., mode:"full", service:"<name>", logs_tail:200 }).
Related
fibe_playgrounds_logs— single-service logs.fibe_playgrounds_logs_follow— stream until pattern.fibe_playgrounds_wait— wait for state transitions.fibe-debugskill — broader debugging playbook.