Skip to content

[Agents] Sync Agents SDK docs#31688

Open
threepointone wants to merge 1 commit into
productionfrom
agents-docs-sync-2026-06
Open

[Agents] Sync Agents SDK docs#31688
threepointone wants to merge 1 commit into
productionfrom
agents-docs-sync-2026-06

Conversation

@threepointone

Copy link
Copy Markdown
Contributor

Summary

Documents user-facing Agents SDK features that were missing from the docs.

  • Agent tools — detached (background) runs, progress reporting, and durable milestones.
  • Chat agentsuseAgentChat's syncMessagesToServer option and the agents/chat/react entry.
  • Sub-agents / Run workflows — workflows started from sub-agents, with RPC, callbacks, state, and broadcasts routed back to the originating facet.
  • get-current-agent — when agent context is lost (e.g. Worker Loader RPC) and how to re-establish it.
  • Think — the unified runTurn() turn API, plus new Actions and Channels pages.

Test plan

  • pnpm run dev renders all changed/new pages (verified locally: /agents/harnesses/think/, /agents/harnesses/think/actions/, /agents/harnesses/think/channels/, agent-tools, run-workflows, sub-agents, get-current-agent, chat-agents).
  • Prettier check passes on changed MDX.

Made with Cursor

Document user-facing features shipped in the Agents SDK:

- agent-tools: detached (background) runs, progress reporting, and durable
  milestones
- chat-agents: useAgentChat syncMessagesToServer option and agents/chat/react
- sub-agents / run-workflows: workflows started from sub-agents and RPC routing
  back to the originating facet
- get-current-agent: when agent context is lost and how to re-establish it
- think: unified runTurn() turn API plus new Actions and Channels docs

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. size/l labels Jun 25, 2026
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 5 warnings, 💡 10 suggestions found in commit a607800. ⚠️ Part of the review could not complete and will retry on the next push.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

❌ This review could not complete this run; results may be incomplete. It will retry on the next push.

Style Guide Review

