Sync docs for agents PR #610: feat: readonly connections — restrict WebSocket clients from modifying agent state#28197
Conversation
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
Updates from cloudflare/agents PR #610 (feat: readonly connections): ## Major changes 1. **Readonly connections feature** (readonly-connections.mdx): - Updated implementation details: uses connection state wrapping instead of SQL - Clarified enforcement for @callable() methods that call setState() - Added "What readonly does and does not restrict" table - Added caveats section about side effects in callables - Removed outdated SQL storage implementation details - Updated "How it works" section to reflect connection attachment storage 2. **onStateUpdate → onStateChanged rename**: - Renamed server-side hook from onStateUpdate to onStateChanged - Updated across all documentation files - Client-side onStateUpdate callback remains unchanged ## Updated files - api-reference/readonly-connections.mdx - major rewrite with corrected implementation - api-reference/store-and-sync-state.mdx - renamed onStateUpdate to onStateChanged - api-reference/agents-api.mdx - renamed hook references - api-reference/client-sdk.mdx - renamed hook references - concepts/agent-class.mdx - renamed hook references - getting-started/quick-start.mdx - renamed hook references - model-context-protocol/mcp-agent-api.mdx - renamed hook references Related upstream PR: cloudflare/agents#610 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
852366d to
d806a23
Compare
Updated Documentation SyncThis PR has been updated with the correct implementation details for the readonly connections feature from cloudflare/agents#610. Key Updates1. Readonly connections implementation (readonly-connections.mdx)
2. onStateUpdate → onStateChanged rename
Changed Files
Why the Force Push?The branch previously had an earlier sync attempt with outdated information (SQL-based readonly implementation). The latest upstream changes use connection state wrapping instead, which is what this update reflects. Source PR: cloudflare/agents#610 |
|
/bonk fix the build |
The Prettier/Babel parser requires decorators to be attached to class declarations. Three code blocks in readonly-connections.mdx had standalone @callable() decorators on methods outside of a class body, causing the build to fail with 'Leading decorators must be attached to a class declaration'.
Co-authored-by: whoiskatrin <whoiskatrin@users.noreply.github.com>
|
The fix is committed. Here's the summary: Root cause: Three code blocks in Fix: Wrapped all three standalone
|
|
/bonk resolve the conflicts please |
|
To https://github.com/cloudflare/cloudflare-docs |
|
Bonk workflow failed. Check the logs for details. |
…ction The PR branch accidentally deleted package-lock.json. Restore it from production which has the correct updated version.
Summary
This PR syncs documentation changes from cloudflare/agents#610 which adds readonly connections and deprecates
onStateUpdatein favor ofonStatePersisted.Changes
Readonly Connections Documentation Updates
readonly-connections.mdxto reflect the new connection state attachment storage method (instead of SQL tables)setState()and callable methods that callthis.setState()internallyonStateUpdateErroralso fires forvalidateStateChangerejectionsAPI Deprecation
onStateUpdate→onStatePersisted: Updated all references across all documentation filesstore-and-sync-state.mdxagent-class.mdxget-current-agent.mdxquick-start.mdxadd-to-existing-project.mdxwebhooks.mdxchatgpt-app.mdxmcp-agent-api.mdxclient-sdk.mdxagents-api.mdxreadonly-connections.mdxRelated
Testing
🤖 Generated with Claude Code