Apache Casbin Gateway
2. Agents

2.6 Chat

Chat hands a message to an agent on this machine and shows it working: the answer as it is written, every tool it reached for, and what the turn cost. It is right under Agents in the sidebar, and only an administrator sees it.

The agent that answers is the real one, not a copy. It runs with its own configuration, the provider Gateway bound to it, and the hooks Gateway installed, so what it spends and what it is allowed to do are recorded exactly as when somebody types at it in a terminal.

Which agents can be driven

Only an agent that publishes a non-interactive mode can be driven, because Gateway runs it without a terminal:

AgentKeeps the conversation between messages
Claude CodeYes
CodeBuddy CodeYes
Codex CLIYes
Qwen CodeYes
Gemini CLINo — each message stands alone

An agent this machine does not have is not offered. When none of them is installed, the page says so.

Gemini CLI can only resume its latest session, not a named one, so every message to it starts from nothing. Its sessions carry an Each message stands alone badge.

Starting a session

  1. Pick the agent.
  2. Give a working directory if the work is in a project: a full path, or one starting with ~. Left empty, the agent works in the home directory. A path that does not exist is refused here, before anything runs.
  3. Press New session, then type. Enter sends; Shift+Enter is a new line.

Nothing runs until the first message: a session is only a promise of where the agent will be started.

What the answer shows

  • The text, rendered as Markdown, growing as the agent writes it.
  • Its thinking, when the agent reports it, folded away under the answer.
  • Each tool call in a box of its own: the tool, what it was given, and what came back.
  • A warning when the agent mentioned something in passing that did not stop the turn.
  • The tokens in and out, and the cost when the agent reports one.

One turn runs at a time. While it does, the send button is a stop button, and pressing it ends the run.

An agent with no terminal

A driven agent cannot stop and ask you to approve a tool, because there is nobody at a terminal to answer. It does what its own settings let it do without asking.

What Gateway enforces still holds. The tool switches on Permissions are checked by the hook before a tool runs, and the model and provider rules hold every request that goes through the proxy.

Claude Code, Gemini CLI and Qwen Code are handed the provider bound to them for that one run, through the environment, so nothing in their configuration files is touched. Codex CLI and CodeBuddy Code read the configuration Gateway wrote when the provider was bound (3.2).

Sessions

The list on the left is every driven session, newest first and named after the first thing asked, including the ones opened from a chat channel, which can be watched from here while they run. The bin removes one.

Sessions are kept in the database, so the list survives a Gateway restart and the next message still continues the conversation. What was said before the restart is not replayed on this page; it is in the agent's own transcript, which Agent Sessions reads.

Next: 2.7 Chat channels.

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