Skip to content

docs(sdk): describe chat.turn() in the advanced chat agent skill - #4902

Merged
ericallam merged 3 commits into
mainfrom
docs/skill-actions-chat-turn
Sep 10, 2026
Merged

docs(sdk): describe chat.turn() in the advanced chat agent skill#4902
ericallam merged 3 commits into
mainfrom
docs/skill-actions-chat-turn

Conversation

@ericallam

Copy link
Copy Markdown
Member

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:

onAction: async ({ action, streamText }) => {
  if (action.type === "regenerate") {
    chat.history.slice(0, -1);
    return streamText({ model, messages });
  }
},

After:

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.ai/code/session_01AxuSksX18bj1yhnLpkcQ6a

The bundled skill still told an action to return a StreamTextResult, string
or UIMessage to answer, an API #4816 removed. It now describes edit-only
actions, chat.turn() for an answer, the action-turn trigger, persistence for
both models, and sending actions through useChat.
@changeset-bot

changeset-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 32d46a0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 6ac3823e-0497-4dde-9ffa-f2c64d078d1c

📥 Commits

Reviewing files that changed from the base of the PR and between f02d837 and 32d46a0.

📒 Files selected for processing (1)
  • packages/trigger-sdk/skills/trigger-chat-agent-advanced/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/trigger-sdk/skills/trigger-chat-agent-advanced/SKILL.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (44)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (13, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (20, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (23, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (15, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (17, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (12, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (11, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (24, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (18, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (16, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (22, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (14, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (21, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (19, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 24)
  • GitHub Check: sdk-compat / Cloudflare Workers
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 24)
  • GitHub Check: sdk-compat / Node.js 20.20 (warp-ubuntu-latest-x64-4x)
  • GitHub Check: sdk-compat / Node.js 26.4 (warp-ubuntu-latest-x64-4x)
  • GitHub Check: sdk-compat / Node.js 24.18 (warp-ubuntu-latest-x64-4x)
  • GitHub Check: sdk-compat / Node.js 22.23 (warp-ubuntu-latest-x64-4x)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (3, 3)
  • GitHub Check: sdk-compat / Bun Runtime
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp (1, 2)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (2, 3)
  • GitHub Check: sdk-compat / Deno Runtime
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp (2, 2)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 3)
  • GitHub Check: fk-cascade-guard / fk-cascade-guard
  • GitHub Check: internal / 🧪 Unit Tests: Internal
  • GitHub Check: runops-guard / runops-guard
  • GitHub Check: code-quality / code-quality
  • GitHub Check: audit
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
  • GitHub Check: Build and publish previews

Walkthrough

The actions documentation separates edit-only actions from actions that call chat.turn(). It removes the previous streamText response behavior and documents normal turn processing for returned turns. The example adds message deletion and regeneration. Submission guidance now covers useChat, useChatActions, regenerate, and transport.sendAction.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 32d46

This updates bundled chat-action guidance to document edit-only actions, turn handling, regeneration, and submission APIs. No concrete merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides detailed context and accurately explains the documentation change, but it does not follow the repository template. It omits the required issue-closing line, checklist, Testing… Add the required template sections and information: Closes #<issue>, the checklist, testing steps, a short changelog entry, and screenshots or an explicit statement that screenshots are not applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: documenting chat.turn() in the advanced chat agent skill. It is concise and relevant.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description provides detailed context and accurately explains the documentation change, but it does not follow the repository template. It omits the required issue-closing line, checklist, Testing section, Changelog section, and Screenshots section.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/skill-actions-chat-turn

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ericallam
ericallam marked this pull request as ready for review September 9, 2026 13:32
@ericallam

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

devin-ai-integration[bot]

This comment was marked as resolved.

…at-turn

# Conflicts:
#	packages/trigger-sdk/skills/trigger-chat-agent-advanced/SKILL.md

Co-authored-by: ericallam <534+ericallam@users.noreply.github.com>

Copilot AI commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in f02d837 by merging origin/main into this branch and fixing the conflict in packages/trigger-sdk/skills/trigger-chat-agent-advanced/SKILL.md.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

…te()

Document that useChat's regenerate() removes the last assistant message
before streaming, while sendMessage with a regenerate action appends
without removal, leaving both answers visible.

Co-authored-by: Eric Allam <ericallam@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Sep 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

npm i https://pkg.pr.new/@trigger.dev/build@32d46a0

trigger.dev

npm i https://pkg.pr.new/trigger.dev@32d46a0

@trigger.dev/core

npm i https://pkg.pr.new/@trigger.dev/core@32d46a0

@trigger.dev/python

npm i https://pkg.pr.new/@trigger.dev/python@32d46a0

@trigger.dev/react-hooks

npm i https://pkg.pr.new/@trigger.dev/react-hooks@32d46a0

@trigger.dev/redis-worker

npm i https://pkg.pr.new/@trigger.dev/redis-worker@32d46a0

@trigger.dev/rsc

npm i https://pkg.pr.new/@trigger.dev/rsc@32d46a0

@trigger.dev/schema-to-json

npm i https://pkg.pr.new/@trigger.dev/schema-to-json@32d46a0

@trigger.dev/sdk

npm i https://pkg.pr.new/@trigger.dev/sdk@32d46a0

commit: 32d46a0

@ericallam
ericallam added this pull request to the merge queue Sep 10, 2026
Merged via the queue into main with commit 4f8587c Sep 10, 2026
63 checks passed
@ericallam
ericallam deleted the docs/skill-actions-chat-turn branch September 10, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants