This directory runs a WeChat iLink bot through cc-connect. Incoming WeChat messages are bridged to a local AI coding agent and the agent response is sent back to WeChat.
WeChat message -> cc-connect -> local agent -> WeChat reply
./start.sh codex: runs the real Codex CLI with an OpenAI API key../start.sh deepseek: runs the localbin/codexshim, which forwards requests todeepseek exec.
cc-connect is still configured with type = "codex" in both modes. DeepSeek is not configured as a Codex provider because the DeepSeek API does not support the Codex /responses endpoint expected by that path.
Set runtime credentials with environment variables. Do not store real keys or tokens in repository files.
| Variable | Required For | Description |
|---|---|---|
WEIXIN_BOT_TOKEN |
All real starts | WeChat iLink bot token. |
WEIXIN_ACCOUNT_ID |
All real starts | WeChat iLink bot account id. |
WEIXIN_ALLOW_FROM |
Optional | Allowed sender filter. Defaults to *. |
WEIXIN_BASE_URL |
Optional | WeChat iLink base URL. Defaults to https://ilinkai.weixin.qq.com. |
OPENAI_API_KEY |
First Codex setup | OpenAI API key for Codex mode. |
DEEPSEEK_API_KEY |
DeepSeek mode | DeepSeek API key. |
DEEPSEEK_MODEL |
Optional | DeepSeek model name. Defaults to deepseek-v4-pro. |
DEEPSEEK_BASE_URL |
Optional | DeepSeek API base URL. Defaults to https://api.deepseek.com/v1. |
start.sh: the recommended entry point. It generatesconfig.toml, selects Codex or DeepSeek, prepares environment variables, and startscc-connect.config.toml: generated runtime configuration. The checked-in version only contains placeholders.bin/codex: the DeepSeek shim. It is only placed first inPATHduring./start.sh deepseek.data/sessions/: local WeChat conversation state written bycc-connect.data/deepseek-shim/sessions.json: local mapping between Codex thread ids and DeepSeek session ids.data/codex-openai-home/: project-local Codex home. Runtime auth/state files should remain local.data/current-agent: records the last selected backend so old agent session ids can be cleared when switching modes.
cd llm-wechat-cli
export WEIXIN_BOT_TOKEN="<real weixin bot token>"
export WEIXIN_ACCOUNT_ID="<real weixin account id>"
export OPENAI_API_KEY="<real OpenAI API key>"
./start.sh codexOn the first successful start, start.sh writes the OpenAI key to the project-local Codex auth file:
data/codex-openai-home/auth.json
Later Codex starts can omit OPENAI_API_KEY if that local auth file already contains a usable key.
cd llm-wechat-cli
export WEIXIN_BOT_TOKEN="<real weixin bot token>"
export WEIXIN_ACCOUNT_ID="<real weixin account id>"
export DEEPSEEK_API_KEY="<real DeepSeek API key>"
./start.sh deepseekOptional model override:
export DEEPSEEK_MODEL="deepseek-v4-flash"
./start.sh deepseek./start.sh codex --no-start
./start.sh deepseek --no-startThis only writes config.toml. A real bot start still needs the required environment variables.
Codex and DeepSeek can be switched at any time:
./start.sh codex
./start.sh deepseekWhen the selected backend changes, start.sh clears stale agent_session_id values under data/sessions/*.json. The chat history stays in place, but the next WeChat message creates a fresh underlying agent session.
After startup, cc-connect should print messages similar to:
platform ready project=wechat-bot platform=weixin
cc-connect is running projects=1
Then send a message to the configured WeChat bot and verify that the agent replies.
Find the process:
pgrep -af cc-connectStop it:
kill <PID>start.sh ultimately runs:
cc-connect --config "$DIR/config.toml" --forceThe --force flag lets cc-connect replace an older instance using the same config.
OpenAI 401
Make sure OPENAI_API_KEY is a real OpenAI key and not a DeepSeek key. Then run ./start.sh codex again.
DeepSeek 404 for /responses
The process is bypassing the local shim and using the wrong provider path. Start DeepSeek mode with ./start.sh deepseek.
thread/resume failed: no rollout found
The stored agent_session_id points at another backend or another Codex home. Switch modes with start.sh so stale ids are cleaned automatically, or start a new chat session.
DeepSeek replies that it is Codex
The cc-connect agent type is still named codex for compatibility. The real execution path is determined by the startup command.
- Do not commit real API keys, bot tokens, chat ids, or local auth files.
- Do not change
[projects.agent].typetodeepseek. - Do not configure DeepSeek as a Codex provider.
- Do not bypass
start.shwhen running DeepSeek mode.