This is a practical guide for first-time Hermes Agent users who want to chat with Hermes through Feishu.
Goals of this guide:
- Configure Hermes correctly with the MiniMax China model first
- Connect Hermes Agent to Feishu from scratch
- Explain why each setting is needed
- Document common errors and their fixes
- Help you avoid repeated pitfalls on your first setup
This guide is based on a real setup and has been verified to work.
1. The End Result
After setup, you can:
- Use the MiniMax China model as Hermes' default model
- Chat directly with the Hermes Agent bot in a Feishu direct message
- Talk to Hermes in a Feishu group by mentioning
@bot - Use your existing Hermes model configuration as the reasoning model behind the Feishu channel
- Set the current Feishu conversation as Hermes'
home channel - Use allowlist and pairing mechanisms so only specified accounts can use it
2. Understanding the Architecture
It is easiest to understand this setup in the following order:
- Configure Hermes' model correctly first
- Then connect Feishu as a messaging channel
- Finally, add security and usability settings
Connecting Hermes Agent to Feishu essentially works like this:
- Hermes Gateway runs as a background messaging gateway process
- A Feishu Open Platform app is the message entry point
- The Feishu bot sends messages to Hermes Gateway
- Hermes calls the model you configured
- Hermes sends the result back to the Feishu conversation
For Feishu, use:
websocketmode
This is the officially recommended mode because it:
- Does not require a public callback URL
- Does not require deploying your own webhook service
- Is the simplest option for local development and personal use
3. Prerequisites
Prepare the following before you begin.
1. Hermes Agent Is Installed
Confirm that the command is available:
hermes version
2. A Working Model Is Configured
For example:
minimax-cnminimaxopenrouteranthropicopenai
If the model itself does not work, the bot still cannot reply after Feishu is connected.
3. You Have a Feishu Open Platform App
Create an app on the Feishu Open Platform in advance and obtain:
App IDApp Secret
Feishu Open Platform:
4. Bot Capability Is Enabled in the Feishu App
Enable Bot in the app. Otherwise, even if Hermes connects successfully, it cannot work as a messaging bot.
4. Configure the MiniMax China Model First
If you use Hermes in mainland China, one of the best ways to start is by configuring the MiniMax China model first.
This is because:
- It is usually more stable on networks in mainland China
- Hermes already includes a built-in
minimax-cnprovider - Connecting Feishu after the model works makes troubleshooting much clearer
1. The Correct Hermes Configuration
In ~/.hermes/config.yaml:
model:
default: MiniMax-M2.7
provider: minimax-cn
In ~/.hermes/.env:
MINIMAX_CN_API_KEY=your_MiniMax_China_key API Key
This is the recommended minimal configuration.
2. The Configuration We Actually Verified
These are the key settings that worked in practice.
~/.hermes/config.yaml
model:
default: MiniMax-M2.7
provider: minimax-cn
~/.hermes/.env
MINIMAX_CN_API_KEY=your_MiniMax_China_key API Key
3. Incorrect Configurations to Avoid
The first core problem we hit during setup was not Feishu at all; it was an incorrect model configuration.
Incorrect example:
model:
default: minimax 2.7
provider: custom
base_url: https://api.minimaxi.com/anthropic
This setup can easily cause:
404 Not Found- Hermes request paths that do not match
- An unrecognized model name
Why:
- Hermes already has a built-in MiniMax provider
- You should not force MiniMax China into a
custom + anthropicconfiguration minimax 2.7is not the correct model ID for Hermes
4. The MiniMax Error We Ran Into
We ran into two typical errors:
First:
404 Not Found
This usually means:
- The request URL is wrong
- The provider is misconfigured
base_urlpoints to an incompatible path
Second:
Error code: 400 - {'error': {'message': 'minimax 2.7 is not a valid model ID', 'code': 400}}
This means:
- The request is already reaching MiniMax
- But the model name is still wrong
5. The Correct Fix
Change the configuration to use the built-in provider:
model:
default: MiniMax-M2.7
provider: minimax-cn
Then fill in .env:
MINIMAX_CN_API_KEY=your_MiniMax_China_key API Key
Do not keep old settings like these:
provider: custombase_url: https://api.minimaxi.com/anthropicdefault: minimax 2.7
6. How to Verify the MiniMax China Model Works
Run:
hermes chat -Q -q "Reply with exactly: ok" --provider minimax-cn -m MiniMax-M2.7
If it returns:
ok
then at least this chain is working:
- Hermes is configured correctly
MINIMAX_CN_API_KEYworks- The model name is correct
- The provider is correct
Make sure this step works before configuring Feishu.
5. The Officially Recommended Feishu Setup
Hermes supports Feishu natively, so you do not need to write your own middleware.
The key official settings are:
FEISHU_APP_ID=your_Feishu_AppID
FEISHU_APP_SECRET=your_Feishu_AppSecret
FEISHU_DOMAIN=feishu
FEISHU_CONNECTION_MODE=websocket
FEISHU_GROUP_POLICY=allowlist
FEISHU_ALLOWED_USERS=
FEISHU_HOME_CHANNEL=
Notes:
FEISHU_DOMAIN=feishumeans Feishu in mainland China- For the international Lark service, use
FEISHU_DOMAIN=lark FEISHU_CONNECTION_MODE=websocketis recommendedFEISHU_GROUP_POLICY=allowlistallows only allowlisted users in groups- For your first setup, put only yourself in
FEISHU_ALLOWED_USERS FEISHU_HOME_CHANNELcan be added later
6. The Recommended Shortest Setup Path
For a first setup, follow this flow instead of trying to configure every parameter immediately.
Step 1: Get the MiniMax China Model Working
Make sure Hermes can call the model normally before configuring Feishu.
For example, test:
hermes chat -Q -q "Reply with exactly: ok" --provider minimax-cn -m MiniMax-M2.7
If this does not return a response, do not continue with Feishu yet.
Step 2: Add Feishu Settings to ~/.hermes/.env
Edit:
~/.hermes/.env
Add:
FEISHU_APP_ID=YOUR_FEISHU_APP_ID
FEISHU_APP_SECRET=YOUR_FEISHU_APP_SECRET
FEISHU_DOMAIN=feishu
FEISHU_CONNECTION_MODE=websocket
FEISHU_GROUP_POLICY=allowlist
FEISHU_ALLOWED_USERS=
FEISHU_HOME_CHANNEL=
For your first setup, FEISHU_ALLOWED_USERS and FEISHU_HOME_CHANNEL can be left empty.
Step 3: Confirm Hermes Has the Dependencies Feishu Needs
Feishu WebSocket mode needs at least these Python dependencies:
lark-oapiwebsockets
Check:
/Users/your_username/.hermes/hermes-agent/venv/bin/python3 - <<'PY'
import importlib
for m in ["lark_oapi", "websockets"]:
try:
importlib.import_module(m)
print(m, "ok")
except Exception as e:
print(m, "missing", e)
PY
If Hermes' own venv is missing dependencies, install them into that venv:
/Users/your_username/.hermes/hermes-agent/venv/bin/python3 -m ensurepip --upgrade
/Users/your_username/.hermes/hermes-agent/venv/bin/python3 -m pip install lark-oapi websockets
Note:
- Install them into Hermes' own venv
- Do not install them only into the system Python
Step 4: Start or Restart Hermes Gateway
hermes gateway start
If it is already running:
hermes gateway restart
Step 5: Check the Gateway Logs
Look for:
~/.hermes/logs/gateway.log~/.hermes/logs/gateway.error.log
If the connection succeeds, the logs usually include something like:
Connecting to feishu...
Connected in websocket mode (feishu)
Gateway running with 2 platform(s)
If you see this, the Feishu channel is connected.
Step 6: Send the Bot a Direct Message in Feishu
Start with a direct message first instead of testing in a group.
Send a simple direct message, for example:
hello
7. The Pairing Flow You'll See on First Use
Many people think Hermes' first Feishu reply is an error. It is not.
The first time you send a direct message, Hermes will probably reply with something like:
Hi~ I don't recognize you yet!
Here's your pairing code: XXXXXXXX
Ask the bot owner to run:
hermes pairing approve feishu XXXXXXXX
This means:
- The Feishu channel is working
- Hermes received your message
- But Hermes has not yet marked your Feishu user as authorized
How to Handle It
On the machine running Hermes, run:
hermes pairing approve feishu your_pairing_code
After approval succeeds, Hermes indicates that the user will be recognized automatically next time.
If the Command Reports a Permission Error
Sometimes Hermes cannot write to ~/.hermes/pairing/.
This is usually not a Hermes configuration problem; the current environment lacks permission.
Solutions:
- Run it in a local terminal with sufficient permissions
- Or run it in a way that allows Hermes to access
~/.hermes/
8. Security Settings to Add Right Away
Once chat works for the first time, do not stop there. Do at least two more things.
1. Add Your Feishu Account to the Allowlist
After pairing, add your open_id to:
FEISHU_ALLOWED_USERS=your_open_id
After that:
- Only you can use the bot at first
- Even if someone else finds the bot, they cannot use it freely
You can usually find your user ID in the Hermes logs, for example:
user=ou_xxx
2. Set FEISHU_HOME_CHANNEL
This tells Hermes:
- Where to send future notifications
- Where to send cron job results
- Which Feishu conversation receives certain default output
You can set it manually:
FEISHU_HOME_CHANNEL=oc_xxx
Or send this to the bot in a Feishu conversation:
/sethome
9. Behavior Rules in Group Chats
Feishu group chats behave differently from direct messages.
Direct Messages
- Hermes processes every message you send
Group Chats
- You must mention
@bot - Hermes ignores messages without an
@mention - If
FEISHU_GROUP_POLICY=allowlist, Hermes also checks whether you are allowlisted
So the most common reason a bot "does not respond" in a group is not that it is broken, but that:
- It was not mentioned with
@bot - The user is not on the allowlist
- The group policy is
disabled
10. Real Problems We Hit and How We Solved Them
All of these problems happened during a real setup, and first-time users are likely to hit them.
Problem 1: Thinking Hermes Didn't Support Feishu
Symptoms:
- The Feishu entry was not immediately visible in the documentation
- We suspected Hermes only supported Telegram / Discord / Slack
Actual cause:
- Feishu support is built in; you just need the corresponding
Feishu / Larkdocumentation page
Fix:
- Confirm that your local Hermes version includes
gateway/platforms/feishu.py - Read the official Feishu/Lark configuration documentation
Problem 2: MiniMax Was Misconfigured as a Custom Provider
Symptoms:
- The logs show
404 Not Found - Or requests keep failing
Actual cause:
- MiniMax was misconfigured as:
provider: custombase_url: https://api.minimaxi.com/anthropic
Fix:
- Switch back to Hermes' built-in provider:
model:
default: MiniMax-M2.7
provider: minimax-cn
- And use this in
.env:
MINIMAX_CN_API_KEY=your_MiniMax_China_key API Key
Problem 3: The Model Name Was Written as minimax 2.7
Symptoms:
- The logs show:
minimax 2.7 is not a valid model ID
Actual cause:
- Model routing is already reaching MiniMax
- But the model name is not a valid Hermes ID
Fix:
- Change it to:
default: MiniMax-M2.7
Problem 4: Feishu Dependencies Were Missing
Symptoms:
- The Feishu configuration looks fine
- But Gateway will not start, or WebSocket mode is unavailable
Actual cause:
- Hermes' venv is missing:
lark-oapiwebsockets
Fix:
/Users/your_username/.hermes/hermes-agent/venv/bin/python3 -m ensurepip --upgrade
/Users/your_username/.hermes/hermes-agent/venv/bin/python3 -m pip install lark-oapi websockets
Problem 5: Hermes' venv Didn't Even Have pip
Symptoms:
- Installing dependencies fails with:
No module named pip
Fix:
Run this first:
/Users/your_username/.hermes/hermes-agent/venv/bin/python3 -m ensurepip --upgrade
Then install the dependencies.
Problem 6: Gateway Status Looked Inconsistent
Symptoms:
hermes gateway restartreports success- But
hermes gateway statusbriefly shows that it is not loaded
Actual cause:
- launchd status updates are delayed
- Or the service has just reloaded, and the status output is not fully in sync with the logs
Fix:
- Do not rely only on
status - Also check
~/.hermes/logs/gateway.log
If the logs show:
Connected in websocket mode (feishu)
Feishu is actually connected.
Problem 7: The First Message Returned a Pairing Code
Symptoms:
- The bot returns a pairing code instead of a normal reply
Actual cause:
- This is a security mechanism, not an error
Fix:
hermes pairing approve feishu your_pairing_code
Problem 8: Marked as an Unauthorized User Right After Connecting
Symptoms:
- The logs show:
Unauthorized user
Actual cause:
- You have not completed pairing
- Or you have not added your
open_idtoFEISHU_ALLOWED_USERS
Fix:
- Complete pairing first
- Then add your
open_idto the allowlist
Problem 9: The Bot Replies in DMs but Not in Groups
The cause is usually:
- The bot was not mentioned with
@bot - Group policy restrictions
- The user is not allowlisted
Fix:
- Explicitly mention
@botin the group - Check
FEISHU_GROUP_POLICY - Check
FEISHU_ALLOWED_USERS
11. Recommended Final Stable Configuration
This configuration is a good starting point for personal use with Feishu in mainland China.
~/.hermes/config.yaml
model:
default: MiniMax-M2.7
provider: minimax-cn
~/.hermes/.env
MINIMAX_CN_API_KEY=your_MiniMax_China_key API Key
FEISHU_APP_ID=your_AppID
FEISHU_APP_SECRET=your_AppSecret
FEISHU_DOMAIN=feishu
FEISHU_CONNECTION_MODE=websocket
FEISHU_GROUP_POLICY=allowlist
FEISHU_ALLOWED_USERS=your_open_id
FEISHU_HOME_CHANNEL=your_chat_id
Its advantages:
- Simple configuration
- No public webhook required
- Only you can use it at first
- Easy to extend later to groups, notifications, and scheduled jobs
12. Recommended Troubleshooting Order
If the setup fails, always troubleshoot in this order.
Step 1: Confirm the Model Works
Do not suspect Feishu first.
First confirm that Hermes itself can call the model.
Step 2: Confirm the .env Variables Are Correct
Check especially:
- Whether
providerisminimax-cn - Whether
defaultisMiniMax-M2.7 MINIMAX_CN_API_KEYFEISHU_APP_IDFEISHU_APP_SECRETFEISHU_DOMAINFEISHU_CONNECTION_MODE
Step 3: Confirm the Dependencies Are in the Hermes venv
Check especially:
lark-oapiwebsockets
Step 4: Restart Gateway
hermes gateway restart
Step 5: Check Logs, Not Just Command Output
Look for:
~/.hermes/logs/gateway.log~/.hermes/logs/gateway.error.log
Step 6: Test with a Direct Message to the Bot
Do not test in a group first.
Step 7: Handle Pairing
If you get a pairing code, approve it; do not mistake it for a failure.
13. Advice for First-Time Users
If this is your first time using Hermes Agent, I recommend this order:
- Get the MiniMax China model working
- Connect Feishu
- Verify with direct messages first
- Complete pairing
- Add your
open_idto the allowlist - Set the
home channel - Only then consider group chats, cron, and more channels
This is the least confusing path.
14. Quick Command Reference
Check the Hermes Version
hermes version
View the Configuration Summary
hermes dump
Test the MiniMax China Model
hermes chat -Q -q "Reply with exactly: ok" --provider minimax-cn -m MiniMax-M2.7
Check the Environment
hermes doctor
Start Gateway
hermes gateway start
Restart Gateway
hermes gateway restart
Check Gateway Status
hermes gateway status
Approve a Feishu Pairing Code
hermes pairing approve feishu pairing_code
List Approved Users
hermes pairing list
15. Conclusion
Connecting Hermes Agent to Feishu is not complicated, but first-time setups most often get stuck on these points:
- Misconfiguring the MiniMax provider as custom
- Writing the model name as
minimax 2.7 - Thinking Hermes does not support Feishu
- Configuring only
.envwithout installing Feishu dependencies - Installing dependencies into the wrong Python environment
- Mistaking a pairing code for an error
- Forgetting to set the allowlist and home channel
If you follow the steps in this guide, especially:
- Getting
minimax-cn + MiniMax-M2.7 + MINIMAX_CN_API_KEYworking first - Using
websocket - Installing dependencies into Hermes' venv
- Testing in a direct message first
- Complete pairing
- Then adding the allowlist and home channel
the connection usually works smoothly.
If you share this guide with your team, remind them:
- Do not store a real
App Secretin the document - Do not publish real
open_id,chat_id, or API key values - Replace them all with placeholders before sharing