Skip to content

Asks

An ask is an approval or question the agent waits on; while open it keeps the session waiting, and it never expires

The Slack side is in Approvals, questions and plans. An ask’s id is ak_ followed by 12 characters.

kindBodyAnswer
approvalapproval{"decision": "allow" | "deny" | "always", "message"?, "mode"?}
questionquestion.questions{"answers": [{"questionId", "choices", "text"}]}
secretsecretNone: asks.answer returns 400 answer_with_secret

The runner opens approval and question asks only. Body fields: API schema.

Status

The first close wins.

statusClosed by
openNot closed
answeredAn answer, from Slack or the API
dismissedasks.dismiss
declinedA message steered into the turn. answer is {message, messageSeq}; messageSeq is the seq of the message’s message.received event
interruptedAn interrupt, a suspend, or the runner ending

closedBy is the actor and closedAt the time. A message sent with ifBusy: "queue" leaves asks open; see Turns.

Find open asks

SourceWhat it gives
Session objectOpen asks in its asks list
ask.opened eventThe whole ask
asks.get (GET /sessions/{id}/asks/{askId})One ask
asks.list (GET /sessions/{id}/asks)Asks, newest first

asks.list params:

ParamMeaning
statusOne status, several separated by commas, or all. Default open
limit1 to 100. Default 20
cursorThe previous page’s nextCursor. A cursor from a listing with another status is invalid_cursor

Answer

asks.answer (POST /sessions/{id}/asks/{askId}/answer) closes the ask with an answer. Over HTTP the request body is the answer itself. It needs the asks:answer scope, as does asks.dismiss.

{"jsonrpc":"2.0","id":4,"method":"asks.answer","params":{"sessionId":"cs_0123456789abcdef","askId":"ak_0123456789ab","answer":{"decision":"allow"}}}
{"jsonrpc":"2.0","id":5,"method":"asks.answer","params":{"sessionId":"cs_0123456789abcdef","askId":"ak_0123456789ab","answer":{"answers":[{"questionId":"q1","choices":["Postgres"],"text":null}]}}}

The result is the closed ask and the seq of its ask.closed event. The prompt message in Slack is deleted or updated, naming who answered.

Answer fieldRule
decisionRequired on an approval
alwaysOnly when the ask’s approval.alwaysAllows is set
modeOnly on a plan approval (toolName is ExitPlanMode) with allow. Sets the mode after the plan: default, acceptEdits, auto or bypassPermissions
answersRequired on a question, one per question, each with a choice or text
choicesEach is the label of one of the question’s options; more than one only when multiSelect is true
ErrorCause
400 invalid_answerA rule above is broken. field names the field at fault
400 answer_with_secretThe ask’s kind is secret
409 ask_closedThe ask is closed. The error carries the ask. The same answer from the same person returns the ask instead

Dismiss

asks.dismiss (POST /sessions/{id}/asks/{askId}/dismiss) closes an ask with no answer; the agent reads it as a denial. An optional message (up to 2,000 characters) is passed along.