Warnings (5)
File Issue
agents/runtime/execution/agent-tools.mdx line 234 Number and unit spacing — Prose uses 24h without a space (default 24h). Fix: Add a space: 24 h.
agents/runtime/execution/agent-tools.mdx line 313 Avoid directional words — Code comment contains (see below). Fix: Replace with a named reference or link to the relevant section.
agents/runtime/execution/agent-tools.mdx line 388 Avoid gerund headings — Heading starts with the -ing verb Resetting. Fix: Use the imperative form: Reset no-progress budget for detached runs.
agents/runtime/execution/run-workflows.mdx line 265 Headings should use imperative form, not -ing — Heading adds #### Starting workflows from sub-agents Fix: Change to #### Start workflows from sub-agents
agents/runtime/execution/run-workflows.mdx line 593 Avoid directional words like above — Line contains methods described above Fix: Replace with a direct reference, e.g., the methods described in this page or a link
Suggestions (10)
File Issue
agents/harnesses/think/actions.mdx line 24 Semicolon joining independent clauses — Line uses a semicolon to join Return them from \getActions()`andThink merges them...` Fix: Break into two sentences.
agents/harnesses/think/actions.mdx line 128 Semicolon joining independent clauses — Line uses a semicolon to join The action parks into a durable store and the turn ends and \execute` does not run yet` Fix: Break into two sentences.
agents/runtime/execution/agent-tools.mdx line 312 Avoid Latin abbreviations — Code comment uses e.g.. Fix: Replace with for example.
agents/runtime/execution/agent-tools.mdx line 232 Semicolon joining independent clauses — Bullet uses a semicolon to join independent clauses (Delivery is exactly-once on the happy path; under a crash it is at-least-once...). Fix: Split into two sentences or rewrite with a conjunction.
agents/harnesses/think/channels.mdx line 86 Use active voice — Line adds "Channel policy is applied as an **overridable default** before beforeTurn runs". Fix: Rewrite in active voice, e.g. "The agent applies channel policy as an overridable default before beforeTurn runs."
agents/harnesses/think/channels.mdx line 88 Use active voice — Line adds "- instructions is prepended to the base system prompt for the turn." Fix: Rewrite in active voice, e.g. "- instructions prepends to the system prompt for the turn."
agents/harnesses/think/channels.mdx line 153 Use active voice — Line adds "Channel activity is reported on the channel observability channel:" Fix: Rewrite in active voice, e.g. "Reporting happens on the channel observability channel." or specify what reports the activity.
agents/harnesses/think/index.mdx line 231 Avoid see [link] phrasing — Bullet uses See [Programmatic submissions](/agents/harnesses/think/programmatic-submissions/) Fix: Replace with refer to [Programmatic submissions]
agents/harnesses/think/index.mdx line 238 Avoid semicolons joining independent clauses — Sentence joins two independent clauses with a semicolon: Each shortcut has an unchanged signature; reach for them... Fix: Break into two sentences
agents/runtime/execution/run-workflows.mdx line 593 Avoid etc. — Line ends with deleteWorkflow(), etc.Fix: Replace with a complete list orand so on`
Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/agents/ @irvinebroque, @rita3ko, @elithrar, @thomasgauvin, @threepointone, @whoiskatrin, @cloudflare/product-owners, @cloudflare/ai-agents, @cloudflare/dev-plat-leads

@ask-bonk

ask-bonk Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review for PR #31688

Summary

This PR syncs user-facing Agents SDK documentation across 8 files. It introduces two new reference pages for Think — Actions (idempotency, approvals, authorization, reply attachments) and Channels (per-channel policy, out-of-band delivery) — and expands existing pages with:

  • think/index.mdx — Unified runTurn() API (wait/submit/stream modes), addMessages() for transcript injection, and CardGrid links to the new pages.
  • agent-tools.mdx — Detached/background runs, reportProgress(), durable milestones, onMilestones chat notifications, and no-progress budgets.
  • run-workflows.mdx — Starting workflows from sub-agents, routing constraints (agentBinding, bundler keepNames), and sub-agent scoping notes.
  • sub-agents.mdx — Workflow delegation from sub-agents and RPC-only stub behavior.
  • get-current-agent.mdx — "When context is lost" section with the RpcTarget bridge pattern for restoring agent context.
  • chat-agents.mdxsyncMessagesToServer option and the agents/chat export entry.

Labels

documentation, agents


Issues needing attention

1. Missing import in get-current-agent.mdx example

The new HostCallbackBridge example uses McpAgent but does not import it.

Suggested fix:

 import { RpcTarget } from "cloudflare:workers";
+import { McpAgent } from "agents/mcp";
 
 class HostCallbackBridge extends RpcTarget {

2. setMessages description is now conditional

The return-values table in chat-agents.mdx says setMessages "syncs to server" unconditionally, but the PR adds syncMessagesToServer: false, which skips the server push. Consider updating the description to reflect the new default behavior.

Suggested fix:

-| `setMessages`             | `(messages \| updater) => void`    | Set messages directly (syncs to server)                                                                                                                                                                                                       |
+| `setMessages`             | `(messages \| updater) => void`    | Set messages directly (syncs to server when `syncMessagesToServer` is `true`, the default)                                                                                                                                                    |

Validation results

  • pnpm run check — 0 errors
  • pnpm run format:core:check — all changed files pass Prettier
  • ✅ Frontmatter — all required fields present; pcx_content_type values valid
  • ✅ Internal links — verified target pages exist
  • ✅ MDX — no unescaped {, }, <, > in prose; no relative links; no heading-level skips
  • ✅ Sidebar ordering — 4.5 and 7.5 are valid floats and sort correctly between existing integer orders

The two items above are minor and can be fixed inline before merge.

github run

@github-actions

Copy link
Copy Markdown
Contributor

Preview URL: https://a607800a.preview.developers.cloudflare.com
Preview Branch URL: https://agents-docs-sync-2026-06.preview.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/agents/harnesses/think/actions/ https://agents-docs-sync-2026-06.preview.developers.cloudflare.com/agents/harnesses/think/actions/
https://developers.cloudflare.com/agents/runtime/execution/agent-tools/ https://agents-docs-sync-2026-06.preview.developers.cloudflare.com/agents/runtime/execution/agent-tools/
https://developers.cloudflare.com/agents/harnesses/think/channels/ https://agents-docs-sync-2026-06.preview.developers.cloudflare.com/agents/harnesses/think/channels/
https://developers.cloudflare.com/agents/harnesses/think/ https://agents-docs-sync-2026-06.preview.developers.cloudflare.com/agents/harnesses/think/
https://developers.cloudflare.com/agents/runtime/execution/run-workflows/ https://agents-docs-sync-2026-06.preview.developers.cloudflare.com/agents/runtime/execution/run-workflows/
https://developers.cloudflare.com/agents/runtime/lifecycle/get-current-agent/ https://agents-docs-sync-2026-06.preview.developers.cloudflare.com/agents/runtime/lifecycle/get-current-agent/
https://developers.cloudflare.com/agents/communication-channels/chat/chat-agents/ https://agents-docs-sync-2026-06.preview.developers.cloudflare.com/agents/communication-channels/chat/chat-agents/
https://developers.cloudflare.com/agents/runtime/execution/sub-agents/ https://agents-docs-sync-2026-06.preview.developers.cloudflare.com/agents/runtime/execution/sub-agents/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. size/l

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants