Rensei docs
API ReferenceWorker Protocol

Poll for queued work

Atomically pops and pre-claims work items from the priority queue (ZPOPMIN). Also returns inbox messages for the worker's active sessions. Workers that receive `preClaimed: true` must NOT make a separate claim call. Runtime-JWT callers also receive `gitCredentials` (short-lived GitHub PAT) and optionally `batchWork` (code-survival scan items, gated on the `code-survival-scan` capability).

GET
/api/workers/{id}/poll

Authorization

headerAuthorizationBearer <JWT>

Short-lived worker runtime JWT minted by the platform. Claims bind the worker, project, organization, registration, and scopes.

Path Parameters

id*string

Worker ID (must match the sub claim of the runtime JWT).

Response Body

Poll result (may have empty work).

application/json
  1. response
work*array<>

Pre-claimed work items. Workers must NOT separately call the claim endpoint.

preClaimed*boolean

True when work is non-empty (all items already claimed server-side).

claimedSessionIds*array<string>
gitCredentials*array<>

Short-lived GitHub PAT credentials for the project's repos.

batchWork?array<>

Code-survival batch scan items (only present for workers with code-survival-scan capability).

kgExtractWork?array<>

Knowledge-graph extraction items (only present for workers with KG_EXTRACT capability and kg_fleet_extraction feature flag enabled).

landingWork?array<>

Merge-queue landing items (only present for workers with LANDING_CAPABILITY and merge_queue_landing flag enabled).

Example Request
curl -X GET 'https://app.rensei.ai/api/workers/string/poll'
Example Response
{  "work": [    {      "sessionId": "string",      "issueId": "string",      "issueIdentifier": "string",      "priority": 0,      "queuedAt": 0,      "prompt": "string",      "providerSessionId": "string",      "workType": "research",      "workTypeRole": "intake",      "sourceSessionId": "string",      "projectName": "string",      "repository": "string",      "ref": "string",      "repositoryDeclaration": {        "protocol": "session-root-v1",        "repositories": [          {            "source": {              "repository": "string",              "ref": "string"            },            "role": "primary",            "authority": "mutable"          }        ]      },      "repositoryDeclarationNotDelivered": {        "reason": "harness_does_not_attest_session_root_v1",        "extraRepositories": 0      },      "gitIdentity": {        "name": "string",        "email": "string",        "committerName": "string",        "committerEmail": "string"      },      "gitTrailers": [        "string"      ],      "kits": {}    }  ],  "preClaimed": true,  "claimedSessionIds": [    "string"  ],  "gitCredentials": [    {      "token": "string",      "cloneUrl": "string",      "expiresAt": "2019-08-24T14:15:22Z"    }  ],  "batchWork": [    {}  ],  "kgExtractWork": [    {}  ],  "landingWork": [    {}  ]}