Apache Casbin Gateway
2. Agents

2.7 Chat channels

A chat channel lets you talk to an agent on this machine from Telegram or WeChat: the same conversation as on the Chat page, arriving from a phone. Chat channels is under Chat in the sidebar, and only an administrator sees it.

A channel polls out from this machine to the platform, so it needs no public address. A laptop behind a home router or an office firewall is fine.

Adding a channel

Add channel opens the form:

FieldWhat it is
NameWhat the channel is called here. It cannot be changed afterwards
PlatformTelegram or WeChat. It cannot be changed afterwards
Bot tokenTelegram only: the token @BotFather gave you. When editing, leave it empty to keep the stored one
WeChat sign-inWeChat only: see below
AgentWhich agent a new conversation talks to. The same agents as on Chat can be picked
Working directoryWhere that agent works. Empty is the home directory
Allowed usersWho may drive the agent — see below
ListeningWhether Gateway listens on this channel at all

The row on the page says whether a channel is Listening, Not listening, Off, or what the platform answered when it refused.

Signing WeChat in

WeChat has no token to paste. Give the channel a name, then press Show the code: Gateway saves the channel, asks WeChat for a sign-in code and draws it. Scan it with the WeChat account that will carry the bot, and the page says Signed in once WeChat confirms. The credential is written straight into the channel and never passes through the browser.

This is WeChat's own bot interface for personal accounts, not a third-party protocol. It carries one-to-one chats only.

Who may drive the agent

Allowed users is a list of the platform's own user IDs: the numeric user ID on Telegram, and the ID WeChat's bot interface gives the sender on WeChat. A message from anybody else is ignored without a reply.

An empty list lets anybody who finds the bot drive the agent on your machine, with the agent's access to your files. Leave it empty only while you are trying a bot nobody else knows about.

Talking to it

Each chat has its own conversation, opened by its first message with the channel's agent and working directory. It carries on until you start another.

Commands start with /:

CommandWhat it does
/newStart a fresh conversation
/statusWhich agent, which directory, how many turns, and the last error
/agentsThe agents on this machine that can be driven
/agent <id>Talk to a different agent, from the next message
/dir <path>Work in a different directory, from the next message
/model <name>Pick a model; empty goes back to the agent's own
/stopStop what the agent is doing now
/helpThis list

Changing the agent, the directory or the model ends the conversation and opens another: an agent is told its working directory when it starts, and carrying a half-finished conversation into a different project would mislead it.

One message is answered at a time. A second one sent while the agent is still working is refused with a note that /stop ends the first.

How answers arrive

TelegramWeChat
While the agent worksThe answer grows in place, rewritten every couple of seconds"Typing…" is shown; nothing is sent until the answer is finished
FormattingMarkdown is rendered — bold, code, links, listsPlain text, since WeChat shows no Markdown
A long answerSplit into messages of up to 4,096 charactersSplit into messages of up to 2,000 characters

Every channel conversation is also listed on the Chat page, where it can be watched with its tool calls while it runs.

Next: 3.1 Providers.

Edit on GitHub
Apache Incubator

Apache Casbin (Incubating) is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

Copyright © 2026 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.

Apache, Apache Casbin, the names of Apache projects, and the feather logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and/or other countries. All other marks mentioned may be trademarks or registered trademarks of their respective owners.

On this page