Skip to content

fcakyon/claude-codex-settings / plugins/cloudflare-skills/skills/agents-sdk

agents-sdk

Verified

Build, debug, or review Cloudflare Agents SDK applications using the agents package.

references/streaming-chat.md

View on GitHub
# Streaming Chat with AIChatAgent

Use `AIChatAgent` for persisted conversations with streaming and tools; use callable streaming RPC for non-chat output. Before adapting an existing app, check its installed `agents`, `@cloudflare/ai-chat`, and AI SDK versions against the current docs.

Read the relevant documentation before implementing:

| Task | Documentation |
|------|---------------|
| Build a chat agent | [Chat agent example](https://developers.cloudflare.com/agents/examples/chat-agent/index.md) — setup, provider, server, and UI |
| Implement or customize chat | [Chat agents](https://developers.cloudflare.com/agents/communication-channels/chat/chat-agents/index.md) — message format, tools, custom streams, persistence, concurrency, cancellation, and recovery |
| Connect a client | [Client guidance](client-sdk.md) — React, vanilla JS, HTTP, and authentication |
| Stream non-chat results | [Callable methods](https://developers.cloudflare.com/agents/runtime/lifecycle/callable-methods/index.md) — server and client streaming RPC |
| Trigger background turns | [Server-driven messages](server-driven-messages.md) |
| Add approvals | [Human-in-the-loop](human-in-the-loop.md) |

Forward the request abort signal to the model call so cancellation stops generation. When customizing streams, verify persistence and completion behavior for the installed version. Treat client reconnection and Durable Object eviction as separate recovery cases.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 197kUpdated Claude CodeCodexVerifiedInstall