Commit 4f8587c
docs(sdk): describe chat.turn() in the advanced chat agent skill (#4902)
## Summary
The bundled `trigger-chat-agent-advanced` skill still told agents to
answer from an action by returning a value, an API #4816 removed. Code
generated from it fails at runtime with the `chat.turn()` error.
Before, the skill said:
```ts
onAction: async ({ action, streamText }) => {
if (action.type === "regenerate") {
chat.history.slice(0, -1);
return streamText({ model, messages });
}
},
```
After:
```ts
onAction: async ({ action }) => {
if (action.type === "undo") chat.history.slice(0, -2); // edit only
if (action.type === "regenerate") {
chat.history.slice(0, -1);
return chat.turn(); // answer the edited history
}
},
```
The section now covers edit-only actions, `chat.turn()` and the
`action-turn` trigger, persistence for both the platform-managed and
`hydrateMessages` models, and sending actions through `useChat`
(`body.action` or `useChatActions`) so the answer renders, with
`transport.sendAction` noted as the raw-stream path.
Docs-only change to an SDK-bundled skill; no changeset, since the
`chat.turn()` release note from #4816 already covers the behavior.
Raised by Devin on #4884 after merge.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01AxuSksX18bj1yhnLpkcQ6a
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ericallam <534+ericallam@users.noreply.github.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Eric Allam <ericallam@users.noreply.github.com>1 parent c719f84 commit 4f8587c
1 file changed
Lines changed: 31 additions & 15 deletions
Lines changed: 31 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
201 | 206 | | |
202 | 207 | | |
203 | 208 | | |
204 | 209 | | |
205 | 210 | | |
206 | 211 | | |
| 212 | + | |
207 | 213 | | |
208 | 214 | | |
209 | 215 | | |
210 | | - | |
| 216 | + | |
211 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
212 | 222 | | |
213 | 223 | | |
214 | 224 | | |
215 | 225 | | |
216 | 226 | | |
217 | 227 | | |
218 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
219 | 235 | | |
220 | 236 | | |
221 | 237 | | |
| |||
0 commit comments