Skip to content

[Teams] cleanup#610

Merged
TownLake merged 6 commits into
productionfrom
structure-7
Jan 6, 2021
Merged

[Teams] cleanup#610
TownLake merged 6 commits into
productionfrom
structure-7

Conversation

@abracchi-tw

Copy link
Copy Markdown
Contributor

No description provided.

@TownLake
TownLake merged commit f7d3f21 into production Jan 6, 2021
@TownLake
TownLake deleted the structure-7 branch January 6, 2021 17:29
agents-git-bot Bot pushed a commit that referenced this pull request Nov 25, 2025
Adds comprehensive documentation for the new readonly connections feature introduced in PR #610.

Key additions:
- Server-side methods: shouldConnectionBeReadonly(), setConnectionReadonly(), isConnectionReadonly()
- Client-side API: onStateUpdateError callback for error handling
- Multiple usage examples covering common scenarios (query params, RBAC, admin dashboards, dynamic permissions)
- Implementation details including SQL persistence and hibernation support
- Best practices for authentication, user feedback, and access control

This feature allows restricting certain WebSocket connections from modifying agent state while still allowing them to receive state updates and call RPC methods.

Related PR: cloudflare/agents#610

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
agents-git-bot Bot pushed a commit that referenced this pull request Nov 27, 2025
Synced from cloudflare/agents PR #610 (cloudflare/agents#610)

Introduces documentation for the readonly connections feature which allows restricting certain WebSocket connections from modifying Agent state while still allowing them to receive state updates and call RPC methods.

Key features documented:
- Server-side methods: shouldConnectionBeReadonly, setConnectionReadonly, isConnectionReadonly
- Client-side API: onStateUpdateError callback
- Usage examples for query parameter based access, role-based access control, admin dashboards, and dynamic permission changes
- Behavior details, best practices, and migration guide
- Implementation details including persistence across hibernation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
agents-git-bot Bot pushed a commit that referenced this pull request Feb 8, 2026
Sync documentation for PR #610 from cloudflare/agents repository.

Adds comprehensive documentation for the new readonly connections feature,
which allows restricting WebSocket connections from modifying agent state
while still allowing them to receive state updates and call RPC methods.

Key additions:
- Server-side methods: shouldConnectionBeReadonly, setConnectionReadonly, isConnectionReadonly
- Client-side API: onStateUpdateError callback
- Usage examples for query parameters, RBAC, admin dashboards, and dynamic permissions
- Behavior details including state sync and connection cleanup
- Best practices for authentication, user feedback, and permission checks
- Migration guide for existing agents

Source PR: cloudflare/agents#610
@agents-git-bot agents-git-bot Bot mentioned this pull request Feb 8, 2026
4 tasks
elithrar added a commit that referenced this pull request Feb 8, 2026
* Add readonly connections documentation

Sync documentation for PR #610 from cloudflare/agents repository.

Adds comprehensive documentation for the new readonly connections feature,
which allows restricting WebSocket connections from modifying agent state
while still allowing them to receive state updates and call RPC methods.

Key additions:
- Server-side methods: shouldConnectionBeReadonly, setConnectionReadonly, isConnectionReadonly
- Client-side API: onStateUpdateError callback
- Usage examples for query parameters, RBAC, admin dashboards, and dynamic permissions
- Behavior details including state sync and connection cleanup
- Best practices for authentication, user feedback, and permission checks
- Migration guide for existing agents

Source PR: cloudflare/agents#610

* Split mixed TS+JSX code block to fix build

Co-authored-by: elithrar <elithrar@users.noreply.github.com>

* Fix build: unwrap JSX code blocks from TypeScriptExample

TypeScriptExample uses ts-blank-space to strip TypeScript types, but
ts-blank-space doesn't understand JSX syntax — it misinterprets JSX
tags as generics, 'as' in JSX text as type assertions, and '!' as
non-null assertions. This caused:

1. GameComponent block: <div> tag blanked out entirely, breaking
   Prettier's babel parser with 'Adjacent JSX elements' error
2. EditButton block: !canEdit silently corrupted to canEdit in the
   generated JavaScript tab

Fix by removing the TypeScriptExample wrapper from these two JSX
blocks, using plain fenced tsx code blocks instead (matching the
pattern used in quick-start.mdx and guides/webhooks.mdx).

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: elithrar <elithrar@users.noreply.github.com>
agents-git-bot Bot pushed a commit that referenced this pull request Feb 8, 2026
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>
whoiskatrin added a commit that referenced this pull request Feb 11, 2026
…ebSocket clients from modifying agent state (#28197)

* Sync documentation for PR #610: readonly connections and onStateChanged

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>

* Fix build: wrap @callable() code snippets in class declarations

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'.

* Wrap @callable() snippets in class bodies

Co-authored-by: whoiskatrin <whoiskatrin@users.noreply.github.com>

* Apply suggestions from code review

* Delete package-lock.json

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: whoiskatrin <whoiskatrin@users.noreply.github.com>
Co-authored-by: Jun Lee <junlee@cloudflare.com>
Co-authored-by: whoiskatrin <kreznykova@cloudflare.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants