Skip to content

docs: Document Agent.clone_for_channel() method and multi-channel gateway isolation#458

Merged
MervinPraison merged 1 commit into
mainfrom
claude/issue-448-20260530-0622
Jun 3, 2026
Merged

docs: Document Agent.clone_for_channel() method and multi-channel gateway isolation#458
MervinPraison merged 1 commit into
mainfrom
claude/issue-448-20260530-0622

Conversation

@MervinPraison
Copy link
Copy Markdown
Owner

Fixes #448

Summary

  • Created new docs/features/agent-cloning.mdx page documenting the Agent.clone_for_channel() method
  • Updated docs/features/bot-gateway.mdx with channel isolation explanation and accordion
  • Updated docs/features/channels-gateway.mdx with multi-channel reliability note
  • Updated docs/features/messaging-bots.mdx with gateway cloning tip
  • Updated docs/features/thread-safety.mdx with deep-copy support section
  • Updated docs.json to add the new page under Features group

Documentation Changes

The new documentation covers:

  • Quick start examples for single and multi-channel cloning
  • Visual Mermaid diagrams explaining the cloning process
  • Comprehensive table of what gets cloned vs reset
  • Common usage patterns (per-channel, per-tenant, with deepcopy)
  • Best practices with accordions
  • Cross-references to related pages

Validation

  • All code examples use proper imports and are copy-paste runnable
  • Mermaid diagrams follow the standard color scheme
  • docs.json validated as valid JSON
  • All pages follow AGENTS.md template requirements

🤖 Generated with Claude Code

… gateway isolation (fixes #448)

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

Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 30, 2026 06:25
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

Warning

Review limit reached

@MervinPraison, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 40 minutes and 38 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b28f3237-8236-4285-9139-4c2985fbcbfb

📥 Commits

Reviewing files that changed from the base of the PR and between ad3daba and a739a8b.

📒 Files selected for processing (6)
  • docs.json
  • docs/features/agent-cloning.mdx
  • docs/features/bot-gateway.mdx
  • docs/features/channels-gateway.mdx
  • docs/features/messaging-bots.mdx
  • docs/features/thread-safety.mdx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-448-20260530-0622

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 and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces documentation for the new "Agent Cloning" feature, which allows safely cloning agents for multi-channel, multi-tenant, or per-session isolation, resolving previous RLock pickling errors. The documentation updates span several files, including bot-gateway, channels-gateway, messaging-bots, and thread-safety. The review feedback highlights several instances where internal links should be updated to use the full /docs/features/... path instead of /features/... to ensure consistency and prevent unnecessary redirects.

Comment on lines +183 to +188
<Card title="Bot Gateway" icon="server" href="/features/bot-gateway">
Multi-channel gateway using agent cloning
</Card>
<Card title="Thread Safety" icon="shield" href="/features/thread-safety">
Agent thread safety and concurrency
</Card>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To maintain consistency with the rest of the documentation and avoid unnecessary redirects, internal links should use the full /docs/features/... path instead of /features/....

<Card title="Bot Gateway" icon="server" href="/docs/features/bot-gateway">
  Multi-channel gateway using agent cloning
</Card>
<Card title="Thread Safety" icon="shield" href="/docs/features/thread-safety">
  Agent thread safety and concurrency
</Card>

style Clone1,Clone2,Clone3 fill:#10B981,color:#fff
```

Each clone has fresh locks and interrupt controllers, preventing cross-channel interference. Learn more about [Agent Cloning](/features/agent-cloning).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Update the internal link to use the full /docs/features/... path to ensure consistency and prevent redirects.

  Each clone has fresh locks and interrupt controllers, preventing cross-channel interference. Learn more about [Agent Cloning](/docs/features/agent-cloning).

This starts Pattern B host integration with channels feature enabled.

<Note>
All configured channels now start reliably from a single gateway, resolving the previous `cannot pickle '_thread.RLock' object` error through automatic [Agent Cloning](/features/agent-cloning).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Update the internal link to use the full /docs/features/... path to ensure consistency and prevent redirects.

All configured channels now start reliably from a single gateway, resolving the previous `cannot pickle '_thread.RLock' object` error through automatic [Agent Cloning](/docs/features/agent-cloning).

```

<Tip>
Behind the scenes the gateway calls `Agent.clone_for_channel()` on the configured agent for each channel, so per-channel tools or routing rules never leak between bots. See [Agent Cloning](/features/agent-cloning).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Update the internal link to use the full /docs/features/... path to ensure consistency and prevent redirects.

Behind the scenes the gateway calls `Agent.clone_for_channel()` on the configured agent for each channel, so per-channel tools or routing rules never leak between bots. See [Agent Cloning](/docs/features/agent-cloning).

Comment on lines +206 to +208
<Card title="Agent Cloning" icon="copy" href="/features/agent-cloning">
Clone agents for channel isolation
</Card>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Update the internal link to use the full /docs/features/... path to ensure consistency and prevent redirects.

<Card title="Agent Cloning" icon="copy" href="/docs/features/agent-cloning">
  Clone agents for channel isolation
</Card>

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@MervinPraison MervinPraison merged commit c3718cb into main Jun 3, 2026
26 of 27 checks passed
@MervinPraison MervinPraison deleted the claude/issue-448-20260530-0622 branch June 3, 2026 04:49
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.

docs: Document new Agent.clone_for_channel() method and multi-channel gateway isolation (PR #1755 / Issue #1746)

2 participants