009107ec6938ba8dd7f70ce0b88473586590bde0
VoidBot
VoidBot is a minimal Python agent runtime designed around three ideas:
- Borrow the lightweight execution loop and session persistence style from
nanobot. - Borrow the provider compatibility and gateway/runtime separation from
openclaw. - Keep the first version small: direct CLI or standalone gateway, OpenAI-compatible model calls, tool loop.
Architecture
CLI Agent
-> AgentRuntime
-> ContextBuilder
-> SessionStore
-> ToolRegistry
-> ProviderRegistry
-> OpenAI Compatible Provider
Gateway Server
-> GatewayApplication
-> AgentRuntime
-> ChannelManager
-> Feishu
-> QQ
See docs/architecture.md for the layer breakdown and message flow.
Initial Capabilities
- Build runtime context from workspace metadata, system prompt, tool list, and session history
- Call an OpenAI-compatible chat completions endpoint
- Execute tools and feed tool results back into the model loop
- Run as a direct CLI agent or through a standalone gateway process
- Let the standalone gateway listen on HTTP, Feishu, and QQ at the same time
- Isolate transcript history by
session_id, so each chat keeps its own context - Support provider presets for:
openai_chatgptzhipu_coding_plancustom_openai_compatible
Quick Start
- Create a config file:
{
"provider": "zhipu_coding_plan",
"api_key": "YOUR_API_KEY",
"model": "glm-4.7",
"workspace": ".",
"max_iterations": 8
}
You can also start from config.example.json.
-
Put your real config in
config.jsonin the current directory. -
Start the CLI directly:
uv run voidbot
- Run one turn locally:
uv run voidbot --message "Summarize this repository"
- Start the standalone gateway:
uv run voidbot gateway
- Call the agent through the HTTP gateway:
uv run voidbot --via gateway --message "Summarize this repository"
- Run interactive mode with automatic fallback:
uv run voidbot --via auto
Config Fields
provider: provider preset nameapi_key: provider API keyapi_base: optional override for the provider base URLmodel: optional override for the model IDworkspace: workspace path used by tools and contextsession_file: optional JSONL transcript pathmax_iterations: max tool-call rounds in one turnhistory_limit: number of previous messages to includesystem_prompt: optional custom system promptgateway_host: default gateway bind hostgateway_port: default gateway bind portgateway_url: optional default gateway URL for CLI client modecli_via: default CLI behavior, one oflocal,gateway, orautochannels.feishu.enabled: enable Feishu long-connection listenerchannels.feishu.app_id: Feishu app IDchannels.feishu.app_secret: Feishu app secretchannels.feishu.group_policy:mentionoropenchannels.qq.enabled: enable QQ bot listenerchannels.qq.app_id: QQ bot app IDchannels.qq.secret: QQ bot secret
Channel Gateway
The voidbot gateway process can expose the same runtime in three ways at once:
- HTTP requests on
/v1/agent/run - Feishu events through
lark-oapiWebSocket long connection - QQ bot events through
qq-botpy
Example channel config:
{
"provider": "openai_chatgpt",
"api_key": "YOUR_API_KEY",
"workspace": ".",
"channels": {
"feishu": {
"enabled": true,
"app_id": "cli_xxx",
"app_secret": "xxx",
"group_policy": "mention"
},
"qq": {
"enabled": true,
"app_id": "1024xxxx",
"secret": "xxx"
}
}
}
Platform notes:
- Feishu: enable bot capability and subscribe to
im.message.receive_v1. - QQ: enable C2C messages and group
@botmessages for the app. - Every Feishu or QQ chat is mapped to its own
session_id, so contexts do not leak across chats.
Notes
- The model layer is deliberately OpenAI-compatible first, so adding more gateways later is straightforward.
- The current built-in tools are
list_dir,read_file,write_file, andrun_command. - Every inbound request gets
session_id,run_id, andmessage_idbefore entering the runtime. voidbot agent --via autotries the gateway first, then falls back to local execution.voidbotwithout a subcommand starts the interactive CLI.voidbot gatewaystarts the HTTP listener and any enabled channel listeners.
Languages
Python
99.5%
Makefile
0.5%