diff --git a/docs/reference/crew-api/owner-consent.md b/docs/reference/crew-api/owner-consent.md index 5b8fb1f84fdc..c6a29b6d90c7 100644 --- a/docs/reference/crew-api/owner-consent.md +++ b/docs/reference/crew-api/owner-consent.md @@ -63,7 +63,7 @@ Read one grant request. | Stability | stable | | Callers the API defines | The owner, with the owner's own sign-in. | -Returns one grant request by its id, answered or not, so the owner can see how it was answered and which grant it led to (amendment, proposed). The request stays readable until it and its authorization code have expired, or for as long as the grant it led to exists; after that it is 404. The host owner's credential is required; Shared Crew teammates and app tokens receive 403 owner_only. +Returns one grant request by its id, answered or not, so the owner can see how it was answered and which grant it led to (amendment, accepted by a maintainer on 2026-12-02). The request stays readable until it and its authorization code have expired, or for as long as the grant it led to exists; after that it is 404. The host owner's credential is required; Shared Crew teammates and app tokens receive 403 owner_only. Path parameters: @@ -104,11 +104,11 @@ Response body fields (`application/json`), [GrantRequest](schemas.md#grantreques | `requested_bots` | array of string | no | The Bot names the app sends as the repeated bots query parameter of GET /oauth/authorize, one Bot per occurrence, without splitting; empty when omitted. The app is expected to send the exact model id from GET /v1/models. Names follow kiro_crew.members.is_dispatchable_member_name with the MEMBER_NAME_MAX_CHARS length limit; duplicates are refused. Asking checks format, never existence. Malformed bots gives 400 invalid_request even with an invalid scope. Asking again requires the same bots values in the same order. MAX_REQUESTED_BOTS is the chosen bound for one request and one decision, set equal to crew_teams.TEAM_MEMBERS_MAX (500), the largest Bot list the product keeps elsewhere. The request must fit aiohttp's 8190-byte request line. The decision body must fit 4 KiB (_BODY_MAX); a bots list that does not fit gives 400 invalid_request, and the owner gives a shorter list. | | `created_at` | [Timestamp](schemas.md#timestamp) | yes | Unix seconds. | | `expires_at` | [Timestamp](schemas.md#timestamp) | yes | Unix seconds. | -| `decided_at` | integer or null | no | When the owner answered (amendment, proposed) | -| `decided_by` | object or null | no | Who answered: the kind of caller, never a token (amendment, proposed) | -| `granted_scopes` | array of string | no | Only when approved; what the owner gave, which may be fewer than requested (amendment, proposed) | +| `decided_at` | integer or null | no | When the owner answered (amendment, accepted by a maintainer on 2026-12-02) | +| `decided_by` | object or null | no | Who answered: the kind of caller, never a token (amendment, accepted by a maintainer on 2026-12-02) | +| `granted_scopes` | array of string | no | Only when approved; what the owner gave, which may be fewer than requested (amendment, accepted by a maintainer on 2026-12-02) | | `granted_bots` | array of string | no | Only when approved; the Bot names the owner gave, which may be none. They become the grant's bots with mode selected. Names follow kiro_crew.members.is_dispatchable_member_name and MEMBER_NAME_MAX_CHARS, with no duplicates. MAX_REQUESTED_BOTS is the chosen bound for one request and one decision, set equal to crew_teams.TEAM_MEMBERS_MAX (500), the largest Bot list the product keeps elsewhere. The decision body must fit 4 KiB (_BODY_MAX); a bots list that does not fit gives 400 invalid_request, and the owner gives a shorter list. The decision checks expiry, pending status and the requested subset before reading the roster. The grants list returns the owner's recorded selection, and GET /v1/crew/bots lists the app only Bots from it. | -| `grant_id` | string or null | no | The grant this request led to, set once the app redeemed its code (amendment, proposed) | +| `grant_id` | string or null | no | The grant this request led to, set once the app redeemed its code (amendment, accepted by a maintainer on 2026-12-02) | Errors. The response body is [Error](schemas.md#error); its `error.code` field holds the code. @@ -180,11 +180,11 @@ Response body fields (`application/json`), [GrantRequest](schemas.md#grantreques | `requested_bots` | array of string | no | The Bot names the app sends as the repeated bots query parameter of GET /oauth/authorize, one Bot per occurrence, without splitting; empty when omitted. The app is expected to send the exact model id from GET /v1/models. Names follow kiro_crew.members.is_dispatchable_member_name with the MEMBER_NAME_MAX_CHARS length limit; duplicates are refused. Asking checks format, never existence. Malformed bots gives 400 invalid_request even with an invalid scope. Asking again requires the same bots values in the same order. MAX_REQUESTED_BOTS is the chosen bound for one request and one decision, set equal to crew_teams.TEAM_MEMBERS_MAX (500), the largest Bot list the product keeps elsewhere. The request must fit aiohttp's 8190-byte request line. The decision body must fit 4 KiB (_BODY_MAX); a bots list that does not fit gives 400 invalid_request, and the owner gives a shorter list. | | `created_at` | [Timestamp](schemas.md#timestamp) | yes | Unix seconds. | | `expires_at` | [Timestamp](schemas.md#timestamp) | yes | Unix seconds. | -| `decided_at` | integer or null | no | When the owner answered (amendment, proposed) | -| `decided_by` | object or null | no | Who answered: the kind of caller, never a token (amendment, proposed) | -| `granted_scopes` | array of string | no | Only when approved; what the owner gave, which may be fewer than requested (amendment, proposed) | +| `decided_at` | integer or null | no | When the owner answered (amendment, accepted by a maintainer on 2026-12-02) | +| `decided_by` | object or null | no | Who answered: the kind of caller, never a token (amendment, accepted by a maintainer on 2026-12-02) | +| `granted_scopes` | array of string | no | Only when approved; what the owner gave, which may be fewer than requested (amendment, accepted by a maintainer on 2026-12-02) | | `granted_bots` | array of string | no | Only when approved; the Bot names the owner gave, which may be none. They become the grant's bots with mode selected. Names follow kiro_crew.members.is_dispatchable_member_name and MEMBER_NAME_MAX_CHARS, with no duplicates. MAX_REQUESTED_BOTS is the chosen bound for one request and one decision, set equal to crew_teams.TEAM_MEMBERS_MAX (500), the largest Bot list the product keeps elsewhere. The decision body must fit 4 KiB (_BODY_MAX); a bots list that does not fit gives 400 invalid_request, and the owner gives a shorter list. The decision checks expiry, pending status and the requested subset before reading the roster. The grants list returns the owner's recorded selection, and GET /v1/crew/bots lists the app only Bots from it. | -| `grant_id` | string or null | no | The grant this request led to, set once the app redeemed its code (amendment, proposed) | +| `grant_id` | string or null | no | The grant this request led to, set once the app redeemed its code (amendment, accepted by a maintainer on 2026-12-02) | Errors. The response body is [Error](schemas.md#error); its `error.code` field holds the code. diff --git a/docs/reference/crew-api/owner-grants.md b/docs/reference/crew-api/owner-grants.md index 2d9b3fb48938..8cd0f69fdfc5 100644 --- a/docs/reference/crew-api/owner-grants.md +++ b/docs/reference/crew-api/owner-grants.md @@ -159,7 +159,7 @@ Revoke a grant. | Stability | stable | | Callers the API defines | The owner, with the owner's own sign-in. | -Takes effect locally first (status=revoked), then the issuer of the grant is told over the control channel. Open streams receive grant.revoked and are closed. For a grant made through local authorization (amendment, proposed), the host owner's credential is required and Shared Crew teammates and app tokens receive 403 owner_only; every access and refresh token under the grant is refused from the next request; a second call answers the same 200 until the grant's own expiry, then 404. Such a grant has no outside issuer to tell. +Takes effect locally first (status=revoked), then the issuer of the grant is told over the control channel. Open streams receive grant.revoked and are closed. For a grant made through local authorization (amendment, accepted by a maintainer on 2026-12-02), the host owner's credential is required and Shared Crew teammates and app tokens receive 403 owner_only; every access and refresh token under the grant is refused from the next request; a second call answers the same 200 until the grant's own expiry, then 404. Such a grant has no outside issuer to tell. Path parameters: diff --git a/docs/reference/crew-api/public-conversations.md b/docs/reference/crew-api/public-conversations.md index 441ece1070b5..20a0a6a1106d 100644 --- a/docs/reference/crew-api/public-conversations.md +++ b/docs/reference/crew-api/public-conversations.md @@ -19,7 +19,7 @@ Not served yet: - Response headers: `X-Crew-Quota-Limit`, `X-Crew-Quota-Remaining`, `X-Crew-Quota-Reset`. -OpenAI has no such endpoint; Crew adds it. A delegated credential lists only conversations opened under its grant. Proposed amendments, 2026-11-26, waiting for a maintainer's sign-off: (1) The list holds every conversation of the caller that is still kept, the ones a turn started for itself included (a POST /v1/responses that named no conversation). (2) The order is by `created_at`, then by id; `desc`, the default, is newest first. A conversation keeps its place while turns run in it. (3) `after` is a conversation id of the caller's own list; any other value is 400 invalid_request, whether or not a conversation of that id exists. A `limit` or `order` outside what the parameters allow is 400 invalid_request too; the 400 response is part of this amendment. +OpenAI has no such endpoint; Crew adds it. A delegated credential lists only conversations opened under its grant. Amendments, 2026-11-26, accepted by a maintainer on 2026-12-02: (1) The list holds every conversation of the caller that is still kept, the ones a turn started for itself included (a POST /v1/responses that named no conversation). (2) The order is by `created_at`, then by id; `desc`, the default, is newest first. A conversation keeps its place while turns run in it. (3) `after` is a conversation id of the caller's own list; any other value is 400 invalid_request, whether or not a conversation of that id exists. A `limit` or `order` outside what the parameters allow is 400 invalid_request too; the 400 response is part of this amendment. Query parameters: @@ -85,7 +85,7 @@ Not served yet: - Request headers: `Idempotency-Key`. - Response headers: `X-Crew-Quota-Limit`, `X-Crew-Quota-Remaining`, `X-Crew-Quota-Reset`. -The conversation is tagged with the grant id. The external id is conv_, never the internal session key. Proposed amendments, 2026-11-26, waiting for a maintainer's sign-off: (1) A conversation is kept 30 days after its latest turn ended, or 30 days after it was made while it holds no turn; 30 days is the retention a stored response already has. Admitting a continuation checks that it has not expired, then renews retention for the conversation and its listed turns before reading history; completion renews retention again. This keeps them through a turn shorter than the 30-day retention period. After retention expires, reading it or naming it in a turn is 404 not_found, and so is reading a turn that ran in it: the stored responses of a conversation's turns are kept exactly as long as the conversation. (2) A conversation is a record of its turns, not a dashboard chat: it is not shown in the dashboard, and a dashboard chat has no conv_ id. +The conversation is tagged with the grant id. The external id is conv_, never the internal session key. Amendments, 2026-11-26, accepted by a maintainer on 2026-12-02: (1) A conversation is kept 30 days after its latest turn ended, or 30 days after it was made while it holds no turn; 30 days is the retention a stored response already has. Admitting a continuation checks that it has not expired, then renews retention for the conversation and its listed turns before reading history; completion renews retention again. This keeps them through a turn shorter than the 30-day retention period. After retention expires, reading it or naming it in a turn is 404 not_found, and so is reading a turn that ran in it: the stored responses of a conversation's turns are kept exactly as long as the conversation. (2) A conversation is a record of its turns, not a dashboard chat: it is not shown in the dashboard, and a dashboard chat has no conv_ id. Request headers: @@ -150,7 +150,7 @@ Not served yet: - Response headers: `X-Crew-Quota-Limit`, `X-Crew-Quota-Remaining`, `X-Crew-Quota-Reset`. -Proposed amendments, 2026-11-26, waiting for a maintainer's sign-off: (1) `crew.title` is null: a conversation is given no title. `crew.model` is the model its latest turn named, and is absent before the first turn ends. `crew.status` is running while a turn runs in the conversation and idle otherwise; needs_approval is not reported yet, and a turn that waits for an approval reads running. `crew.latest_seq` is absent. (2) A conversation whose retention is over, and an id that names none, are the same 404 not_found. +Amendments, 2026-11-26, accepted by a maintainer on 2026-12-02: (1) `crew.title` is null: a conversation is given no title. `crew.model` is the model its latest turn named, and is absent before the first turn ends. `crew.status` is running while a turn runs in the conversation and idle otherwise; needs_approval is not reported yet, and a turn that waits for an approval reads running. `crew.latest_seq` is absent. (2) A conversation whose retention is over, and an id that names none, are the same 404 not_found. Path parameters: @@ -214,7 +214,7 @@ Not served yet: - Request headers: `Idempotency-Key`. - Response headers: `X-Crew-Quota-Limit`, `X-Crew-Quota-Remaining`, `X-Crew-Quota-Reset`. -Proposed amendments, 2026-11-26, waiting for a maintainer's sign-off: (1) `metadata` replaces the conversation's metadata whole: a pair the request does not send is removed, and `{}` removes them all. (2) An update is not a turn: it does not renew the conversation's retention, which still counts from its latest turn. (3) A conversation can be updated while a turn runs in it. +Amendments, 2026-11-26, accepted by a maintainer on 2026-12-02: (1) `metadata` replaces the conversation's metadata whole: a pair the request does not send is removed, and `{}` removes them all. (2) An update is not a turn: it does not renew the conversation's retention, which still counts from its latest turn. (3) A conversation can be updated while a turn runs in it. Path parameters: @@ -285,7 +285,7 @@ Not served yet: - Response headers: `X-Crew-Quota-Limit`, `X-Crew-Quota-Remaining`, `X-Crew-Quota-Reset`. -A delegated credential can delete only conversations opened under its grant; others get 404. 409 response_in_progress while a turn is running. Proposed amendments, 2026-11-26, waiting for a maintainer's sign-off: (1) Deleting a conversation deletes the stored responses of the turns that ran in it. Afterwards the conversation, each of those responses and their input items read 404 not_found, and a turn that names the conversation or one of those responses is 404 not_found. (2) A turn asked for in the conversation while the delete is in progress is 409 response_in_progress. +A delegated credential can delete only conversations opened under its grant; others get 404. 409 response_in_progress while a turn is running. Amendments, 2026-11-26, accepted by a maintainer on 2026-12-02: (1) Deleting a conversation deletes the stored responses of the turns that ran in it. Afterwards the conversation, each of those responses and their input items read 404 not_found, and a turn that names the conversation or one of those responses is 404 not_found. (2) A turn asked for in the conversation while the delete is in progress is 409 response_in_progress. Path parameters: @@ -347,7 +347,7 @@ Not served yet: - Response headers: `X-Crew-Quota-Limit`, `X-Crew-Quota-Remaining`, `X-Crew-Quota-Reset`. -Proposed amendments, 2026-11-26, waiting for a maintainer's sign-off: (1) The history is the conversation's stored turns in the order they ran: for each turn its input items, then its reply. `asc` is that order and `desc`, the default, is its reverse. The texts are the stored ones, which are redacted. (2) A turn that failed, was cancelled or was cut short is listed too, and each of its items has `status: incomplete`. (3) A turn still running is not listed until it ends. (4) Every item is a `message`: tool call and approval items are not served yet. (5) `after` is an item id of this history; any other value is 400 invalid_request, as is a `limit` or `order` outside what the parameters allow; the 400 response is part of this amendment. +Amendments, 2026-11-26, accepted by a maintainer on 2026-12-02: (1) The history is the conversation's stored turns in the order they ran: for each turn its input items, then its reply. `asc` is that order and `desc`, the default, is its reverse. The texts are the stored ones, which are redacted. (2) A turn that failed, was cancelled or was cut short is listed too, and each of its items has `status: incomplete`. (3) A turn still running is not listed until it ends. (4) Every item is a `message`: tool call and approval items are not served yet. (5) `after` is an item id of this history; any other value is 400 invalid_request, as is a `limit` or `order` outside what the parameters allow; the 400 response is part of this amendment. Path parameters: diff --git a/docs/reference/crew-api/public-events.md b/docs/reference/crew-api/public-events.md index 07a65c2699f4..ecf0eda98826 100644 --- a/docs/reference/crew-api/public-events.md +++ b/docs/reference/crew-api/public-events.md @@ -20,7 +20,7 @@ Not served yet: - Request headers: `Last-Event-ID`. - Response headers: `X-Crew-Quota-Limit`, `X-Crew-Quota-Remaining`, `X-Crew-Quota-Reset`. -Filtered by the scopes held: conversations:read receives events of this grant's conversations; instance:read receives instance-level notices sent to this grant that belong to no conversation; bots:wake receives the Bot events of the turns this grant woke. A credential receives each class it holds a scope for; with none of them, 403 insufficient_scope. With Accept: text/event-stream the answer is SSE: each message's id: is the seq and event: is the type, and a comment line every 15 seconds keeps an idle connection alive. Otherwise the answer is paged JSON. An event is stored before it is sent; a slow client is disconnected instead of losing events. One user, one crew and one grant may hold at most 10 concurrent streams in total, and refreshing the access token does not reset the count; the whole crew also has a ceiling, crew_api.max_event_streams (configurable, default 100). Past either, 429 concurrency_limit. Retention: stored responses (with the stream events used to resume), the event index, resolved approvals and uploaded files are all kept 30 days by default; the owner can set `crew_api.retention_days` in the crew settings to 1 to 365 days. Deleting a conversation deletes its responses and events. When since is older than the oldest retained event, 410 resync_required with oldest_seq and latest_seq in the body. The instance stream is numbered separately for each grant. Served so far, to the machine owner: the conversation stream as paged JSON, with `since`, `limit` and `wait`, and the events turn.started, message.created, approval.requested, approval.decided and turn.completed. Not served yet: the instance stream (a request with no `conversation`) and the SSE form (`Accept: text/event-stream`) are 422 capability_unavailable; the `bot` parameter is not read; the other event types are not sent; the event retention setting and the ceilings on concurrent streams are not built. Proposed amendments, 2026-11-27, waiting for a maintainer's sign-off: (1) A conversation's `seq` counts the events the gateway wrote for that conversation, from 1, whichever engine session each turn ran on. (2) A conversation's events are kept as long as the conversation, less the oldest ones a full stream drops (5), and deleted with it; a conversation made before the gateway served this operation has no earlier events. (3) message.created is sent when its turn ends, for each item of the turn that the history then lists, because a running turn is not in the history. (4) approval.requested and approval.decided are sent for a tool approval that a turn `POST /v1/responses` runs in the conversation waits on, not for one a background run asks for. approval.requested carries `approval_id` and no `tool` or `reason`: the gateway keeps neither on disk, and an event is stored before it is sent. It is sent once the approval is stored, so the Owner approval routes read the same id; an approval that cannot be stored is not announced and leaves the stream broken, as in (5). approval.decided carries `approval_id`, `state` and, when `state` is expired, `expired_reason`, as the approval reads them: a Stop pressed while it waited reads denied, a turn cancelled while it waited reads expired with timeout, turn_cancelled is never sent, and there is no `decided_by`. It is sent once the ending of the approval is stored; an ending that cannot be stored is not announced and leaves the stream broken, as in (5). No approval.decided is sent after its turn's turn.completed, nor for an approval the gateway's stop cut, which also reads expired with reason gateway_restart after the restart. (5) An event that cannot be stored never changes its turn. The stream is then broken: every request that names `since` is 410 resync_required, with the newest `seq` that is stored as `latest_seq`, until the stream can be read and written whole again. The gateway then stores a gap in the stream, numbered one above its newest `seq`, and a `since` below a gap is 410 resync_required; no number is given to a gap from memory. A stream that cannot be read is 503 instance_unavailable. A stream file that cannot be believed is replaced by one gap above the highest `seq` it names, wherever in the file. A gateway that stops while a turn of a conversation is running leaves that stream broken for the gateway that starts next, because the end of the turn was not stored. When no note that a stream is broken can be stored, it is held in memory and a gateway restart forgets it. A stream that has reached its size limit drops its oldest events to store a new one, and a `since` that would pass over a dropped event is 410 resync_required, with the oldest kept `seq` as `oldest_seq`; a `since` of the newest dropped `seq` passes over no dropped event. (6) A `since` past the newest `seq` is 410 resync_required. (7) A `since`, `limit` or `wait` outside what the parameters allow is 400 invalid_request; the 400 and 422 responses are part of this amendment. (8) At most 10 requests wait (`wait`) at once, the number this operation proposes for one user's streams; one more is 429 concurrency_limit with `limit: event_streams`. +Filtered by the scopes held: conversations:read receives events of this grant's conversations; instance:read receives instance-level notices sent to this grant that belong to no conversation; bots:wake receives the Bot events of the turns this grant woke. A credential receives each class it holds a scope for; with none of them, 403 insufficient_scope. With Accept: text/event-stream the answer is SSE: each message's id: is the seq and event: is the type, and a comment line every 15 seconds keeps an idle connection alive. Otherwise the answer is paged JSON. An event is stored before it is sent; a slow client is disconnected instead of losing events. One user, one crew and one grant may hold at most 10 concurrent streams in total, and refreshing the access token does not reset the count; the whole crew also has a ceiling, crew_api.max_event_streams (configurable, default 100). Past either, 429 concurrency_limit. Retention: stored responses (with the stream events used to resume), the event index, resolved approvals and uploaded files are all kept 30 days by default; the owner can set `crew_api.retention_days` in the crew settings to 1 to 365 days. Deleting a conversation deletes its responses and events. When since is older than the oldest retained event, 410 resync_required with oldest_seq and latest_seq in the body. The instance stream is numbered separately for each grant. Served so far, to the machine owner: the conversation stream as paged JSON, with `since`, `limit` and `wait`, and the events turn.started, message.created, approval.requested, approval.decided and turn.completed. Not served yet: the instance stream (a request with no `conversation`) and the SSE form (`Accept: text/event-stream`) are 422 capability_unavailable; the `bot` parameter is not read; the other event types are not sent; the event retention setting and the ceilings on concurrent streams are not built. Amendments, 2026-11-27, accepted by a maintainer on 2026-12-02, except item (4), which stays proposed: (1) A conversation's `seq` counts the events the gateway wrote for that conversation, from 1, whichever engine session each turn ran on. (2) A conversation's events are kept as long as the conversation, less the oldest ones a full stream drops (5), and deleted with it; a conversation made before the gateway served this operation has no earlier events. (3) message.created is sent when its turn ends, for each item of the turn that the history then lists, because a running turn is not in the history. (4) approval.requested and approval.decided are sent for a tool approval that a turn `POST /v1/responses` runs in the conversation waits on, not for one a background run asks for. approval.requested carries `approval_id` and no `tool` or `reason`: the gateway keeps neither on disk, and an event is stored before it is sent. It is sent once the approval is stored, so the Owner approval routes read the same id; an approval that cannot be stored is not announced and leaves the stream broken, as in (5). approval.decided carries `approval_id`, `state` and, when `state` is expired, `expired_reason`, as the approval reads them: a Stop pressed while it waited reads denied, a turn cancelled while it waited reads expired with timeout, turn_cancelled is never sent, and there is no `decided_by`. It is sent once the ending of the approval is stored; an ending that cannot be stored is not announced and leaves the stream broken, as in (5). No approval.decided is sent after its turn's turn.completed, nor for an approval the gateway's stop cut, which also reads expired with reason gateway_restart after the restart. (5) An event that cannot be stored never changes its turn. The stream is then broken: every request that names `since` is 410 resync_required, with the newest `seq` that is stored as `latest_seq`, until the stream can be read and written whole again. The gateway then stores a gap in the stream, numbered one above its newest `seq`, and a `since` below a gap is 410 resync_required; no number is given to a gap from memory. A stream that cannot be read is 503 instance_unavailable. A stream file that cannot be believed is replaced by one gap above the highest `seq` it names, wherever in the file. A gateway that stops while a turn of a conversation is running leaves that stream broken for the gateway that starts next, because the end of the turn was not stored. When no note that a stream is broken can be stored, it is held in memory and a gateway restart forgets it. A stream that has reached its size limit drops its oldest events to store a new one, and a `since` that would pass over a dropped event is 410 resync_required, with the oldest kept `seq` as `oldest_seq`; a `since` of the newest dropped `seq` passes over no dropped event. (6) A `since` past the newest `seq` is 410 resync_required. (7) A `since`, `limit` or `wait` outside what the parameters allow is 400 invalid_request; the 400 and 422 responses are part of this amendment. (8) At most 10 requests wait (`wait`) at once, the number this operation proposes for one user's streams; one more is 429 concurrency_limit with `limit: event_streams`. Query parameters: diff --git a/docs/reference/crew-api/public-responses.md b/docs/reference/crew-api/public-responses.md index c2a1d7648d8d..165ac9c44ebb 100644 --- a/docs/reference/crew-api/public-responses.md +++ b/docs/reference/crew-api/public-responses.md @@ -21,7 +21,7 @@ Not served yet: - Request headers: `Idempotency-Key`. - Response headers: `X-Crew-Quota-Limit`, `X-Crew-Quota-Remaining`, `X-Crew-Quota-Reset`. -stream=true returns text/event-stream; background=true returns queued at once. Delegated credential: model must be the template id of the app's capability bundle, \/\, or a Bot the grant allows, and conversation must be one opened under this grant. Spends credits against the grant quota; a retry with the same Idempotency-Key is not charged again. Phase 1 accepts text only; `input_image`, `input_file`, `text.format: json_schema` and `reasoning.summary` are phase 2 and open per agent as capabilities reports; when the agent does not support one, 422 capability_unavailable. When json_schema validation fails the whole turn is failed with error.code structured_output_invalid. In the preview, a turn that fair admission refuses answers 200 with status failed and the capacity message. Proposed amendments, 2026-11-26, waiting for a maintainer's sign-off: (1) A turn that continues a conversation is given the conversation's earlier turns as context ahead of its input: the turns that completed and are stored, with their texts as stored (redacted), and without the `instructions` of an earlier turn. A turn that failed, was cancelled, was cut short or was not stored is not given. (2) The earlier turns and the new input together must fit one prompt, 100 KiB (UTF-8), the limit one request's input already has; past it the turn is 413 payload_too_large and the conversation cannot be continued. (3) The stored response of a turn that ran in a conversation is kept as long as that conversation is: 30 days after the conversation's latest turn ended, not 30 days after the turn itself. So a conversation in use keeps every turn it gives. What it gives a later turn is bounded by the 100 KiB of (2). What it keeps is not: each stored turn stays within the limits a stored response already has (1 MiB of request, 1 MiB of reply), and a turn that did not complete is stored with the conversation although it is not given. (4) `previous_response_id` continues the conversation that response ran in, at its end; it does not branch from that response. A response stored before conversations were served ran in none, and naming it is 400 invalid_request. (5) The turns of one conversation may name different models; each turn's `model` is judged on its own. (6) In a conversation, a request whose input texts and ignored field names together are larger than 1 MiB is 413 payload_too_large and is not run: it could not be stored, so no later turn could be given it. A request that large which names no conversation is run as before and starts none: its Response carries no `conversation`. +stream=true returns text/event-stream; background=true returns queued at once. Delegated credential: model must be the template id of the app's capability bundle, \/\, or a Bot the grant allows, and conversation must be one opened under this grant. Spends credits against the grant quota; a retry with the same Idempotency-Key is not charged again. Phase 1 accepts text only; `input_image`, `input_file`, `text.format: json_schema` and `reasoning.summary` are phase 2 and open per agent as capabilities reports; when the agent does not support one, 422 capability_unavailable. When json_schema validation fails the whole turn is failed with error.code structured_output_invalid. In the preview, a turn that fair admission refuses answers 200 with status failed and the capacity message. Amendments, 2026-11-26, accepted by a maintainer on 2026-12-02: (1) A turn that continues a conversation is given the conversation's earlier turns as context ahead of its input: the turns that completed and are stored, with their texts as stored (redacted), and without the `instructions` of an earlier turn. A turn that failed, was cancelled, was cut short or was not stored is not given. (2) The earlier turns and the new input together must fit one prompt, 100 KiB (UTF-8), the limit one request's input already has; past it the turn is 413 payload_too_large and the conversation cannot be continued. (3) The stored response of a turn that ran in a conversation is kept as long as that conversation is: 30 days after the conversation's latest turn ended, not 30 days after the turn itself. So a conversation in use keeps every turn it gives. What it gives a later turn is bounded by the 100 KiB of (2). What it keeps is not: each stored turn stays within the limits a stored response already has (1 MiB of request, 1 MiB of reply), and a turn that did not complete is stored with the conversation although it is not given. (4) `previous_response_id` continues the conversation that response ran in, at its end; it does not branch from that response. A response stored before conversations were served ran in none, and naming it is 400 invalid_request. (5) The turns of one conversation may name different models; each turn's `model` is judged on its own. (6) In a conversation, a request whose input texts and ignored field names together are larger than 1 MiB is 413 payload_too_large and is not run: it could not be stored, so no later turn could be given it. A request that large which names no conversation is run as before and starts none: its Response carries no `conversation`. Request headers: @@ -115,7 +115,7 @@ Not served yet: - Response headers: `X-Crew-Quota-Limit`, `X-Crew-Quota-Remaining`, `X-Crew-Quota-Reset`. -Holding either conversations:read or responses:write is enough; with only responses:write, only responses this grant created can be read. Stream events are stored with the response, so the stream can be resumed. Retention: stored responses (with the stream events used to resume), the event index, resolved approvals and uploaded files are all kept 30 days by default; the owner can set `crew_api.retention_days` in the crew settings to 1 to 365 days. Deleting a conversation deletes its responses and events. After the retention period this returns 404 not_found. Proposed amendments, 2026-11-25, waiting for a maintainer's sign-off: (1) The events themselves are not stored. For a turn that was answered as a stream, the text of each of its deltas is stored and the same events are made from it again when the stream is read. A turn that was answered as JSON has no stream to store; its stream is built from the stored Response. (2) A turn that is still running reads in_progress with no output, and with stream=true its two opening events are sent and the stream closes: the rest of a running stream cannot be followed yet. (3) The `crew_api.retention_days` setting is not built yet: a response is kept 30 days. (4) A query value the parameters do not allow is 400 invalid_request. (5) A turn whose reply text is larger than 1 MiB (UTF-8), or whose input texts and ignored field names together, as sent, are larger than 1 MiB, is answered as ever and is not stored: reading it returns 404 not_found. The limits are the same for a turn answered as JSON and one answered as a stream. Proposed amendment, 2026-11-26, waiting for a maintainer's sign-off: (6) A turn that ran in a conversation is kept as long as that conversation, 30 days after the conversation's latest turn ended, and reads 404 not_found once the conversation's retention is over; its input items follow the same rule. +Holding either conversations:read or responses:write is enough; with only responses:write, only responses this grant created can be read. Stream events are stored with the response, so the stream can be resumed. Retention: stored responses (with the stream events used to resume), the event index, resolved approvals and uploaded files are all kept 30 days by default; the owner can set `crew_api.retention_days` in the crew settings to 1 to 365 days. Deleting a conversation deletes its responses and events. After the retention period this returns 404 not_found. Amendments, 2026-11-25, accepted by a maintainer on 2026-12-02: (1) The events themselves are not stored. For a turn that was answered as a stream, the text of each of its deltas is stored and the same events are made from it again when the stream is read. A turn that was answered as JSON has no stream to store; its stream is built from the stored Response. (2) A turn that is still running reads in_progress with no output, and with stream=true its two opening events are sent and the stream closes: the rest of a running stream cannot be followed yet. (3) The `crew_api.retention_days` setting is not built yet: a response is kept 30 days. (4) A query value the parameters do not allow is 400 invalid_request. (5) A turn whose reply text is larger than 1 MiB (UTF-8), or whose input texts and ignored field names together, as sent, are larger than 1 MiB, is answered as ever and is not stored: reading it returns 404 not_found. The limits are the same for a turn answered as JSON and one answered as a stream. Amendment, 2026-11-26, accepted by a maintainer on 2026-12-02: (6) A turn that ran in a conversation is kept as long as that conversation, 30 days after the conversation's latest turn ended, and reads 404 not_found once the conversation's retention is over; its input items follow the same rule. Path parameters: @@ -269,7 +269,7 @@ Not served yet: - Response headers: `X-Crew-Quota-Limit`, `X-Crew-Quota-Remaining`, `X-Crew-Quota-Reset`. -Proposed amendments, 2026-11-25, waiting for a maintainer's sign-off: (1) `instructions` is not an input item and is not listed. (2) An input item keeps the role it was sent with, `developer` and `system` included. (3) A query value the parameters do not allow, or an `after` that names no item of this response, is 400 invalid_request. +Amendments, 2026-11-25, accepted by a maintainer on 2026-12-02: (1) `instructions` is not an input item and is not listed. (2) An input item keeps the role it was sent with, `developer` and `system` included. (3) A query value the parameters do not allow, or an `after` that names no item of this response, is 400 invalid_request. Path parameters: diff --git a/docs/reference/crew-api/schemas.md b/docs/reference/crew-api/schemas.md index 4b67262fdc37..80c858bdc1ff 100644 --- a/docs/reference/crew-api/schemas.md +++ b/docs/reference/crew-api/schemas.md @@ -659,11 +659,11 @@ The owner's recorded Bot selection, returned by the grants list; GET /v1/crew/bo | `requested_bots` | array of string | no | The Bot names the app sends as the repeated bots query parameter of GET /oauth/authorize, one Bot per occurrence, without splitting; empty when omitted. The app is expected to send the exact model id from GET /v1/models. Names follow kiro_crew.members.is_dispatchable_member_name with the MEMBER_NAME_MAX_CHARS length limit; duplicates are refused. Asking checks format, never existence. Malformed bots gives 400 invalid_request even with an invalid scope. Asking again requires the same bots values in the same order. MAX_REQUESTED_BOTS is the chosen bound for one request and one decision, set equal to crew_teams.TEAM_MEMBERS_MAX (500), the largest Bot list the product keeps elsewhere. The request must fit aiohttp's 8190-byte request line. The decision body must fit 4 KiB (_BODY_MAX); a bots list that does not fit gives 400 invalid_request, and the owner gives a shorter list. | | `created_at` | [Timestamp](schemas.md#timestamp) | yes | Unix seconds. | | `expires_at` | [Timestamp](schemas.md#timestamp) | yes | Unix seconds. | -| `decided_at` | integer or null | no | When the owner answered (amendment, proposed) | -| `decided_by` | object or null | no | Who answered: the kind of caller, never a token (amendment, proposed) | -| `granted_scopes` | array of string | no | Only when approved; what the owner gave, which may be fewer than requested (amendment, proposed) | +| `decided_at` | integer or null | no | When the owner answered (amendment, accepted by a maintainer on 2026-12-02) | +| `decided_by` | object or null | no | Who answered: the kind of caller, never a token (amendment, accepted by a maintainer on 2026-12-02) | +| `granted_scopes` | array of string | no | Only when approved; what the owner gave, which may be fewer than requested (amendment, accepted by a maintainer on 2026-12-02) | | `granted_bots` | array of string | no | Only when approved; the Bot names the owner gave, which may be none. They become the grant's bots with mode selected. Names follow kiro_crew.members.is_dispatchable_member_name and MEMBER_NAME_MAX_CHARS, with no duplicates. MAX_REQUESTED_BOTS is the chosen bound for one request and one decision, set equal to crew_teams.TEAM_MEMBERS_MAX (500), the largest Bot list the product keeps elsewhere. The decision body must fit 4 KiB (_BODY_MAX); a bots list that does not fit gives 400 invalid_request, and the owner gives a shorter list. The decision checks expiry, pending status and the requested subset before reading the roster. The grants list returns the owner's recorded selection, and GET /v1/crew/bots lists the app only Bots from it. | -| `grant_id` | string or null | no | The grant this request led to, set once the app redeemed its code (amendment, proposed) | +| `grant_id` | string or null | no | The grant this request led to, set once the app redeemed its code (amendment, accepted by a maintainer on 2026-12-02) | ## GrantRequestDecision @@ -872,7 +872,7 @@ Content is a string, or a list of content parts: `input_text` (phase 1), `input_ |---|---|---|---| | `type` | `message` | yes | | | `id` | string | yes | | -| `role` | `user`, `assistant`, `developer`, `system` | yes | Proposed amendment, 2026-11-25, waiting for a maintainer's sign-off: `developer` and `system`, the roles an input item can be sent with, so that GET /v1/responses/{response_id}/input_items can list such an item. | +| `role` | `user`, `assistant`, `developer`, `system` | yes | Amendment, 2026-11-25, accepted by a maintainer on 2026-12-02: `developer` and `system`, the roles an input item can be sent with, so that GET /v1/responses/{response_id}/input_items can list such an item. | | `status` | `in_progress`, `completed`, `incomplete` | yes | | | `content` | array of [OutputText](schemas.md#outputtext) or [InputText](schemas.md#inputtext) | yes | | @@ -1021,7 +1021,7 @@ Reasoning summary (phase 2). Present only when the request carries reasoning.sum ## Response -Retention: stored responses (with the stream events used to resume), the event index, resolved approvals and uploaded files are all kept 30 days by default; the owner can set `crew_api.retention_days` in the crew settings to 1 to 365 days. Deleting a conversation deletes its responses and events. After the retention period GET returns 404 not_found. Proposed amendment, 2026-11-25, waiting for a maintainer's sign-off: the `crew_api.retention_days` setting is not built yet; a response is kept 30 days. +Retention: stored responses (with the stream events used to resume), the event index, resolved approvals and uploaded files are all kept 30 days by default; the owner can set `crew_api.retention_days` in the crew settings to 1 to 365 days. Deleting a conversation deletes its responses and events. After the retention period GET returns 404 not_found. Amendment, 2026-11-25, accepted by a maintainer on 2026-12-02: the `crew_api.retention_days` setting is not built yet; a response is kept 30 days. | Field | Type | Required | Description | |---|---|---|---| diff --git a/docs/request-for-change/assets/crew-api/components.yaml b/docs/request-for-change/assets/crew-api/components.yaml index 06860992ba65..fa75be8e7f1d 100644 --- a/docs/request-for-change/assets/crew-api/components.yaml +++ b/docs/request-for-change/assets/crew-api/components.yaml @@ -429,7 +429,7 @@ components: - assistant - developer - system - description: 'Proposed amendment, 2026-11-25, waiting for a maintainer''s sign-off: `developer` and `system`, + description: 'Amendment, 2026-11-25, accepted by a maintainer on 2026-12-02: `developer` and `system`, the roles an input item can be sent with, so that GET /v1/responses/{response_id}/input_items can list such an item.' status: @@ -634,8 +634,8 @@ components: description: 'Retention: stored responses (with the stream events used to resume), the event index, resolved approvals and uploaded files are all kept 30 days by default; the owner can set `crew_api.retention_days` in the crew settings to 1 to 365 days. Deleting a conversation deletes its responses and events. After the - retention period GET returns 404 not_found. Proposed amendment, 2026-11-25, waiting for a maintainer''s - sign-off: the `crew_api.retention_days` setting is not built yet; a response is kept 30 days.' + retention period GET returns 404 not_found. Amendment, 2026-11-25, accepted by a maintainer on + 2026-12-02: the `crew_api.retention_days` setting is not built yet; a response is kept 30 days.' ResponseStreamEvent: type: object required: diff --git a/docs/request-for-change/assets/crew-api/crew-owner.yaml b/docs/request-for-change/assets/crew-api/crew-owner.yaml index fcc6d0d33c74..7ac15ffa0859 100644 --- a/docs/request-for-change/assets/crew-api/crew-owner.yaml +++ b/docs/request-for-change/assets/crew-api/crew-owner.yaml @@ -268,7 +268,7 @@ paths: x-crew-coverage: done description: Takes effect locally first (status=revoked), then the issuer of the grant is told over the control channel. Open streams receive grant.revoked and are closed. For a grant made through local authorization - (amendment, proposed), the host owner's credential is required and Shared Crew teammates and app tokens receive + (amendment, accepted by a maintainer on 2026-12-02), the host owner's credential is required and Shared Crew teammates and app tokens receive 403 owner_only; every access and refresh token under the grant is refused from the next request; a second call answers the same 200 until the grant's own expiry, then 404. Such a grant has no outside issuer to tell. /v1/crew/owner/grants/{grant_id}/resume: @@ -470,7 +470,7 @@ paths: - none, new x-crew-coverage: done description: Returns one grant request by its id, answered or not, so the owner can see how it was answered and - which grant it led to (amendment, proposed). The request stays readable until it and its authorization code + which grant it led to (amendment, accepted by a maintainer on 2026-12-02). The request stays readable until it and its authorization code have expired, or for as long as the grant it led to exists; after that it is 404. The host owner's credential is required; Shared Crew teammates and app tokens receive 403 owner_only. /v1/crew/owner/grant-requests/{request_id}/decision: @@ -1236,12 +1236,12 @@ components: type: - integer - 'null' - description: When the owner answered (amendment, proposed) + description: When the owner answered (amendment, accepted by a maintainer on 2026-12-02) decided_by: type: - object - 'null' - description: 'Who answered: the kind of caller, never a token (amendment, proposed)' + description: 'Who answered: the kind of caller, never a token (amendment, accepted by a maintainer on 2026-12-02)' properties: kind: type: string @@ -1253,7 +1253,7 @@ components: type: array items: type: string - description: Only when approved; what the owner gave, which may be fewer than requested (amendment, proposed) + description: Only when approved; what the owner gave, which may be fewer than requested (amendment, accepted by a maintainer on 2026-12-02) granted_bots: type: array items: @@ -1273,7 +1273,7 @@ components: - string - 'null' pattern: ^grt_ - description: The grant this request led to, set once the app redeemed its code (amendment, proposed) + description: The grant this request led to, set once the app redeemed its code (amendment, accepted by a maintainer on 2026-12-02) GrantRequestList: allOf: - $ref: ./components.yaml#/components/schemas/ListEnvelope diff --git a/docs/request-for-change/assets/crew-api/crew-public.yaml b/docs/request-for-change/assets/crew-api/crew-public.yaml index b5b47097e91b..df0497ce1ff0 100644 --- a/docs/request-for-change/assets/crew-api/crew-public.yaml +++ b/docs/request-for-change/assets/crew-api/crew-public.yaml @@ -231,8 +231,8 @@ paths: `text.format: json_schema` and `reasoning.summary` are phase 2 and open per agent as capabilities reports; when the agent does not support one, 422 capability_unavailable. When json_schema validation fails the whole turn is failed with error.code structured_output_invalid. In the preview, a turn that fair admission refuses - answers 200 with status failed and the capacity message. Proposed amendments, 2026-11-26, waiting for a - maintainer''s sign-off: (1) A turn that continues a conversation is given the conversation''s earlier + answers 200 with status failed and the capacity message. Amendments, 2026-11-26, accepted by a + maintainer on 2026-12-02: (1) A turn that continues a conversation is given the conversation''s earlier turns as context ahead of its input: the turns that completed and are stored, with their texts as stored (redacted), and without the `instructions` of an earlier turn. A turn that failed, was cancelled, was cut short or was not stored is not given. (2) The earlier turns and the new input together must fit one @@ -409,8 +409,8 @@ paths: be resumed. Retention: stored responses (with the stream events used to resume), the event index, resolved approvals and uploaded files are all kept 30 days by default; the owner can set `crew_api.retention_days` in the crew settings to 1 to 365 days. Deleting a conversation deletes its responses and events. After the - retention period this returns 404 not_found. Proposed amendments, 2026-11-25, waiting for a maintainer''s - sign-off: (1) The events themselves are not stored. For a turn that was answered as a stream, the text of + retention period this returns 404 not_found. Amendments, 2026-11-25, accepted by a maintainer on + 2026-12-02: (1) The events themselves are not stored. For a turn that was answered as a stream, the text of each of its deltas is stored and the same events are made from it again when the stream is read. A turn that was answered as JSON has no stream to store; its stream is built from the stored Response. (2) A turn that is still running reads in_progress with no output, and with stream=true its two opening events @@ -419,7 +419,7 @@ paths: parameters do not allow is 400 invalid_request. (5) A turn whose reply text is larger than 1 MiB (UTF-8), or whose input texts and ignored field names together, as sent, are larger than 1 MiB, is answered as ever and is not stored: reading it returns 404 not_found. The limits are the same for a turn answered - as JSON and one answered as a stream. Proposed amendment, 2026-11-26, waiting for a maintainer''s sign-off: + as JSON and one answered as a stream. Amendment, 2026-11-26, accepted by a maintainer on 2026-12-02: (6) A turn that ran in a conversation is kept as long as that conversation, 30 days after the conversation''s latest turn ended, and reads 404 not_found once the conversation''s retention is over; its input items follow the same rule.' @@ -573,7 +573,7 @@ paths: - src/kiro_crew/dashboard/chat_api/slot_detail.py:803 (the slot window) x-crew-coverage: done x-crew-stability: preview - description: 'Proposed amendments, 2026-11-25, waiting for a maintainer''s sign-off: (1) `instructions` is not + description: 'Amendments, 2026-11-25, accepted by a maintainer on 2026-12-02: (1) `instructions` is not an input item and is not listed. (2) An input item keeps the role it was sent with, `developer` and `system` included. (3) A query value the parameters do not allow, or an `after` that names no item of this response, is 400 invalid_request.' @@ -721,7 +721,7 @@ paths: x-crew-coverage: done x-crew-stability: preview description: 'The conversation is tagged with the grant id. The external id is conv_, never the internal session - key. Proposed amendments, 2026-11-26, waiting for a maintainer''s sign-off: (1) A conversation is kept + key. Amendments, 2026-11-26, accepted by a maintainer on 2026-12-02: (1) A conversation is kept 30 days after its latest turn ended, or 30 days after it was made while it holds no turn; 30 days is the retention a stored response already has. Admitting a continuation checks that it has not expired, then renews retention for the conversation and its listed turns before reading history; completion @@ -797,7 +797,7 @@ paths: x-crew-coverage: done x-crew-stability: preview description: 'OpenAI has no such endpoint; Crew adds it. A delegated credential lists only conversations opened - under its grant. Proposed amendments, 2026-11-26, waiting for a maintainer''s sign-off: (1) The list + under its grant. Amendments, 2026-11-26, accepted by a maintainer on 2026-12-02: (1) The list holds every conversation of the caller that is still kept, the ones a turn started for itself included (a POST /v1/responses that named no conversation). (2) The order is by `created_at`, then by id; `desc`, the default, is newest first. A conversation keeps its place while turns run in it. (3) `after` is a @@ -867,7 +867,7 @@ paths: - src/kiro_crew/dashboard/chat_api/slot_detail.py:803 (api_chat_slot_detail) x-crew-coverage: done x-crew-stability: preview - description: 'Proposed amendments, 2026-11-26, waiting for a maintainer''s sign-off: (1) `crew.title` is + description: 'Amendments, 2026-11-26, accepted by a maintainer on 2026-12-02: (1) `crew.title` is null: a conversation is given no title. `crew.model` is the model its latest turn named, and is absent before the first turn ends. `crew.status` is running while a turn runs in the conversation and idle otherwise; needs_approval is not reported yet, and a turn that waits for an approval reads running. `crew.latest_seq` @@ -940,7 +940,7 @@ paths: - None; new work. x-crew-coverage: done x-crew-stability: preview - description: 'Proposed amendments, 2026-11-26, waiting for a maintainer''s sign-off: (1) `metadata` replaces + description: 'Amendments, 2026-11-26, accepted by a maintainer on 2026-12-02: (1) `metadata` replaces the conversation''s metadata whole: a pair the request does not send is removed, and `{}` removes them all. (2) An update is not a turn: it does not renew the conversation''s retention, which still counts from its latest turn. (3) A conversation can be updated while a turn runs in it.' @@ -1019,8 +1019,8 @@ paths: x-crew-coverage: done x-crew-stability: preview description: 'A delegated credential can delete only conversations opened under its grant; others get 404. - 409 response_in_progress while a turn is running. Proposed amendments, 2026-11-26, waiting for a - maintainer''s sign-off: (1) Deleting a conversation deletes the stored responses of the turns that ran + 409 response_in_progress while a turn is running. Amendments, 2026-11-26, accepted by a + maintainer on 2026-12-02: (1) Deleting a conversation deletes the stored responses of the turns that ran in it. Afterwards the conversation, each of those responses and their input items read 404 not_found, and a turn that names the conversation or one of those responses is 404 not_found. (2) A turn asked for in the conversation while the delete is in progress is 409 response_in_progress.' @@ -1092,7 +1092,7 @@ paths: - src/kiro_crew/dashboard/chat_api/slot_detail.py:803 (the slot window) x-crew-coverage: done x-crew-stability: preview - description: 'Proposed amendments, 2026-11-26, waiting for a maintainer''s sign-off: (1) The history is + description: 'Amendments, 2026-11-26, accepted by a maintainer on 2026-12-02: (1) The history is the conversation''s stored turns in the order they ran: for each turn its input items, then its reply. `asc` is that order and `desc`, the default, is its reverse. The texts are the stored ones, which are redacted. (2) A turn that failed, was cancelled or was cut short is listed too, and each of its items @@ -1441,9 +1441,9 @@ paths: turn.completed. Not served yet: the instance stream (a request with no `conversation`) and the SSE form (`Accept: text/event-stream`) are 422 capability_unavailable; the `bot` parameter is not read; the other event types are not sent; the event - retention setting and the ceilings on concurrent streams are not built. Proposed amendments, 2026-11-27, - waiting for a maintainer''s sign-off: (1) A conversation''s `seq` counts the events the gateway wrote for - that conversation, from 1, whichever engine session each turn ran on. (2) A conversation''s events are + retention setting and the ceilings on concurrent streams are not built. Amendments, 2026-11-27, + accepted by a maintainer on 2026-12-02, except item (4), which stays proposed: (1) A conversation''s + `seq` counts the events the gateway wrote for that conversation, from 1, whichever engine session each turn ran on. (2) A conversation''s events are kept as long as the conversation, less the oldest ones a full stream drops (5), and deleted with it; a conversation made before the gateway served this operation has no earlier events. (3) message.created is sent when its turn ends, for each item of the turn diff --git a/docs/request-for-change/rfc-crew-api.md b/docs/request-for-change/rfc-crew-api.md index 957b40e0ff58..16a715be9d37 100644 --- a/docs/request-for-change/rfc-crew-api.md +++ b/docs/request-for-change/rfc-crew-api.md @@ -14,7 +14,7 @@ superseded-by: [] # RFC: Crew API -- Status: partial. A maintainer accepted the design on 2026-11-14, with open question Q7 decided. The first Owner-tier route is built: [#34104](https://github.com/kirodotdev/KiroCrew/pull/34104) serves `GET /v1/crew/owner/bots` (`src/kiro_crew/dashboard/routes/crew_api.py`), the twin of `GET /api/members`. [#39564](https://github.com/kirodotdev/KiroCrew/pull/39564), merged 2026-11-20, adds phase 1's local authorization: the four routes `/.well-known/oauth-authorization-server`, `/oauth/authorize`, `/oauth/token` and `/oauth/revoke` (`src/kiro_crew/dashboard/routes/local_authorization.py`), and one `/v1` route serves the token: a valid one sent from this machine reaches `GET /v1/models` and is answered 403 on every other Crew API path, by the route's row in the scope table (`crew_api_auth.judge_app_credential`). [#39574](https://github.com/kirodotdev/KiroCrew/pull/39574) makes a `/v1/` path other than `POST /v1/chat/completions` take its credential from `Authorization: Bearer` and refuse `?token=` (`src/kiro_crew/dashboard/crew_api_auth.py`), and serves `GET /v1/models` for the owner and for a local app credential. An app credential gets `200` with `{"object": "list", "data": []}` until a route lets an app run a Bot in its grant or an agent; its list comes only from the grant, without reading the owner's catalog. `GET /v1/crew/info` and `GET /v1/crew/capabilities` are served for the owner and for a local app credential (`src/kiro_crew/dashboard/crew_api_instance.py`): `info` answers the instance id, `form` `local` and the API version, the same to both, and `capabilities` reports every feature `false`, text input for each agent and the input size limit. An app credential's `agents` holds only what its grant can use, which is nothing today, and no caller gets a `quota`: quota is not built. `POST /v1/responses` is served for the machine owner (`src/kiro_crew/dashboard/crew_api_responses.py`): one turn in a conversation, answered as JSON or, with `stream: true`, as the stream events of the subset. A stopped turn ends its stream with `response.incomplete`, and the `Response` inside it carries `status: cancelled`, the status the JSON answer gives. Every other field of [the Responses subset](#33-the-responses-subset) that needs more than that (`background`, tools, the phase 2 fields) answers 422 `capability_unavailable`, the `Idempotency-Key` header is not read, and a turn that fair admission refuses is answered 200 with `status: failed`. `GET /v1/crew/owner/grants` is served for the machine owner (`src/kiro_crew/dashboard/crew_api_grant_requests.py`): it lists the grants made through local authorization. The same module serves the rest of the grant routes for the machine owner: `GET /v1/crew/owner/grant-requests`, `GET /v1/crew/owner/grant-requests/{request_id}`, `POST /v1/crew/owner/grant-requests/{request_id}/decision` and `DELETE /v1/crew/owner/grants/{grant_id}`. The three tool-approval routes are served for the machine owner too (`src/kiro_crew/dashboard/crew_api_approvals.py`): `GET /v1/crew/owner/approvals`, `GET /v1/crew/owner/approvals/{approval_id}` and `POST /v1/crew/owner/approvals/{approval_id}/decision`. `GET /v1/responses/{id}` and `GET /v1/responses/{id}/input_items` are served for the machine owner (`src/kiro_crew/dashboard/crew_api_response_reads.py`): a turn that ended is kept 30 days (`src/kiro_crew/dashboard/crew_api_response_records.py`) and read back as the `Response` it was answered with; `?stream=true` sends the stream events of a turn that was streamed again, and for a turn answered as JSON events made from that `Response`; a turn whose reply text or whose request text is larger than 1 MiB is not kept; a turn still running reads `in_progress`, and the rest of its stream cannot be followed; the retention setting is not built. Where these two routes differ from the contract's text, the difference is written in the OpenAPI as a proposed amendment that waits for a maintainer's sign-off. `GET /v1/crew/grant` is served to an app credential from local authorization (`src/kiro_crew/dashboard/crew_api_grant_self.py`): it reads its own grant's scopes and Bots, and the owner's own credential gets 404. Pause, throttle, entitlements and quota are not built, so `status` is always `active`. The token of a revoked grant is answered 401 `token_revoked` while the token is in date and the grant's record is kept. `GET /v1/crew/bots` is served (`src/kiro_crew/dashboard/crew_api_bots.py`): an app credential that holds `bots:read` or `bots:chat` lists the Bots of its own grant, and the machine owner lists every Bot, both paged with `after` and `limit`. `GET /v1/crew/bots/{bot_id}/goals` and `GET /v1/crew/bots/{bot_id}/reports` are served (`src/kiro_crew/dashboard/crew_api_bot_goals.py`) for the machine owner and for an app credential that holds `bots:read`, which reads a Bot of its own grant and gets 404 for any other. `id` is the Bot's name, `avatar_url` is always null, `created_by_app` is left out, and `status` is `busy` while a turn runs in the Bot's own thread or a dashboard turn runs as the Bot: a `POST /v1/responses` or `POST /v1/chat/completions` turn with the Bot as `model`, a dashboard chat on the Bot, a session another session sends a message to, a task review. A scheduled run counts when the job runs one agent and selected the Bot as a member, also for a Bot that owns its own agent file and so runs its schedule on its worker. A webhook turn counts when it runs the agent its registration holds. An agent sequence, a job made from a worker session and a webhook request that names another agent read `idle`. A channel turn counts when its session's execution record is a member selection of the Bot, its session was started as that Bot and the turn asked for it; a subagent run, a workflow or task step and a Bot's worker session are not turns of the Bot. A grant keeps the member id of each Bot the owner gave, and an app is listed a Bot only while that Bot still holds it. A Bot with no member id is not listed to an app. On a new install the default agent has none, so it is not listed; `mate` and a Bot made in the dashboard or with the CLI have one and are listed. A Bot made later under the same name gets a new member id and is not listed; one made from the memory store the deleted Bot left behind holds that Bot's member id and is listed. The Bots of a grant made before this was kept are not listed to an app. The six conversation operations are served for the machine owner (`src/kiro_crew/dashboard/crew_api_conversations.py`, `src/kiro_crew/dashboard/crew_api_conversation_lists.py`): `POST /v1/conversations`, `GET /v1/conversations`, and the `GET`, `POST` and `DELETE` of `/v1/conversations/{id}` and `GET /v1/conversations/{id}/items`. Deleting a conversation deletes the stored responses of its turns, and is 409 `response_in_progress` while a turn runs in it. What the list holds and how it is ordered, what the history holds (a turn that did not complete included, its items `incomplete`), that an update replaces the metadata whole and does not renew retention, and what a delete removes are written in the OpenAPI as proposed amendments, 2026-11-26, that wait for a maintainer's sign-off. `POST /v1/responses` runs its turn in the conversation `conversation` names, in the one the turn `previous_response_id` names ran in, or in a new one; a conversation runs one turn at a time, and the `Response` names its conversation. A conversation is a record of its turns and is not a dashboard chat. The `Idempotency-Key` header is not read, `crew.latest_seq` and `needs_approval` are not reported, and no `conversation.created` event is sent: the instance stream is not built. `GET /v1/crew/events` is served for the machine owner as the conversation stream in paged JSON, with `since`, `limit` and `wait` (`src/kiro_crew/dashboard/crew_api_events.py`, `src/kiro_crew/dashboard/crew_api_event_records.py`): it holds `turn.started`, `message.created` and `turn.completed` for the turns `POST /v1/responses` runs in the conversation, and `approval.requested` and `approval.decided` for the tool approvals those turns wait on: such an approval gets its `apr_` id when it is raised, not when an Owner approval route first lists it. The instance stream, the SSE form, the other event types, the retention setting and the ceilings on streams are not built. `POST /v1/responses/{response_id}/cancel` is served for the machine owner (`src/kiro_crew/dashboard/crew_api_response_cancel.py`): it stops a running turn and answers its `Response`, and a tool approval the turn was waiting on reads `expired` with reason `turn_cancelled`. What it answers when the turn has not ended within the stop limit (200 `in_progress`), what a turn that ended by itself meanwhile reads, that a turn that is not kept cannot be cancelled (404), and that `Idempotency-Key` and the body are not read are written in the OpenAPI as amendments, 2026-12-01, that a maintainer accepted on 2026-12-02. `GET /v1/crew/approvals` and `GET /v1/crew/approvals/{approval_id}` are served for the machine owner, read only (`src/kiro_crew/dashboard/crew_api_public_approvals.py`): they list and read the tool approvals of the turns that run in a conversation of this API. Which approvals they hold, that an approval from before a gateway restart is read from the Owner routes alone, what `answerable_by_you` means, that `expires_at` and `approval_url` are not given, and that `decided_by` holds `kind` alone are written in the OpenAPI as amendments, 2026-12-01, that a maintainer accepted on 2026-12-02. How a conversation's `seq` is counted, that its events are kept and deleted with it, when `message.created` is sent, what `approval.requested` and `approval.decided` carry (`approval_id` and no `tool` or `reason`; `state`, and `expired_reason` for an expired one), what a reader is told when an event could not be stored (410 `resync_required`), and that at most 10 requests wait at once are written in the OpenAPI as proposed amendments, 2026-11-27, that wait for a maintainer's sign-off. How a later turn is given the earlier ones, how large a conversation can grow (100 KiB of text, the limit one request's input already has) and how long it and the turns that ran in it are kept (30 days after its latest turn, the retention a stored response already has) are written in the OpenAPI as proposed amendments, 2026-11-26, that wait for a maintainer's sign-off. The `bots:chat` amendment, 2026-12-02 (what the scope allows, the grant's memory setting, the reason a delegated credential cannot answer an approval, the residual risk and Q12), was accepted by maintainer buluoray on 2026-12-02, as recorded in [#45825](https://github.com/kirodotdev/KiroCrew/issues/45825). None of it is built: `POST /v1/responses` is served for the machine owner alone, no app credential runs a turn, a grant stores no memory setting, and the grant's memory setting is not in the OpenAPI schema yet. The rest is not built. This document changes no code. +- Status: partial. A maintainer accepted the design on 2026-11-14, with open question Q7 decided. The first Owner-tier route is built: [#34104](https://github.com/kirodotdev/KiroCrew/pull/34104) serves `GET /v1/crew/owner/bots` (`src/kiro_crew/dashboard/routes/crew_api.py`), the twin of `GET /api/members`. [#39564](https://github.com/kirodotdev/KiroCrew/pull/39564), merged 2026-11-20, adds phase 1's local authorization: the four routes `/.well-known/oauth-authorization-server`, `/oauth/authorize`, `/oauth/token` and `/oauth/revoke` (`src/kiro_crew/dashboard/routes/local_authorization.py`), and one `/v1` route serves the token: a valid one sent from this machine reaches `GET /v1/models` and is answered 403 on every other Crew API path, by the route's row in the scope table (`crew_api_auth.judge_app_credential`). [#39574](https://github.com/kirodotdev/KiroCrew/pull/39574) makes a `/v1/` path other than `POST /v1/chat/completions` take its credential from `Authorization: Bearer` and refuse `?token=` (`src/kiro_crew/dashboard/crew_api_auth.py`), and serves `GET /v1/models` for the owner and for a local app credential. An app credential gets `200` with `{"object": "list", "data": []}` until a route lets an app run a Bot in its grant or an agent; its list comes only from the grant, without reading the owner's catalog. `GET /v1/crew/info` and `GET /v1/crew/capabilities` are served for the owner and for a local app credential (`src/kiro_crew/dashboard/crew_api_instance.py`): `info` answers the instance id, `form` `local` and the API version, the same to both, and `capabilities` reports every feature `false`, text input for each agent and the input size limit. An app credential's `agents` holds only what its grant can use, which is nothing today, and no caller gets a `quota`: quota is not built. `POST /v1/responses` is served for the machine owner (`src/kiro_crew/dashboard/crew_api_responses.py`): one turn in a conversation, answered as JSON or, with `stream: true`, as the stream events of the subset. A stopped turn ends its stream with `response.incomplete`, and the `Response` inside it carries `status: cancelled`, the status the JSON answer gives. Every other field of [the Responses subset](#33-the-responses-subset) that needs more than that (`background`, tools, the phase 2 fields) answers 422 `capability_unavailable`, the `Idempotency-Key` header is not read, and a turn that fair admission refuses is answered 200 with `status: failed`. `GET /v1/crew/owner/grants` is served for the machine owner (`src/kiro_crew/dashboard/crew_api_grant_requests.py`): it lists the grants made through local authorization. The same module serves the rest of the grant routes for the machine owner: `GET /v1/crew/owner/grant-requests`, `GET /v1/crew/owner/grant-requests/{request_id}`, `POST /v1/crew/owner/grant-requests/{request_id}/decision` and `DELETE /v1/crew/owner/grants/{grant_id}`. The three tool-approval routes are served for the machine owner too (`src/kiro_crew/dashboard/crew_api_approvals.py`): `GET /v1/crew/owner/approvals`, `GET /v1/crew/owner/approvals/{approval_id}` and `POST /v1/crew/owner/approvals/{approval_id}/decision`. `GET /v1/responses/{id}` and `GET /v1/responses/{id}/input_items` are served for the machine owner (`src/kiro_crew/dashboard/crew_api_response_reads.py`): a turn that ended is kept 30 days (`src/kiro_crew/dashboard/crew_api_response_records.py`) and read back as the `Response` it was answered with; `?stream=true` sends the stream events of a turn that was streamed again, and for a turn answered as JSON events made from that `Response`; a turn whose reply text or whose request text is larger than 1 MiB is not kept; a turn still running reads `in_progress`, and the rest of its stream cannot be followed; the retention setting is not built. Where these two routes differ from the contract's text, the difference is written in the OpenAPI as an amendment that a maintainer accepted on 2026-12-02. `GET /v1/crew/grant` is served to an app credential from local authorization (`src/kiro_crew/dashboard/crew_api_grant_self.py`): it reads its own grant's scopes and Bots, and the owner's own credential gets 404. Pause, throttle, entitlements and quota are not built, so `status` is always `active`. The token of a revoked grant is answered 401 `token_revoked` while the token is in date and the grant's record is kept. `GET /v1/crew/bots` is served (`src/kiro_crew/dashboard/crew_api_bots.py`): an app credential that holds `bots:read` or `bots:chat` lists the Bots of its own grant, and the machine owner lists every Bot, both paged with `after` and `limit`. `GET /v1/crew/bots/{bot_id}/goals` and `GET /v1/crew/bots/{bot_id}/reports` are served (`src/kiro_crew/dashboard/crew_api_bot_goals.py`) for the machine owner and for an app credential that holds `bots:read`, which reads a Bot of its own grant and gets 404 for any other. `id` is the Bot's name, `avatar_url` is always null, `created_by_app` is left out, and `status` is `busy` while a turn runs in the Bot's own thread or a dashboard turn runs as the Bot: a `POST /v1/responses` or `POST /v1/chat/completions` turn with the Bot as `model`, a dashboard chat on the Bot, a session another session sends a message to, a task review. A scheduled run counts when the job runs one agent and selected the Bot as a member, also for a Bot that owns its own agent file and so runs its schedule on its worker. A webhook turn counts when it runs the agent its registration holds. An agent sequence, a job made from a worker session and a webhook request that names another agent read `idle`. A channel turn counts when its session's execution record is a member selection of the Bot, its session was started as that Bot and the turn asked for it; a subagent run, a workflow or task step and a Bot's worker session are not turns of the Bot. A grant keeps the member id of each Bot the owner gave, and an app is listed a Bot only while that Bot still holds it. A Bot with no member id is not listed to an app. On a new install the default agent has none, so it is not listed; `mate` and a Bot made in the dashboard or with the CLI have one and are listed. A Bot made later under the same name gets a new member id and is not listed; one made from the memory store the deleted Bot left behind holds that Bot's member id and is listed. The Bots of a grant made before this was kept are not listed to an app. The six conversation operations are served for the machine owner (`src/kiro_crew/dashboard/crew_api_conversations.py`, `src/kiro_crew/dashboard/crew_api_conversation_lists.py`): `POST /v1/conversations`, `GET /v1/conversations`, and the `GET`, `POST` and `DELETE` of `/v1/conversations/{id}` and `GET /v1/conversations/{id}/items`. Deleting a conversation deletes the stored responses of its turns, and is 409 `response_in_progress` while a turn runs in it. What the list holds and how it is ordered, what the history holds (a turn that did not complete included, its items `incomplete`), that an update replaces the metadata whole and does not renew retention, and what a delete removes are written in the OpenAPI as amendments, 2026-11-26, that a maintainer accepted on 2026-12-02. `POST /v1/responses` runs its turn in the conversation `conversation` names, in the one the turn `previous_response_id` names ran in, or in a new one; a conversation runs one turn at a time, and the `Response` names its conversation. A conversation is a record of its turns and is not a dashboard chat. The `Idempotency-Key` header is not read, `crew.latest_seq` and `needs_approval` are not reported, and no `conversation.created` event is sent: the instance stream is not built. `GET /v1/crew/events` is served for the machine owner as the conversation stream in paged JSON, with `since`, `limit` and `wait` (`src/kiro_crew/dashboard/crew_api_events.py`, `src/kiro_crew/dashboard/crew_api_event_records.py`): it holds `turn.started`, `message.created` and `turn.completed` for the turns `POST /v1/responses` runs in the conversation, and `approval.requested` and `approval.decided` for the tool approvals those turns wait on: such an approval gets its `apr_` id when it is raised, not when an Owner approval route first lists it. The instance stream, the SSE form, the other event types, the retention setting and the ceilings on streams are not built. `POST /v1/responses/{response_id}/cancel` is served for the machine owner (`src/kiro_crew/dashboard/crew_api_response_cancel.py`): it stops a running turn and answers its `Response`, and a tool approval the turn was waiting on reads `expired` with reason `turn_cancelled`. What it answers when the turn has not ended within the stop limit (200 `in_progress`), what a turn that ended by itself meanwhile reads, that a turn that is not kept cannot be cancelled (404), and that `Idempotency-Key` and the body are not read are written in the OpenAPI as amendments, 2026-12-01, that a maintainer accepted on 2026-12-02. `GET /v1/crew/approvals` and `GET /v1/crew/approvals/{approval_id}` are served for the machine owner, read only (`src/kiro_crew/dashboard/crew_api_public_approvals.py`): they list and read the tool approvals of the turns that run in a conversation of this API. Which approvals they hold, that an approval from before a gateway restart is read from the Owner routes alone, what `answerable_by_you` means, that `expires_at` and `approval_url` are not given, and that `decided_by` holds `kind` alone are written in the OpenAPI as amendments, 2026-12-01, that a maintainer accepted on 2026-12-02. How a conversation's `seq` is counted, that its events are kept and deleted with it, when `message.created` is sent, what `approval.requested` and `approval.decided` carry (`approval_id` and no `tool` or `reason`; `state`, and `expired_reason` for an expired one), what a reader is told when an event could not be stored (410 `resync_required`), and that at most 10 requests wait at once are written in the OpenAPI as amendments, 2026-11-27, that a maintainer accepted on 2026-12-02, except item (4), which stays proposed. How a later turn is given the earlier ones, how large a conversation can grow (100 KiB of text, the limit one request's input already has) and how long it and the turns that ran in it are kept (30 days after its latest turn, the retention a stored response already has) are written in the OpenAPI as amendments, 2026-11-26, that a maintainer accepted on 2026-12-02. The `bots:chat` amendment, 2026-12-02 (what the scope allows, the grant's memory setting, the reason a delegated credential cannot answer an approval, the residual risk and Q12), was accepted by maintainer buluoray on 2026-12-02, as recorded in [#45825](https://github.com/kirodotdev/KiroCrew/issues/45825). None of it is built: `POST /v1/responses` is served for the machine owner alone, no app credential runs a turn, a grant stores no memory setting, and the grant's memory setting is not in the OpenAPI schema yet. The rest is not built. This document changes no code. - Machine-readable contract: the OpenAPI 3.1 drafts in [`assets/crew-api/`](assets/crew-api/crew-public.yaml): `crew-public.yaml` (the Public tier), `crew-owner.yaml` (the Owner tier) and `components.yaml` (shared schemas). Both `openapi-spec-validator` and `@redocly/cli lint` pass on them with the @@ -599,7 +599,7 @@ listed here so the count is not read as "everything the gateway exposes": | The wrapped Owner route for the Bot roster | Wraps `GET /api/members` | The owner | 1b | In `crew-owner.yaml` | | Local authorization: `GET /oauth/authorize`, `POST /oauth/token`, `POST /oauth/revoke`, `GET /.well-known/oauth-authorization-server` on the local gateway | A client on the same machine asks for a grant | Programs on the same machine; consent needs the host owner's credential through the Owner API | 1a | No OpenAPI; parameters follow OAuth 2.1 and RFC 8414 | | The owner's side of local authorization: `GET /v1/crew/owner/grant-requests`, `POST /v1/crew/owner/grant-requests/{request_id}/decision` (amendment, 2026-11-19) | The host owner lists the waiting grant requests and approves or denies one | Host-owner credential, including authenticated remote access; Shared Crew teammates and app credentials get 403 `owner_only`. Rule 5 of this RFC (the Owner tier is for the owner only) already requires this | 1a | In `crew-owner.yaml` (amendment) | -| Reading one request and ending a local grant: `GET /v1/crew/owner/grant-requests/{request_id}`, `DELETE /v1/crew/owner/grants/{id}` for a grant made through local authorization (amendment, 2026-11-20, proposed) | The host owner reads how one request was answered and which grant it led to, and revokes that grant | Host-owner credential; Shared Crew teammates and app credentials get 403 `owner_only`, by rule 5 | 1a | In `crew-owner.yaml` (amendment) | +| Reading one request and ending a local grant: `GET /v1/crew/owner/grant-requests/{request_id}`, `DELETE /v1/crew/owner/grants/{id}` for a grant made through local authorization (amendment, 2026-11-20; accepted by a maintainer on 2026-12-02) | The host owner reads how one request was answered and which grant it led to, and revokes that grant | Host-owner credential; Shared Crew teammates and app credentials get 403 `owner_only`, by rule 5 | 1a | In `crew-owner.yaml` (amendment) | | Tool approvals without a dashboard: `GET /v1/crew/owner/approvals`, `GET /v1/crew/owner/approvals/{approval_id}`, `POST /v1/crew/owner/approvals/{approval_id}/decision` (amendment, 2026-11-20; accepted by a maintainer on 2026-11-24, as recorded in [#42226](https://github.com/kirodotdev/KiroCrew/issues/42226)) | The host owner lists tool approvals, reads one and answers one with `allow` or `deny`. Each request gets one `apr_` id. The id, its state, its times, why it expired (`expired_reason`) and its session are kept on disk; the tool's name, the reason the tool gave and its arguments are not (amendment, 2026-11-24; accepted by a maintainer on 2026-11-25, on [#41999](https://github.com/kirodotdev/KiroCrew/pull/41999#issuecomment-7154845995)). After a restart an old approval is still there to read. A row still `pending` on disk reads `expired` with reason `gateway_restart`, whether its request was still waiting or had ended without its ending being written. An ending written to the file keeps its state. Neither can be answered. A one-request `POST /v1/responses` turn is not recorded for restart recovery. `POST /api/restart` and Slack's `/kirocrew restart` record other chat slots with a running turn before closing sessions. `POST /api/restart` remains available on a headless gateway under its existing caller checks. Plain `kirocrew restart` uses the service manager or stops the gateway and starts a replacement; it does not write this record. `kirocrew restart --when-idle` checks and holds idle admission before using that same CLI restart path; it does not record running turns. `POST /api/update` arms an update for the next start without restarting the gateway. Scheduled update checks stage a managed-venv update or announce an update without restarting the gateway. On the next start, with or without a dashboard, the gateway reads and deletes the restart record it finds, and resumes only from a valid one no older than 30 minutes. It attempts to resume the recorded chats through Resume-all, subject to that path's eligibility checks and refusals. Without a valid record, this startup recovery path resumes no chats. If a resumed chat needs another tool approval, the first Owner route that observes it gives it a new `apr_` id. The old pending approval stays `expired` with reason `gateway_restart` and cannot be answered. The host owner finds the new approval through `GET /v1/crew/owner/approvals`, using its `conversation` query parameter to select the same session key returned in the approval's `conversation` response field. Where this differs from the States row of the Approvals table: when the turn that waited is cancelled, the approval reads `expired` with reason `timeout`, not `turn_cancelled`; when a Stop rejects a chat turn's own waiting prompt, it reads `denied`. Only one of the two approval paths records that a turn was cancelled, and reporting `turn_cancelled` on both needs a change to the shared `interaction_coordinator`, which a later PR makes. Proposed and not in this amendment: the Timeout row's limit of 4 minutes 30 seconds (these routes set no limit of their own; a request keeps the wait the gateway already gives it), an approval that stays answerable across a gateway restart, a pointer from an old approval to the request that asks again, `allow_always`, an answer from a Shared Crew teammate, `expires_at`, the `final` field of the 409 body, and `conv_` ids (`conversation` is the session's key until the conversation operations exist) | Host-owner credential, including authenticated remote access; Shared Crew teammates, app credentials and loopback internal callers get 403 `owner_only` | 1a | In `crew-owner.yaml` (amendment) | | Embed page: `GET /embed` and its sign-in routes | The embedded page where the user signs in and answers approvals; `/embed?approval=` shows one approval | Reachable without a token; reads no conversation data | 2 | No OpenAPI yet | | Site connection: `GET /connect/start`, `GET /connect/callback` | Connects the user's account at an app's site when the app's MCP server needs it | Reachable without a token; accepts only a one-time code and `state` | 2 | No OpenAPI yet | @@ -609,8 +609,9 @@ listed here so the count is not read as "everything the gateway exposes": The routes that are reachable without a token need a specification as detailed as the `/v1` operations before phase 2 starts ([Q8](#open-questions)). -**Local authorization: how the app waits for the owner** (amendment, 2026-11-19; proposed with the -pull request that builds the four routes, and in force once a maintainer merges it). +**Local authorization: how the app waits for the owner** (amendment, 2026-11-19; accepted by a +maintainer on 2026-12-02, except the last sentence, "Proposals to be confirmed", which stays +proposed). A machine that runs Kiro Crew as a server often has no browser, and the owner answers some time after the app asks. So `GET /oauth/authorize` never grants by itself: @@ -632,8 +633,9 @@ the relay or another entry gets 404. Each request and grant stores a `namespace` to be confirmed: a request waits 10 minutes, a code lives 60 seconds, a refresh token expires after 24 hours unused and 7 days in all, and at most 5 requests wait per `client_id` and 20 in all. -**Local authorization: what the owner reads and ends** (amendment, 2026-11-20; proposed, to be -accepted by a maintainer): +**Local authorization: what the owner reads and ends** (amendment, 2026-11-20; accepted by a +maintainer on 2026-12-02, except three sentences in item 2 that stay proposed: the ones that begin +"The app is expected to send", "Unlike `scopes`" and "The grants list returns"): 1. `GET /v1/crew/owner/grant-requests/{request_id}` returns one request, answered or not. It is added to `crew-owner.yaml` and is not counted in the 59. The request stays readable until it @@ -678,7 +680,7 @@ accepted by a maintainer): call answers the same 200 until the grant's own expiry, then 404. Such a grant has no outside issuer, so nothing is sent over the control channel. 4. `GET /v1/crew/owner/grants`, already in this RFC, is served for grants made through local - authorization (amendment, 2026-11-24; proposed, to be accepted by a maintainer). It lists the + authorization (amendment, 2026-11-24; accepted by a maintainer on 2026-12-02). It lists the grants that work now, oldest first, paged with `after` and `limit`. A revoked or expired grant is not listed, under any `status`; neither is one whose refresh token has run out unused, because it can mint no token again. An `after` that names no grant in the list, one revoked