FSM status transition
Drives the session FSM: `pending → claimed → running → finalizing → completed | failed | stopped` Terminal transitions trigger side effects: cost persistence, fleet quota accounting, Linear `agentActivityCreate`, claim release, inbox archival, issue lock release, and next-pending-work promotion.
AuthorizationBearer <JWT>Short-lived worker runtime JWT minted by the platform. Claims bind the worker, project, organization, registration, and scopes.
id*stringapplication/json- body
workerId*stringstatus*AgentSessionStatusFSM states for an agent session:
pending- queued, waiting for a workerclaimed- worker has claimed but not yet startedrunning- agent actively processingfinalizing- cleanup in progresscompleted- finished successfully (terminal)failed- encountered an error (terminal)stopped- stopped by user (terminal)
"pending""claimed""running""finalizing""completed""failed""stopped"continuationOutcome?stringTyped rework outcome, stored only for completed status posts. Unknown values are ignored.
"no_op""fixed_in_place"providerSessionId?stringworktreePath?stringerror?unknownError context (on failed status).
totalCostUsd?numberinputTokens?integeroutputTokens?integercacheReadTokens?integerCache-read tokens (disjoint from inputTokens).
cacheWriteTokens?integerCache-write tokens (disjoint from inputTokens).
reasoningTokens?integerReasoning tokens (a SUBSET of outputTokens — never added on top).
usageStatus?stringUsage completeness (always re-derived server-side from the token buckets; a runner-sent value is ignored): a zero-token crash reads untracked, not a measured $0.
"tracked""partial""untracked"commitSha?stringHead commit SHA at session end (used for CI gate correlation).
pullRequestUrl?stringPR URL opened during the session (used for CI gate correlation).
manifest?unknownTurn-result manifest, routed through the hook chain on terminal transitions.
Status updated.
application/json- response
updated*booleansession*Full session state object stored in Redis.
curl -X POST 'https://app.rensei.ai/api/sessions/string/status' \ -H 'Content-Type: application/json' \ -d '{ "workerId": "string", "status": "pending"}'{ "updated": true, "session": { "linearSessionId": "string", "trackerSessionId": "string", "issueId": "string", "issueIdentifier": "string", "providerSessionId": "string", "worktreePath": "string", "status": "pending", "createdAt": 0, "updatedAt": 0, "workerId": "string", "queuedAt": 0, "claimedAt": 0, "priority": 0, "promptContext": "string", "organizationId": "string", "workType": "research", "agentId": "string", "projectName": "string", "provider": "string", "totalCostUsd": 0, "inputTokens": 0, "outputTokens": 0, "lastToolName": "string", "lastToolCalledAt": 0, "toolCallCount": 0 }}Read session state
Read session state - Rensei REST API operation reference.
Lightweight step-level heartbeat
Low-overhead heartbeat emitted at each agent step (tool call, turn, etc.) to signal liveness without the cost of a full status update. Updates the session's `lastToolCalledAt` timestamp in Redis. Auth failures and storage errors are swallowed (best-effort: never 5xx the caller).