---
title: "Command status + log (offset-polling)"
method: GET
path: "/preview/nodes/{name}/commands/{id}"
tags: ["nodes"]
---

# Command status + log (offset-polling)

`GET /preview/nodes/{name}/commands/{id}`

## Request

- Base URL: `https://autoresearch.sfcompute.com`
- URL: `https://autoresearch.sfcompute.com/preview/nodes/{name}/commands/{id}`
- Auth: HTTP bearer

Status + incremental output of a detached command: {status, exit_code?, output, next_offset, truncated, result?, note?}. `result` is the JSON the command left at $GMN_RESULT_PATH, verbatim (result_error names the honest failure: invalid JSON, or over 32 KiB). `output` is bytes of the log from `offset` (default 0); pass `next_offset` back verbatim to stream; truncated:true means more is available right now. Status checks NEVER wake a stopped node: while the node is stopped only the final tail captured at exit is served - a read below the tail start returns empty output with next_offset jumped forward and a note naming the gap (the full log survives on the disk; wake the node to read it all). Polling this does not keep the node awake or reset its idle grace. A supervised command (restart:"on-failure") also reports {restart, max_restarts, restarts, last_exit} - flapping is visible here without reading logs; status "crash_loop" means the restart budget exhausted on a nonzero exit. `oom_kills` (with a note) means the kernel's OOM killer fired in the node's container during the run - a bare "Killed" in the log plus exit 137 is the container's memory ceiling, not a bug in your script; get_node's `resources` carries the budget. Status "lost" means no exit status was recorded - the container went away before the exit reached us, so there is no exit_code and no result; `note` says what survived (the volume's files and the log, unless the node was lost with its host); on a live node this call also re-reads the command's own exit record from the volume and closes a lost row with it. A run whose verdict you need must reach an exit_code here BEFORE you stop the node. A command that NEVER STARTED (an on_wake boot command whose launch failed or lapsed) has no log at all: `output` is the reason it never ran, and there is no exit_code because nothing ever exited.

## Path parameters

- `name` string, required: Node name (from `list_nodes`).
- `id` string, required: The cmd-... id returned by run_command(detach:true) (or list_commands).

## Query parameters

- `offset` integer, nullable: Byte offset to read from (default 0). Pass the previous response's next_offset back verbatim to stream incrementally.
- `workspace` string

## Response `200`

The capability's JSON result.

- Result: The capability's result: the same object the MCP tool returns as structuredContent. Resources carry an `object` type discriminator and an immutable id; money is integer micro-dollars in `*_usd_micros` fields.
  - `object` string: The resource type, when the result is one resource.

## Other responses

- `400`: Malformed request: bad JSON, a parameter that does not parse, or a value outside its range. Code `invalid`.
- `401`: No bearer token, or one this API cannot verify. Code `unauthenticated`.
- `403`: Authenticated, but the token's scopes or the account's role do not reach this operation. The message names the scope word to request. Code `forbidden`.
- `404`: No such route. Code `not_found`; the body names the OpenAPI document.
- `422`: A well-formed request the platform declined: no such node, a cap reached, a state that forbids the move. The message says which, and what to do instead. Code `refused`.
- `429`: Over this door's per-customer budget. Wait `Retry-After` seconds. Code `rate_limited`.
- `500`: Our fault. Retry; if it persists, quote the request-id. Code `internal`.

---

[API](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api.md) · [All operations](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/revisions/f88dcb70ac6c?raw)
