Skip to content

Commit b1fdca8

Browse files
ericallamclaude
andcommitted
docs(chat): the turn an action requests carries trigger action-turn
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AxuSksX18bj1yhnLpkcQ6a
1 parent 8029353 commit b1fdca8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/ai-chat/actions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ onAction: async ({ action }) => {
7575
}
7676
```
7777

78-
`run()` receives the edited history with no incoming user message, the same shape as a `regenerate-message` turn, and its `trigger` is `"action"`. Returning anything other than `chat.turn()` or nothing is an error; a response can no longer be returned from `onAction` directly.
78+
`run()` receives the edited history with no incoming user message, the same shape as a `regenerate-message` turn, and its `trigger` is `"action-turn"`, so a `run()` that returns early on `"action"` (the pre-May behaviour, when actions invoked `run()` directly) still answers. Returning anything other than `chat.turn()` or nothing is an error; a response can no longer be returned from `onAction` directly.
7979

8080
### Actions and persistence
8181

docs/ai-chat/reference.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The payload passed to the `run` function.
105105
| `streamText` | `typeof streamText` | The AI SDK's `streamText` with this agent's managed options already applied: the prompt, skill tools, telemetry, and the `prepareStep` that delivers steering, compaction and injected context. Prefer it over importing `streamText` from `ai`. See [The managed streamText](/ai-chat/backend#the-managed-streamtext). |
106106
| `chatId` | `string` | Your conversation ID (the session's `externalId`) |
107107
| `sessionId` | `string` | Friendly ID of the backing Session (`session_*`). Use with `sessions.open()` for advanced cases. Always set — every chat.agent run is bound to a Session. |
108-
| `trigger` | `"submit-message" \| "regenerate-message"` | What triggered the request |
108+
| `trigger` | `"submit-message" \| "regenerate-message" \| "action-turn"` | What triggered the request; `"action-turn"` is a turn requested by `chat.turn()` |
109109
| `messageId` | `string \| undefined` | Message ID (for regenerate) |
110110
| `clientData` | Typed by `clientDataSchema` | Custom data from the frontend (typed when schema is provided) |
111111
| `continuation` | `boolean` | Whether this run is continuing an existing chat (previous run ended) |

0 commit comments

Comments
 (0)