hermes - 💡(How to fix) Fix [i18n] Thai Translation: Messaging Part c - homeassistant, matrix, mattermost, open-webui, qqbot [1 participants]
ON THIS PAGE
Recommended Tools
×6Utilities matched from this issue’s tags and category — try them while you read without losing context.
GitHub issue graph ai analysis
Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.
The report is written in English Markdown for sharing and archival.
Helpful · Quick feedback
QQ Bot adapter ใช้ Official QQ Bot API เพื่อ:
- รับข้อความผ่านการเชื่อมต่อ WebSocket แบบถาวรไปยัง QQ Gateway
- ส่งข้อความและข้อความตอบกลับแบบ markdown ผ่าน REST API
- ดาวน์โหลดและประมวลผลรูปภาพ, ข้อความเสียง, และไฟล์แนบ
- ถอดเสียงข้อความเสียงโดยใช้ ASR ที่มีอยู่ในตัวของ Tencent หรือผู้ให้บริการ STT ที่สามารถกำหนดค่าได้
Root Cause
QQ Bot adapter ใช้ Official QQ Bot API เพื่อ:
- รับข้อความผ่านการเชื่อมต่อ WebSocket แบบถาวรไปยัง QQ Gateway
- ส่งข้อความและข้อความตอบกลับแบบ markdown ผ่าน REST API
- ดาวน์โหลดและประมวลผลรูปภาพ, ข้อความเสียง, และไฟล์แนบ
- ถอดเสียงข้อความเสียงโดยใช้ ASR ที่มีอยู่ในตัวของ Tencent หรือผู้ให้บริการ STT ที่สามารถกำหนดค่าได้
Code Example
# Add to ~/.hermes/.env
# Required: your Long-Lived Access Token
HASS_TOKEN=your-long-lived-access-token
# Optional: HA URL (default: http://homeassistant.local:8123)
HASS_URL=http://192.168.1.100:8123
---
hermes gateway
---
List all lights in the living room
---
What's the current state of climate.thermostat?
---
What services are available for climate devices?
---
Turn on the living room lights
→ ha_call_service(domain="light", service="turn_on", entity_id="light.living_room")
---
Set the thermostat to 22 degrees in heat mode
→ ha_call_service(domain="climate", service="set_temperature",
entity_id="climate.thermostat", data={"temperature": 22, "hvac_mode": "heat"})
---
Set living room lights to blue at 50% brightness
→ ha_call_service(domain="light", service="turn_on",
entity_id="light.living_room", data={"brightness": 128, "color_name": "blue"})
---
platforms:
homeassistant:
enabled: true
extra:
watch_domains:
- climate
- binary_sensor
- alarm_control_panel
- light
watch_entities:
- sensor.front_door_battery
ignore_entities:
- sensor.uptime
- sensor.cpu_usage
- sensor.memory_usage
cooldown_seconds: 30
---
User: Start my morning routine
Agent:
1. ha_call_service(domain="light", service="turn_on",
entity_id="light.bedroom", data={"brightness": 128})
2. ha_call_service(domain="climate", service="set_temperature",
entity_id="climate.thermostat", data={"temperature": 22})
3. ha_call_service(domain="media_player", service="turn_on",
entity_id="media_player.kitchen_speaker")
---
User: Is the house secure?
Agent:
1. ha_list_entities(domain="binary_sensor")
→ checks door/window sensors
2. ha_get_state(entity_id="alarm_control_panel.home")
→ checks alarm status
3. ha_list_entities(domain="lock")
→ checks lock states
4. Reports: "All doors closed, alarm is armed_away, all locks engaged."
---
[Home Assistant] Front Door: triggered (was cleared)
Agent automatically:
1. ha_get_state(entity_id="binary_sensor.front_door")
2. ha_call_service(domain="light", service="turn_on",
entity_id="light.hallway")
3. Sends notification: "Front door opened. Hallway lights turned on."
---
group_sessions_per_user: true
---
group_sessions_per_user: false
---
matrix:
require_mention: true # ต้องการ @mention ในห้อง (ค่าเริ่มต้น: true)
free_response_rooms: # ห้องที่ได้รับการยกเว้นจากการกำหนดให้ต้อง mention
- "!abc123:matrix.org"
auto_thread: true # สร้าง thread อัตโนมัติสำหรับการตอบกลับ (ค่าเริ่มต้น: true)
dm_mention_threads: false # สร้าง thread เมื่อ @mentioned ใน DM (ค่าเริ่มต้น: false)
---
MATRIX_REQUIRE_MENTION=true
MATRIX_FREE_RESPONSE_ROOMS=!abc123:matrix.org,!def456:matrix.org
MATRIX_AUTO_THREAD=true
MATRIX_DM_MENTION_THREADS=false
MATRIX_REACTIONS=true # default: true — emoji reactions ระหว่างการประมวลผล
---
# Synapse example
register_new_matrix_user -c /etc/synapse/homeserver.yaml http://localhost:8008
---
curl -X POST https://your-server/_matrix/client/v3/login \
-H "Content-Type: application/json" \
-d '{
"type": "m.login.password",
"user": "@hermes:your-server.org",
"password": "your-password"
}'
---
MATRIX_USER_ID=@hermes:your-server.org
MATRIX_PASSWORD=your-password
---
hermes gateway setup
---
# Required
MATRIX_HOMESERVER=https://matrix.example.org
MATRIX_ACCESS_TOKEN=***
# Optional: user ID (auto-detected from token if omitted)
# MATRIX_USER_ID=@hermes:matrix.example.org
# Security: restrict who can interact with the bot
MATRIX_ALLOWED_USERS=@alice:matrix.example.org
# Multiple allowed users (comma-separated)
# MATRIX_ALLOWED_USERS=@alice:matrix.example.org,@bob:matrix.example.org
---
# Required
MATRIX_HOMESERVER=https://matrix.example.org
MATRIX_USER_ID=@hermes:matrix.example.org
MATRIX_PASSWORD=***
# Security
MATRIX_ALLOWED_USERS=@alice:matrix.example.org
---
group_sessions_per_user: true
---
hermes gateway
---
# ติดตั้ง mautrix พร้อมการรองรับ E2EE
pip install 'mautrix[encryption]'
# หรือติดตั้งด้วย hermes extras
pip install 'hermes-agent[matrix]'
---
# Debian/Ubuntu
sudo apt install libolm-dev
# macOS
brew install libolm
# Fedora
sudo dnf install libolm-devel
---
MATRIX_ENCRYPTION=true
---
MATRIX_RECOVERY_KEY=EsT... your recovery key here
---
sudo systemctl stop matrix-synapse
sudo sqlite3 /var/lib/matrix-synapse/homeserver.db "
DELETE FROM e2e_device_keys_json WHERE device_id = 'DEVICE_ID' AND user_id = '@hermes:your-server';
DELETE FROM e2e_one_time_keys_json WHERE device_id = 'DEVICE_ID' AND user_id = '@hermes:your-server';
DELETE FROM e2e_fallback_keys_json WHERE device_id = 'DEVICE_ID' AND user_id = '@hermes:your-server';
DELETE FROM devices WHERE device_id = 'DEVICE_ID' AND user_id = '@hermes:your-server';
"
sudo systemctl start matrix-synapse
---
curl -X DELETE -H "Authorization: Bearer ADMIN_TOKEN" \
'https://your-server/_synapse/admin/v2/users/%40hermes%3Ayour-server/devices/DEVICE_ID'
---
rm -f ~/.hermes/platforms/matrix/store/crypto.db*
# restart hermes
---
MATRIX_HOME_ROOM=!abc123def456:matrix.example.org
---
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-server/_matrix/client/v3/account/whoami
---
pip install 'mautrix[encryption]'
---
pip install 'hermes-agent[matrix]'
---
curl -X POST https://your-server/_matrix/client/v3/login \
-H "Content-Type: application/json" \
-d '{
"type": "m.login.password",
"identifier": {"type": "m.id.user", "user": "@hermes:your-server.org"},
"password": "***",
"initial_device_display_name": "Hermes Agent"
}'
---
rm -f ~/.hermes/platforms/matrix/store/crypto.db
rm -f ~/.hermes/platforms/matrix/store/crypto_store.*
---
MATRIX_RECOVERY_KEY=EsT... your recovery key here
---
hermes gateway run
---
macOS (Host):
└─ hermes gateway
├─ api_server adapter ← listens on 0.0.0.0:8642
├─ AIAgent ← single source of truth
├─ Sessions, memory, skills
└─ Local file access (Obsidian, projects, etc.)
Linux VM (Docker):
└─ hermes gateway (proxy mode)
├─ Matrix adapter ← E2EE decryption/encryption
└─ HTTP forward → macOS:8642/v1/chat/completions
(no LLM API keys, no agent, no inference)
---
API_SERVER_ENABLED=true
API_SERVER_KEY=your-secret-key-here
API_SERVER_HOST=0.0.0.0
---
hermes gateway
---
# จาก Linux VM
curl http://<mac-ip>:8642/health
---
services:
hermes-matrix:
build: .
environment:
# Matrix credentials
MATRIX_HOMESERVER: "https://matrix.example.org"
MATRIX_ACCESS_TOKEN: "syt_..."
MATRIX_ALLOWED_USERS: "@you:matrix.example.org"
MATRIX_ENCRYPTION: "true"
MATRIX_DEVICE_ID: "HERMES_BOT"
# Proxy mode — forward to host agent
GATEWAY_PROXY_URL: "http://192.168.1.100:8642"
GATEWAY_PROXY_KEY: "your-secret-key-here"
volumes:
- ./matrix-store:/root/.hermes/platforms/matrix/store
---
FROM python:3.11-slim
RUN apt-get update && apt-get install -y libolm-dev && rm -rf /var/lib/apt/lists/*
RUN pip install 'hermes-agent[matrix]'
CMD ["hermes", "gateway"]
---
hermes gateway
---
docker compose up -d
---
group_sessions_per_user: true
---
group_sessions_per_user: false
---
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-mattermost-server/api/v4/users/me | jq .id
---
hermes gateway setup
---
# Required
MATTERMOST_URL=https://mm.example.com
MATTERMOST_TOKEN=***
MATTERMOST_ALLOWED_USERS=3uo8dkh1p7g1mfk49ear5fzs5c
# Multiple allowed users (comma-separated)
# MATTERMOST_ALLOWED_USERS=3uo8dkh1p7g1mfk49ear5fzs5c,8fk2jd9s0a7bncm1xqw4tp6r3e
# Optional: reply mode (thread หรือ off, default: off)
# MATTERMOST_REPLY_MODE=thread
# Optional: respond without @mention (default: true = require mention)
# MATTERMOST_REQUIRE_MENTION=false
# Optional: channels where bot responds without @mention (comma-separated channel IDs)
# MATTERMOST_FREE_RESPONSE_CHANNELS=channel_id_1,channel_id_2
---
group_sessions_per_user: true
---
hermes gateway
---
MATTERMOST_HOME_CHANNEL=abc123def456ghi789jkl012mn
---
MATTERMOST_REPLY_MODE=thread
---
location /api/v4/websocket {
proxy_pass http://mattermost-backend;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 600s;
}
---
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-server/api/v4/users/me
---
mattermost:
channel_prompts:
"channel_id_abc123": |
You are a research assistant. Focus on academic sources,
citations, and concise synthesis.
"channel_id_def456": |
Code review mode. Be precise about edge cases and
performance implications.
---
flowchart LR
A["Open WebUI<br/>browser UI<br/>port 3000"]
B["hermes-agent<br/>gateway API server<br/>port 8642"]
A -->|POST /v1/chat/completions| B
B -->|SSE streaming response| A
---
API_SERVER_ENABLED=true
API_SERVER_KEY=your-secret-key
---
hermes gateway
---
[API Server] API server listening on http://127.0.0.1:8642
---
docker run -d -p 3000:8080 \
-e OPENAI_API_BASE_URL=http://host.docker.internal:8642/v1 \
-e OPENAI_API_KEY=your-secret-key \
--add-host=host.docker.internal:host-gateway \
-v open-webui:/app/backend/data \
--name open-webui \
--restart always \
ghcr.io/open-webui/open-webui:main
---
services:
open-webui:
image: ghcr.io/open-webui/open-webui:main
ports:
- "3000:8080"
volumes:
- open-webui:/app/backend/data
environment:
- OPENAI_API_BASE_URL=http://host.docker.internal:8642/v1
- OPENAI_API_KEY=your-secret-key
extra_hosts:
- "host.docker.internal:host-gateway"
restart: always
volumes:
open-webui:
---
docker compose up -d
---
hermes profile create alice
hermes -p alice config set API_SERVER_ENABLED true
hermes -p alice config set API_SERVER_PORT 8643
hermes -p alice config set API_SERVER_KEY alice-secret
hermes profile create bob
hermes -p bob config set API_SERVER_ENABLED true
hermes -p bob config set API_SERVER_PORT 8644
hermes -p bob config set API_SERVER_KEY bob-secret
---
hermes -p alice gateway &
hermes -p bob gateway &
---
hermes -p alice config set API_SERVER_MODEL_NAME "Alice's Agent"
---
# Option 1: เพิ่ม host mapping
docker run --add-host=host.docker.internal:host-gateway ...
# Option 2: ใช้ host networking
docker run --network=host -e OPENAI_API_BASE_URL=http://localhost:8642/v1 ...
# Option 3: ใช้ Docker bridge IP
docker run -e OPENAI_API_BASE_URL=http://172.17.0.1:8642/v1 ...
---
pip install aiohttp httpx
---
hermes gateway setup
---
QQ_APP_ID=your-app-id
QQ_CLIENT_SECRET=your-app-secret
---
platforms:
qq:
enabled: true
extra:
app_id: "your-app-id"
client_secret: "your-secret"
markdown_support: true # enable QQ markdown (msg_type 2). Config-only; no env-var equivalent.
dm_policy: "open" # open | allowlist | disabled
allow_from:
- "user_openid_1"
group_policy: "open" # open | allowlist | disabled
group_allow_from:
- "group_openid_1"
stt:
provider: "zai" # zai (GLM-ASR), openai (Whisper), etc.
baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4"
apiKey: "your-stt-key"
model: "glm-asr"RAW_BUFFERClick to expand / collapse
📄 user-guide/messaging/homeassistant.md
title: Home Assistant description: Control your smart home with Hermes Agent via Home Assistant integration. sidebar_label: Home Assistant sidebar_position: 5
การผสานรวมกับ Home Assistant
Hermes Agent ผสานรวมกับ Home Assistant ได้ 2 วิธี:
- Gateway platform - สมัครรับการเปลี่ยนแปลงสถานะแบบเรียลไทม์ผ่าน WebSocket และตอบสนองต่อเหตุการณ์ต่างๆ
- Smart home tools - เครื่องมือ 4 ตัวที่สามารถเรียกใช้ผ่าน LLM สำหรับการสอบถามและควบคุมอุปกรณ์ผ่าน REST API
การตั้งค่า
1. สร้าง Long-Lived Access Token
- เปิด Home Assistant instance ของคุณ
- ไปที่ Profile ของคุณ (คลิกที่ชื่อของคุณในแถบด้านข้าง)
- เลื่อนลงไปที่ Long-Lived Access Tokens
- คลิก Create Token ตั้งชื่อ เช่น "Hermes Agent"
- คัดลอก token
2. กำหนดค่า Environment Variables
# Add to ~/.hermes/.env
# Required: your Long-Lived Access Token
HASS_TOKEN=your-long-lived-access-token
# Optional: HA URL (default: http://homeassistant.local:8123)
HASS_URL=http://192.168.1.100:8123:::info
เครื่องมือ homeassistant จะถูกเปิดใช้งานโดยอัตโนมัติเมื่อมีการตั้งค่า HASS_TOKEN ทั้ง gateway platform และ device control tools จะเปิดใช้งานจาก token เดียวนี้
:::
3. เริ่มต้น Gateway
hermes gatewayHome Assistant จะปรากฏเป็น platform ที่เชื่อมต่ออยู่เคียงข้างกับแพลตฟอร์มการส่งข้อความอื่นๆ (เช่น Telegram, Discord เป็นต้น)
เครื่องมือที่ใช้งานได้
Hermes Agent ลงทะเบียนเครื่องมือ 4 ตัวสำหรับการควบคุม smart home:
ha_list_entities
แสดงรายการ entity ของ Home Assistant โดยสามารถกรองตาม domain หรือ area ได้ตามต้องการ
Parameters:
domain(optional) - กรองตาม entity domain:light,switch,climate,sensor,binary_sensor,cover,fan,media_player, etc.area(optional) - กรองตามชื่อ area/ห้อง (เทียบกับ friendly names):living room,kitchen,bedroom, etc.
Example:
List all lights in the living roomจะส่งคืน entity IDs, states, และ friendly names
ha_get_state
รับสถานะโดยละเอียดของ entity เดียว รวมถึง attributes ทั้งหมด (เช่น brightness, color, temperature setpoint, sensor readings, etc.)
Parameters:
entity_id(required) - entity ที่ต้องการสอบถาม เช่นlight.living_room,climate.thermostat,sensor.temperature
Example:
What's the current state of climate.thermostat?จะส่งคืน: state, all attributes, last changed/updated timestamps
ha_list_services
แสดงรายการบริการ (actions) ที่พร้อมใช้งานสำหรับการควบคุมอุปกรณ์ แสดงให้เห็นว่าสามารถดำเนินการใดได้บ้างกับอุปกรณ์แต่ละประเภท และรับ parameters อะไรบ้าง
Parameters:
domain(optional) - กรองตาม domain เช่นlight,climate,switch
Example:
What services are available for climate devices?ha_call_service
เรียกใช้บริการของ Home Assistant เพื่อควบคุมอุปกรณ์
Parameters:
domain(required) - Service domain:light,switch,climate,cover,media_player,fan,scene,scriptservice(required) - Service name:turn_on,turn_off,toggle,set_temperature,set_hvac_mode,open_cover,close_cover,set_volume_levelentity_id(optional) - Target entity เช่นlight.living_roomdata(optional) - Additional parameters ในรูปแบบ JSON object
Examples:
Turn on the living room lights
→ ha_call_service(domain="light", service="turn_on", entity_id="light.living_room")Set the thermostat to 22 degrees in heat mode
→ ha_call_service(domain="climate", service="set_temperature",
entity_id="climate.thermostat", data={"temperature": 22, "hvac_mode": "heat"})Set living room lights to blue at 50% brightness
→ ha_call_service(domain="light", service="turn_on",
entity_id="light.living_room", data={"brightness": 128, "color_name": "blue"})Gateway Platform: เหตุการณ์แบบเรียลไทม์
Home Assistant gateway adapter เชื่อมต่อผ่าน WebSocket และสมัครรับเหตุการณ์ state_changed เมื่อสถานะของอุปกรณ์มีการเปลี่ยนแปลงและตรงกับ filters ที่กำหนดไว้ จะถูกส่งต่อไปยัง agent เป็นข้อความ
Event Filtering
:::warning Required Configuration
โดยค่าเริ่มต้น จะไม่มีการส่งต่อเหตุการณ์ใดๆ คุณต้องกำหนดค่าอย่างน้อยหนึ่งใน watch_domains, watch_entities, หรือ watch_all เพื่อรับเหตุการณ์ หากไม่มี filters จะมีการบันทึก warning เมื่อเริ่มต้นใช้งาน และการเปลี่ยนแปลงสถานะทั้งหมดจะถูกละเลยอย่างเงียบๆ
:::
กำหนดค่าว่า agent จะเห็นเหตุการณ์ใดได้บ้างในไฟล์ ~/.hermes/config.yaml ภายใต้ส่วน extra ของ Home Assistant platform:
platforms:
homeassistant:
enabled: true
extra:
watch_domains:
- climate
- binary_sensor
- alarm_control_panel
- light
watch_entities:
- sensor.front_door_battery
ignore_entities:
- sensor.uptime
- sensor.cpu_usage
- sensor.memory_usage
cooldown_seconds: 30| Setting | Default | Description |
|---|---|---|
watch_domains | (none) | เฝ้าดูเฉพาะ entity domains เหล่านี้ (เช่น climate, light, binary_sensor) |
watch_entities | (none) | เฝ้าดูเฉพาะ entity IDs เหล่านี้ |
watch_all | false | ตั้งค่าเป็น true เพื่อรับการเปลี่ยนแปลงสถานะ ทั้งหมด (ไม่แนะนำสำหรับส่วนใหญ่) |
ignore_entities | (none) | ละเลย entity เหล่านี้เสมอ (ใช้ก่อนการกรอง domain/entity) |
cooldown_seconds | 30 | จำนวนวินาทีขั้นต่ำระหว่างเหตุการณ์สำหรับ entity เดียวกัน |
:::tip
เริ่มต้นด้วยชุด domains ที่เน้นเฉพาะเจาะจง - climate, binary_sensor, และ alarm_control_panel ครอบคลุม automation ที่มีประโยชน์ที่สุด เพิ่มเติมตามความจำเป็น ใช้ ignore_entities เพื่อระงับ sensor ที่มีสัญญาณรบกวน เช่น อุณหภูมิ CPU หรือตัวนับ uptime
:::
Event Formatting
การเปลี่ยนแปลงสถานะจะถูกจัดรูปแบบเป็นข้อความที่มนุษย์อ่านได้ตาม domain:
| Domain | Format |
|---|---|
climate | "HVAC mode changed from 'off' to 'heat' (current: 21, target: 23)" |
sensor | "changed from 21°C to 22°C" |
binary_sensor | "triggered" / "cleared" |
light, switch, fan | "turned on" / "turned off" |
alarm_control_panel | "alarm state changed from 'armed_away' to 'triggered'" |
| (other) | "changed from 'old' to 'new'" |
Agent Responses
ข้อความขาออกจาก agent จะถูกส่งในรูปแบบ Home Assistant persistent notifications (ผ่าน persistent_notification.create) สิ่งเหล่านี้จะปรากฏในแผงแจ้งเตือนของ HA โดยมีชื่อเรื่องว่า "Hermes Agent"
Connection Management
- WebSocket พร้อม heartbeat 30 วินาที สำหรับเหตุการณ์แบบเรียลไทม์
- Automatic reconnection พร้อม backoff: 5s → 10s → 30s → 60s
- REST API สำหรับการแจ้งเตือนขาออก (แยก session เพื่อหลีกเลี่ยงความขัดแย้งกับ WebSocket)
- Authorization - เหตุการณ์ HA จะได้รับการอนุญาตเสมอ (ไม่จำเป็นต้องมี user allowlist เนื่องจาก
HASS_TOKENทำหน้าที่ยืนยันการเชื่อมต่อ)
ความปลอดภัย
เครื่องมือของ Home Assistant บังคับใช้ข้อจำกัดด้านความปลอดภัย:
:::warning Blocked Domains service domains ต่อไปนี้ถูก บล็อก เพื่อป้องกันการรันโค้ดแบบสุ่มบน host ของ HA:
shell_command- คำสั่ง shell แบบสุ่มcommand_line- sensors/switches ที่รันคำสั่งpython_script- การรัน Python แบบ scriptedpyscript- การผสานรวม scripting ที่กว้างขึ้นhassio- การควบคุม addon, host shutdown/rebootrest_command- คำขอ HTTP จาก HA server (SSRF vector)
การพยายามเรียกใช้บริการใน domains เหล่านี้จะส่งคืนข้อผิดพลาด :::
Entity IDs จะถูกตรวจสอบความถูกต้องตามรูปแบบ ^[a-z_][a-z0-9_]*\.[a-z0-9_]+$ เพื่อป้องกันการโจมตีแบบ injection
ตัวอย่างระบบอัตโนมัติ
Morning Routine
User: Start my morning routine
Agent:
1. ha_call_service(domain="light", service="turn_on",
entity_id="light.bedroom", data={"brightness": 128})
2. ha_call_service(domain="climate", service="set_temperature",
entity_id="climate.thermostat", data={"temperature": 22})
3. ha_call_service(domain="media_player", service="turn_on",
entity_id="media_player.kitchen_speaker")Security Check
User: Is the house secure?
Agent:
1. ha_list_entities(domain="binary_sensor")
→ checks door/window sensors
2. ha_get_state(entity_id="alarm_control_panel.home")
→ checks alarm status
3. ha_list_entities(domain="lock")
→ checks lock states
4. Reports: "All doors closed, alarm is armed_away, all locks engaged."Reactive Automation (via Gateway Events)
เมื่อเชื่อมต่อในรูปแบบ gateway platform agent สามารถตอบสนองต่อเหตุการณ์ได้:
[Home Assistant] Front Door: triggered (was cleared)
Agent automatically:
1. ha_get_state(entity_id="binary_sensor.front_door")
2. ha_call_service(domain="light", service="turn_on",
entity_id="light.hallway")
3. Sends notification: "Front door opened. Hallway lights turned on."📄 user-guide/messaging/matrix.md
sidebar_position: 9 title: "Matrix" description: "Set up Hermes Agent as a Matrix bot"
การตั้งค่า Matrix
Hermes Agent ทำงานร่วมกับ Matrix ซึ่งเป็นโปรโตคอลการส่งข้อความแบบ federated ที่เปิดกว้าง Matrix ช่วยให้คุณสามารถรัน homeserver ของตัวเอง หรือใช้ homeserver สาธารณะอย่าง matrix.org ได้ ไม่ว่าจะด้วยวิธีใด คุณก็ยังคงควบคุมการสื่อสารของคุณได้ บอทจะเชื่อมต่อผ่าน Python SDK mautrix ประมวลผลข้อความผ่าน pipeline ของ Hermes Agent (รวมถึงการใช้ tool, memory, และ reasoning) และตอบกลับแบบ real time โดยรองรับข้อความ, file attachments, รูปภาพ, เสียง, วิดีโอ, และการเข้ารหัสแบบ end-to-end (E2EE) แบบทางเลือก
Hermes ทำงานได้กับ homeserver Matrix ใดๆ - Synapse, Conduit, Dendrite, หรือ matrix.org
ก่อนการตั้งค่า นี่คือส่วนที่คนส่วนใหญ่ต้องการทราบ: Hermes จะมีพฤติกรรมอย่างไรเมื่อเชื่อมต่อแล้ว
พฤติกรรมของ Hermes
| Context | Behavior |
|---|---|
| DMs | Hermes จะตอบกลับทุกข้อความ ไม่จำเป็นต้อง @mention แต่ละ DM มี session ของตัวเอง ตั้งค่า MATRIX_DM_MENTION_THREADS=true เพื่อเริ่ม thread เมื่อบอทถูก @mention ใน DM |
| Rooms | โดยค่าเริ่มต้น Hermes ต้องการ @mention เพื่อตอบกลับ ตั้งค่า MATRIX_REQUIRE_MENTION=false หรือเพิ่ม room IDs ใน MATRIX_FREE_RESPONSE_ROOMS สำหรับห้องที่ตอบได้อิสระ การเชิญเข้าห้องจะถูกยอมรับโดยอัตโนมัติ |
| Threads | Hermes รองรับ Matrix threads (MSC3440) หากคุณตอบกลับใน thread, Hermes จะเก็บ context ของ thread ให้แยกออกจาก timeline หลักของห้อง Threads ที่บอทเคยเข้าร่วมแล้วไม่จำเป็นต้องมีการ mention |
| Auto-threading | โดยค่าเริ่มต้น Hermes จะสร้าง thread ให้โดยอัตโนมัติสำหรับทุกข้อความที่ตอบกลับในห้อง วิธีนี้ช่วยให้การสนทนาแยกออกจากกัน ตั้งค่า MATRIX_AUTO_THREAD=false เพื่อปิดใช้งาน |
| Shared rooms with multiple users | โดยค่าเริ่มต้น Hermes จะแยก history session ตามผู้ใช้แต่ละคนภายในห้อง ผู้คนสองคนที่คุยกันในห้องเดียวกันจะไม่แชร์ transcript เดียวกัน เว้นแต่คุณจะปิดการทำงานนั้นอย่างชัดเจน |
:::tip บอทจะเข้าร่วมห้องโดยอัตโนมัติเมื่อถูกเชิญ เพียงแค่เชิญผู้ใช้ Matrix ของบอทเข้าห้องใดก็ได้ มันจะเข้าร่วมและเริ่มตอบกลับทันที :::
Session Model ใน Matrix
โดยค่าเริ่มต้น:
- แต่ละ DM จะได้รับ session ของตัวเอง
- แต่ละ thread จะได้รับ session namespace ของตัวเอง
- ผู้ใช้แต่ละคนในห้องที่แชร์กันจะได้รับ session ของตัวเองภายในห้องนั้น
สิ่งนี้ถูกควบคุมโดย config.yaml:
group_sessions_per_user: trueให้ตั้งค่าเป็น false เฉพาะเมื่อคุณต้องการให้ห้องแชร์การสนทนาเดียวกันสำหรับทั้งห้องเท่านั้น:
group_sessions_per_user: falseShared sessions อาจมีประโยชน์สำหรับห้องที่ทำงานร่วมกัน แต่ก็หมายความว่า:
- ผู้ใช้แชร์ context growth และ token costs
- งานที่ใช้ tool หนักๆ ของคนหนึ่งอาจทำให้ context ของคนอื่นบวมได้
- การรันงานที่กำลังดำเนินอยู่ของคนหนึ่งอาจขัดจังหวะการติดตามผลของอีกคนในห้องเดียวกัน
การตั้งค่า Mention และ Threading
คุณสามารถกำหนดค่าพฤติกรรม mention และ auto-threading ผ่าน environment variables หรือ config.yaml:
matrix:
require_mention: true # ต้องการ @mention ในห้อง (ค่าเริ่มต้น: true)
free_response_rooms: # ห้องที่ได้รับการยกเว้นจากการกำหนดให้ต้อง mention
- "!abc123:matrix.org"
auto_thread: true # สร้าง thread อัตโนมัติสำหรับการตอบกลับ (ค่าเริ่มต้น: true)
dm_mention_threads: false # สร้าง thread เมื่อ @mentioned ใน DM (ค่าเริ่มต้น: false)หรือผ่าน environment variables:
MATRIX_REQUIRE_MENTION=true
MATRIX_FREE_RESPONSE_ROOMS=!abc123:matrix.org,!def456:matrix.org
MATRIX_AUTO_THREAD=true
MATRIX_DM_MENTION_THREADS=false
MATRIX_REACTIONS=true # default: true — emoji reactions ระหว่างการประมวลผล:::tip Disabling reactions
MATRIX_REACTIONS=false จะปิด emoji reactions ในระหว่าง lifecycle การประมวลผลที่บอทโพสต์ในข้อความขาเข้า มีประโยชน์สำหรับห้องที่ event ของ reaction มีมากเกินไป หรือไม่ได้รองรับโดย client ที่เข้าร่วมทั้งหมด
:::
:::note
หากคุณกำลังอัปเกรดจากเวอร์ชันที่ไม่มี MATRIX_REQUIRE_MENTION บอทจะตอบกลับทุกข้อความในห้องก่อนหน้านี้ เพื่อรักษาพฤติกรรมนั้น ให้ตั้งค่า MATRIX_REQUIRE_MENTION=false
:::
คู่มือนี้จะพาคุณไปตลอดกระบวนการตั้งค่า - ตั้งแต่การสร้างบัญชีบอทของคุณไปจนถึงการส่งข้อความแรก
ขั้นตอนที่ 1: สร้างบัญชีบอท
คุณต้องมีบัญชีผู้ใช้ Matrix สำหรับบอท มีหลายวิธีในการทำเช่นนี้:
Option A: ลงทะเบียนบน Homeserver ของคุณ (แนะนำ)
หากคุณรัน homeserver ของตัวเอง (Synapse, Conduit, Dendrite):
- ใช้ admin API หรือ registration tool เพื่อสร้างผู้ใช้ใหม่:
# Synapse example
register_new_matrix_user -c /etc/synapse/homeserver.yaml http://localhost:8008- เลือกชื่อผู้ใช้ เช่น
hermes- user ID เต็มจะเป็น@hermes:your-server.org
Option B: ใช้ matrix.org หรือ Homeserver สาธารณะอื่น
- ไปที่ Element Web และสร้างบัญชีใหม่
- เลือกชื่อผู้ใช้สำหรับบอทของคุณ (เช่น
hermes-bot)
Option C: ใช้บัญชีของคุณเอง
คุณยังสามารถรัน Hermes ในฐานะผู้ใช้ของคุณเองได้ ซึ่งหมายความว่าบอทจะโพสต์ในชื่อของคุณ - มีประโยชน์สำหรับผู้ช่วยส่วนตัว
ขั้นตอนที่ 2: รับ Access Token
Hermes ต้องการ access token เพื่อยืนยันตัวตนกับ homeserver คุณมีสองทางเลือก:
Option A: Access Token (แนะนำ)
วิธีที่เชื่อถือได้ที่สุดในการรับ token:
ผ่าน Element:
- เข้าสู่ระบบ Element ด้วยบัญชีบอท
- ไปที่ Settings → Help & About.
- เลื่อนลงและขยาย Advanced - access token จะแสดงอยู่ที่นั่น
- คัดลอกทันที
ผ่าน API:
curl -X POST https://your-server/_matrix/client/v3/login \
-H "Content-Type: application/json" \
-d '{
"type": "m.login.password",
"user": "@hermes:your-server.org",
"password": "your-password"
}'การตอบกลับจะรวม field access_token - คัดลอกสิ่งนี้
:::warning[เก็บ access token ของคุณให้ปลอดภัย] access token ให้สิทธิ์เข้าถึงบัญชี Matrix ของบอทอย่างเต็มที่ ห้ามแชร์ต่อสาธารณะหรือ commit เข้า Git หากถูกบุกรุก ให้เพิกถอนสิทธิ์โดยการออกจากระบบทุก session สำหรับผู้ใช้นั้น :::
Option B: Password Login
แทนที่จะให้ access token คุณสามารถให้ user ID และ password ของบอทแก่ Hermes ได้ Hermes จะเข้าสู่ระบบโดยอัตโนมัติเมื่อเริ่มต้น นี่ง่ายกว่า แต่หมายความว่า password จะถูกเก็บไว้ในไฟล์ .env ของคุณ
MATRIX_USER_ID=@hermes:your-server.org
MATRIX_PASSWORD=your-passwordขั้นตอนที่ 3: ค้นหา Matrix User ID ของคุณ
Hermes Agent ใช้ Matrix User ID ของคุณเพื่อควบคุมว่าใครสามารถโต้ตอบกับบอทได้ Matrix User IDs มีรูปแบบ @username:server
ในการค้นหาของคุณ:
- เปิด Element (หรือ Matrix client ที่คุณต้องการ)
- คลิกที่ avatar ของคุณ → Settings.
- User ID ของคุณจะแสดงที่ด้านบนของโปรไฟล์ (เช่น
@alice:matrix.org)
:::tip
Matrix User IDs จะขึ้นต้นด้วย @ เสมอ และมี : ตามด้วยชื่อ server ตัวอย่างเช่น: @alice:matrix.org, @bob:your-server.com
:::
ขั้นตอนที่ 4: กำหนดค่า Hermes Agent
Option A: การตั้งค่าแบบ Interactive (แนะนำ)
รันคำสั่ง setup แบบ guided:
hermes gateway setupเลือก Matrix เมื่อถูกแจ้งเตือน จากนั้นให้ URL homeserver, access token (หรือ user ID + password), และ user IDs ที่อนุญาตเมื่อถูกถาม
Option B: การกำหนดค่าแบบ Manual
เพิ่มสิ่งต่อไปนี้ในไฟล์ ~/.hermes/.env ของคุณ:
เมื่อใช้ access token:
# Required
MATRIX_HOMESERVER=https://matrix.example.org
MATRIX_ACCESS_TOKEN=***
# Optional: user ID (auto-detected from token if omitted)
# MATRIX_USER_ID=@hermes:matrix.example.org
# Security: restrict who can interact with the bot
MATRIX_ALLOWED_USERS=@alice:matrix.example.org
# Multiple allowed users (comma-separated)
# MATRIX_ALLOWED_USERS=@alice:matrix.example.org,@bob:matrix.example.orgเมื่อใช้ password login:
# Required
MATRIX_HOMESERVER=https://matrix.example.org
MATRIX_USER_ID=@hermes:matrix.example.org
MATRIX_PASSWORD=***
# Security
MATRIX_ALLOWED_USERS=@alice:matrix.example.orgการตั้งค่าพฤติกรรมเสริมใน ~/.hermes/config.yaml:
group_sessions_per_user: truegroup_sessions_per_user: trueจะเก็บ context ของผู้เข้าร่วมแต่ละคนให้แยกออกจากกันภายในห้องที่แชร์
เริ่มต้น Gateway
เมื่อกำหนดค่าแล้ว ให้เริ่ม Matrix gateway:
hermes gatewayบอทควรเชื่อมต่อกับ homeserver ของคุณและเริ่ม sync ภายในไม่กี่วินาที ส่งข้อความให้มัน - ไม่ว่าจะเป็น DM หรือในห้องที่มันเข้าร่วม - เพื่อทดสอบ
:::tip
คุณสามารถรัน hermes gateway ใน background หรือเป็น systemd service เพื่อการทำงานที่ต่อเนื่อง ดูเอกสาร deployment สำหรับรายละเอียด
:::
End-to-End Encryption (E2EE)
Hermes รองรับ end-to-end encryption ของ Matrix ดังนั้นคุณจึงสามารถแชทกับบอทของคุณในห้องที่เข้ารหัสได้
Requirements
E2EE ต้องการไลบรารี mautrix พร้อม encryption extras และไลบรารี C libolm:
# ติดตั้ง mautrix พร้อมการรองรับ E2EE
pip install 'mautrix[encryption]'
# หรือติดตั้งด้วย hermes extras
pip install 'hermes-agent[matrix]'คุณยังต้องติดตั้ง libolm บนระบบของคุณ:
# Debian/Ubuntu
sudo apt install libolm-dev
# macOS
brew install libolm
# Fedora
sudo dnf install libolm-develเปิดใช้งาน E2EE
เพิ่มใน ~/.hermes/.env ของคุณ:
MATRIX_ENCRYPTION=trueเมื่อเปิดใช้งาน E2EE, Hermes จะ:
- เก็บ encryption keys ใน
~/.hermes/platforms/matrix/store/(สำหรับติดตั้งแบบ legacy:~/.hermes/matrix/store/) - อัปโหลด device keys เมื่อเชื่อมต่อครั้งแรก
- ถอดรหัสข้อความขาเข้าและเข้ารหัสข้อความขาออกโดยอัตโนมัติ
- เข้าร่วมห้องที่เข้ารหัสโดยอัตโนมัติเมื่อถูกเชิญ
Cross-Signing Verification (แนะนำ)
หากบัญชี Matrix ของคุณเปิดใช้งาน cross-signing (ค่าเริ่มต้นใน Element) ให้ตั้งค่า recovery key เพื่อให้บอทสามารถ self-sign device ของตัวเองเมื่อเริ่มต้นทำงาน หากไม่มีสิ่งนี้ Client Matrix อื่นๆ อาจปฏิเสธที่จะแชร์ encryption sessions กับบอทหลังจากมีการหมุนเวียน device key
MATRIX_RECOVERY_KEY=EsT... your recovery key hereหาได้ที่ไหน: ใน Element ไปที่ Settings → Security & Privacy → Encryption → recovery key ของคุณ (หรือที่เรียกว่า "Security Key") นี่คือคีย์ที่คุณถูกขอให้บันทึกเมื่อคุณตั้งค่า cross-signing ครั้งแรก
ในการเริ่มต้นแต่ละครั้ง หาก MATRIX_RECOVERY_KEY ถูกตั้งค่า, Hermes จะนำเข้า cross-signing keys จาก secure secret storage ของ homeserver และ sign device ปัจจุบัน สิ่งนี้เป็นกระบวนการที่ idempotent และปลอดภัยที่จะเปิดใช้งานอย่างถาวร
:::warning[การลบ crypto store]
หากคุณลบ ~/.hermes/platforms/matrix/store/crypto.db, บอทจะสูญเสีย identity การเข้ารหัสของมัน การรีสตาร์ทด้วย device ID เดิมจะไม่สามารถกู้คืนได้อย่างสมบูรณ์ - homeserver ยังคงเก็บ one-time keys ที่ sign ด้วย old identity key และ peers ไม่สามารถสร้าง Olm sessions ใหม่ได้
Hermes ตรวจพบสภาวะนี้เมื่อเริ่มต้นและปฏิเสธที่จะเปิดใช้งาน E2EE โดยบันทึก: device XXXX has stale one-time keys on the server signed with a previous identity key
วิธีที่ง่ายที่สุดในการกู้คืน: สร้าง access token ใหม่ (ซึ่งจะได้ device ID ใหม่ที่ไม่มีประวัติ key เก่า) ดูส่วน "Upgrading from a previous version with E2EE" ด้านล่าง นี่เป็นเส้นทางที่เชื่อถือได้ที่สุดและหลีกเลี่ยงการแตะต้อง homeserver database
การกู้คืนแบบ Manual (ขั้นสูง - เก็บ device ID เดิม):
-
หยุด Synapse และลบ device เก่าจาก database:
sudo systemctl stop matrix-synapse sudo sqlite3 /var/lib/matrix-synapse/homeserver.db " DELETE FROM e2e_device_keys_json WHERE device_id = 'DEVICE_ID' AND user_id = '@hermes:your-server'; DELETE FROM e2e_one_time_keys_json WHERE device_id = 'DEVICE_ID' AND user_id = '@hermes:your-server'; DELETE FROM e2e_fallback_keys_json WHERE device_id = 'DEVICE_ID' AND user_id = '@hermes:your-server'; DELETE FROM devices WHERE device_id = 'DEVICE_ID' AND user_id = '@hermes:your-server'; " sudo systemctl start matrix-synapseหรือผ่าน Synapse admin API (สังเกต user ID ที่ URL-encoded):
curl -X DELETE -H "Authorization: Bearer ADMIN_TOKEN" \ 'https://your-server/_synapse/admin/v2/users/%40hermes%3Ayour-server/devices/DEVICE_ID'หมายเหตุ: การลบ device ผ่าน admin API อาจทำให้ access token ที่เกี่ยวข้องเป็นโมฆะ คุณอาจต้องสร้าง token ใหม่หลังจากนั้น
-
ลบ local crypto store และรีสตาร์ท Hermes:
rm -f ~/.hermes/platforms/matrix/store/crypto.db* # restart hermes
Client Matrix อื่นๆ (Element, matrix-commander) อาจ cache device keys เก่า หลังจากกู้คืนแล้ว ให้พิมพ์ /discardsession ใน Element เพื่อบังคับสร้าง encryption session ใหม่กับบอท
:::
:::info
หากไม่ได้ติดตั้ง mautrix[encryption] หรือ libolm หายไป บอทจะ fallback ไปใช้ client แบบ plain (ไม่เข้ารหัส) โดยอัตโนมัติ คุณจะเห็นคำเตือนใน logs
:::
Home Room
คุณสามารถกำหนด "home room" ที่บอทจะส่งข้อความเชิงรุก (เช่น output ของ cron job, การแจ้งเตือน, และ notification) มีสองวิธีในการตั้งค่า:
การใช้ Slash Command
พิมพ์ /sethome ในห้อง Matrix ใดๆ ที่บอทอยู่ ห้องนั้นจะกลายเป็น home room
การกำหนดค่าแบบ Manual
เพิ่มสิ่งนี้ใน ~/.hermes/.env ของคุณ:
MATRIX_HOME_ROOM=!abc123def456:matrix.example.org:::tip
ในการค้นหา Room ID: ใน Element ไปที่ห้อง → Settings → Advanced → Internal room ID จะแสดงอยู่ที่นั่น (ขึ้นต้นด้วย !)
:::
การแก้ไขปัญหา (Troubleshooting)
บอทไม่ตอบสนองต่อข้อความ
สาเหตุ: บอทไม่ได้เข้าร่วมห้อง หรือ MATRIX_ALLOWED_USERS ไม่รวม User ID ของคุณ
วิธีแก้ไข: เชิญบอทเข้าห้อง - มันจะเข้าร่วมโดยอัตโนมัติเมื่อถูกเชิญ ตรวจสอบว่า User ID ของคุณอยู่ใน MATRIX_ALLOWED_USERS (ใช้รูปแบบ @user:server เต็ม) รีสตาร์ท gateway
"Failed to authenticate" / "whoami failed" เมื่อเริ่มต้น
สาเหตุ: access token หรือ homeserver URL ไม่ถูกต้อง
วิธีแก้ไข: ตรวจสอบว่า MATRIX_HOMESERVER ชี้ไปยัง homeserver ของคุณ (รวม https://, ไม่มี trailing slash) ตรวจสอบว่า MATRIX_ACCESS_TOKEN ถูกต้อง - ลองใช้กับ curl:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-server/_matrix/client/v3/account/whoamiหากสิ่งนี้ส่งข้อมูลผู้ใช้ของคุณกลับมา แสดงว่า token ถูกต้อง หากส่งข้อผิดพลาดกลับมา ให้สร้าง token ใหม่
ข้อผิดพลาด "mautrix not installed"
สาเหตุ: ไม่ได้ติดตั้ง package Python mautrix
วิธีแก้ไข: ติดตั้ง:
pip install 'mautrix[encryption]'หรือด้วย Hermes extras:
pip install 'hermes-agent[matrix]'ข้อผิดพลาดการเข้ารหัส / "could not decrypt event"
สาเหตุ: ขาด encryption keys, libolm ไม่ได้ติดตั้ง, หรือ device ของบอทไม่น่าเชื่อถือ
วิธีแก้ไข:
- ตรวจสอบว่า
libolmติดตั้งบนระบบของคุณแล้ว (ดูส่วน E2EE ด้านบน) - ตรวจสอบให้แน่ใจว่า
MATRIX_ENCRYPTION=trueถูกตั้งค่าใน.envของคุณ - ใน Matrix client ของคุณ (Element), ไปที่โปรไฟล์ของบอท -> Sessions -> verify/trust device ของบอท
- หากบอทเพิ่งเข้าร่วมห้องที่เข้ารหัส มันจะถอดรหัสข้อความที่ส่ง หลังจาก มันเข้าร่วมได้เท่านั้น ข้อความเก่าจะไม่สามารถเข้าถึงได้
การอัปเกรดจากเวอร์ชันก่อนหน้าที่มี E2EE
:::tip
หากคุณลบ crypto.db ด้วยตัวเองด้วย ให้ดูคำเตือน "Deleting the crypto store" ในส่วน E2EE ด้านบน - มีขั้นตอนเพิ่มเติมในการล้าง one-time keys ที่ล้าสมัยออกจาก homeserver
:::
หากคุณเคยใช้ Hermes ด้วย MATRIX_ENCRYPTION=true และกำลังอัปเกรดเป็นเวอร์ชันที่ใช้ crypto store แบบ SQLite ใหม่ identity การเข้ารหัสของบอทได้เปลี่ยนไป Client Matrix ของคุณ (Element) อาจ cache device keys เก่า และปฏิเสธที่จะแชร์ encryption sessions กับบอท
อาการ: บอทเชื่อมต่อและแสดง "E2EE enabled" ใน logs แต่ข้อความทั้งหมดแสดง "could not decrypt event" และบอทไม่ตอบกลับเลย
เกิดอะไรขึ้น: สถานะการเข้ารหัสเก่า (จาก backend matrix-nio หรือ mautrix ที่อิงจากการ serialize) ไม่เข้ากันกับ crypto store แบบ SQLite ใหม่ บอทสร้าง identity การเข้ารหัสใหม่ แต่ Client Matrix ของคุณยังคง cache keys เก่า และจะไม่แชร์ encryption session ของห้องกับ device ที่ keys เปลี่ยนไป นี่คือคุณสมบัติความปลอดภัยของ Matrix - client จะถือว่า identity keys ที่เปลี่ยนไปสำหรับ device เดียวกันเป็นสิ่งที่น่าสงสัย
วิธีแก้ไข (การย้ายข้อมูลครั้งเดียว):
-
สร้าง access token ใหม่ เพื่อรับ device ID ใหม่ วิธีที่ง่ายที่สุด:
curl -X POST https://your-server/_matrix/client/v3/login \ -H "Content-Type: application/json" \ -d '{ "type": "m.login.password", "identifier": {"type": "m.id.user", "user": "@hermes:your-server.org"}, "password": "***", "initial_device_display_name": "Hermes Agent" }'คัดลอก
access_tokenใหม่ และอัปเดตMATRIX_ACCESS_TOKENใน~/.hermes/.env -
ลบ encryption state เก่า:
rm -f ~/.hermes/platforms/matrix/store/crypto.db rm -f ~/.hermes/platforms/matrix/store/crypto_store.* -
ตั้งค่า recovery key ของคุณ (หากคุณใช้ cross-signing - ผู้ใช้ Element ส่วนใหญ่ทำ) เพิ่มใน
~/.hermes/.env:MATRIX_RECOVERY_KEY=EsT... your recovery key hereสิ่งนี้ช่วยให้บอท self-sign ด้วย cross-signing keys เมื่อเริ่มต้น ทำให้ Element เชื่อถือ device ใหม่ทันที หากไม่มีสิ่งนี้ Element อาจเห็น device ใหม่ว่าไม่ได้รับการตรวจสอบและปฏิเสธที่จะแชร์ encryption sessions
-
บังคับให้ Matrix client ของคุณหมุนเวียน encryption session ใน Element เปิด DM room กับบอทและพิมพ์
/discardsessionสิ่งนี้บังคับให้ Element สร้าง encryption session ใหม่และแชร์กับ device ใหม่ของบอท -
รีสตาร์ท gateway:
hermes gateway runหาก
MATRIX_RECOVERY_KEYถูกตั้งค่า คุณควรเห็นMatrix: cross-signing verified via recovery keyใน logs -
ส่งข้อความใหม่ บอทควรถอดรหัสและตอบกลับตามปกติ
:::note หลังการย้ายข้อมูล ข้อความที่ส่ง ก่อน การอัปเกรดจะไม่สามารถถอดรหัสได้ - encryption keys เก่าหายไป สิ่งนี้ส่งผลกระทบเฉพาะช่วงการเปลี่ยนผ่านเท่านั้น ข้อความใหม่ทำงานได้ตามปกติ :::
:::tip การติดตั้งใหม่ไม่ได้รับผลกระทบ การย้ายข้อมูลนี้จำเป็นเฉพาะเมื่อคุณเคยมีการตั้งค่า E2EE ที่ทำงานได้ด้วย Hermes เวอร์ชันก่อนหน้าและกำลังอัปเกรด
ทำไมต้องใช้ access token ใหม่? Matrix access token แต่ละตัวผูกติดกับ device ID เฉพาะ การใช้ device ID เดิมกับ encryption keys ใหม่ทำให้ Client Matrix อื่นๆ ไม่เชื่อถือ device (พวกเขามองว่า identity keys ที่เปลี่ยนไปเป็น potential security breach) access token ใหม่จะได้รับ device ID ใหม่ที่ไม่มีประวัติ key เก่า ดังนั้น client อื่นๆ จึงเชื่อถือมันทันที :::
Proxy Mode (E2EE on macOS)
Matrix E2EE ต้องการ libolm ซึ่งไม่สามารถ compile บน macOS ARM64 (Apple Silicon) ได้ extra hermes-agent[matrix] จึงถูกจำกัดให้ใช้กับ Linux เท่านั้น หากคุณใช้ macOS, proxy mode จะช่วยให้คุณรัน E2EE ใน Docker container บน Linux VM ในขณะที่ agent จริงทำงานแบบ native บน macOS โดยเข้าถึง local files, memory, และ skills ของคุณได้อย่างเต็มที่
How It Works
macOS (Host):
└─ hermes gateway
├─ api_server adapter ← listens on 0.0.0.0:8642
├─ AIAgent ← single source of truth
├─ Sessions, memory, skills
└─ Local file access (Obsidian, projects, etc.)
Linux VM (Docker):
└─ hermes gateway (proxy mode)
├─ Matrix adapter ← E2EE decryption/encryption
└─ HTTP forward → macOS:8642/v1/chat/completions
(no LLM API keys, no agent, no inference)Docker container จัดการเฉพาะ Matrix protocol + E2EE เมื่อมีข้อความมาถึง มันจะถอดรหัสและส่งข้อความไปยัง host ผ่าน HTTP request มาตรฐาน Host จะรัน agent, เรียกใช้ tools, สร้าง response, และ stream กลับ Container จะเข้ารหัสและส่ง response ไปยัง Matrix ทุก session ถูกรวมเป็นหนึ่งเดียว - CLI, Matrix, Telegram, และแพลตฟอร์มอื่น ๆ แชร์ memory และ conversation history เดียวกัน
Step 1: Configure the Host (macOS)
เปิดใช้งาน API server เพื่อให้ host ยอมรับ incoming requests จาก Docker container
เพิ่มใน ~/.hermes/.env:
API_SERVER_ENABLED=true
API_SERVER_KEY=your-secret-key-here
API_SERVER_HOST=0.0.0.0API_SERVER_HOST=0.0.0.0ผูกกับทุก interface เพื่อให้ Docker container เข้าถึงได้API_SERVER_KEYจำเป็นสำหรับ non-loopback binding เลือก string สุ่มที่แข็งแกร่ง- API server รันที่ port 8642 โดยค่าเริ่มต้น (เปลี่ยนด้วย
API_SERVER_PORTหากจำเป็น)
เริ่ม gateway:
hermes gatewayคุณควรเห็น API server เริ่มทำงานพร้อมกับแพลตฟอร์มอื่น ๆ ที่คุณกำหนดค่าไว้ ตรวจสอบว่าสามารถเข้าถึงได้จาก VM:
# จาก Linux VM
curl http://<mac-ip>:8642/healthStep 2: Configure the Docker Container (Linux VM)
Container ต้องการ Matrix credentials และ proxy URL มันไม่ต้องการ LLM API keys
docker-compose.yml:
services:
hermes-matrix:
build: .
environment:
# Matrix credentials
MATRIX_HOMESERVER: "https://matrix.example.org"
MATRIX_ACCESS_TOKEN: "syt_..."
MATRIX_ALLOWED_USERS: "@you:matrix.example.org"
MATRIX_ENCRYPTION: "true"
MATRIX_DEVICE_ID: "HERMES_BOT"
# Proxy mode — forward to host agent
GATEWAY_PROXY_URL: "http://192.168.1.100:8642"
GATEWAY_PROXY_KEY: "your-secret-key-here"
volumes:
- ./matrix-store:/root/.hermes/platforms/matrix/storeDockerfile:
FROM python:3.11-slim
RUN apt-get update && apt-get install -y libolm-dev && rm -rf /var/lib/apt/lists/*
RUN pip install 'hermes-agent[matrix]'
CMD ["hermes", "gateway"]นั่นคือ container ทั้งหมด ไม่มี API keys สำหรับ OpenRouter, Anthropic, หรือ inference provider ใดๆ
Step 3: Start Both
-
เริ่ม host gateway ก่อน:
hermes gateway -
เริ่ม Docker container:
docker compose up -d -
ส่งข้อความในห้อง Matrix ที่เข้ารหัส Container จะถอดรหัสและส่งต่อไปยัง host และ stream response กลับมา
Configuration Reference
Proxy mode ถูกกำหนดค่าที่ ฝั่ง container (gateway ที่บางเบา):
| Setting | Description |
|---|---|
GATEWAY_PROXY_URL | URL ของ Hermes API server ระยะไกล (เช่น http://192.168.1.100:8642) |
GATEWAY_PROXY_KEY | Bearer token สำหรับการตรวจสอบสิทธิ์ (ต้องตรงกับ API_SERVER_KEY บน host) |
gateway.proxy_url | เหมือนกับ GATEWAY_PROXY_URL แต่ใน config.yaml |
ฝั่ง host ต้องการ:
| Setting | Description |
|---|---|
API_SERVER_ENABLED | ตั้งค่าเป็น true |
API_SERVER_KEY | Bearer token (แชร์กับ container) |
API_SERVER_HOST | ตั้งค่าเป็น 0.0.0.0 สำหรับการเข้าถึงเครือข่าย |
API_SERVER_PORT | หมายเลขพอร์ต (ค่าเริ่มต้น: 8642) |
Works for Any Platform
Proxy mode ไม่ได้จำกัดแค่ Matrix เท่านั้น Adapter แพลตฟอร์มใดๆ สามารถใช้ได้ - ตั้งค่า GATEWAY_PROXY_URL บน gateway instance ใดๆ และมันจะส่งต่อไปยัง agent ระยะไกลแทนที่จะรันในเครื่องนี้ มีประโยชน์สำหรับการ deployment ใดๆ ที่ platform adapter ต้องการรันในสภาพแวดล้อมที่แตกต่างจาก agent (network isolation, E2EE requirements, resource constraints)
:::tip
Session continuity ถูกรักษาไว้ผ่าน header X-Hermes-Session-Id API server ของ host ติดตาม session ด้วย ID นี้ ดังนั้นการสนทนาจึงคงอยู่ข้ามข้อความเหมือนกับที่ทำกับ local agent
:::
:::note ข้อจำกัด (v1): ข้อความความคืบหน้าของ tool จาก agent ระยะไกลจะไม่ถูกส่งกลับ - ผู้ใช้จะเห็นเฉพาะ final response ที่ stream เท่านั้น ไม่ใช่การเรียกใช้ tool ทีละครั้ง การแจ้งเตือนการอนุมัติคำสั่งอันตรายจะจัดการที่ฝั่ง host ไม่ได้ส่งต่อไปยังผู้ใช้ Matrix สิ่งเหล่านี้สามารถแก้ไขได้ในการอัปเดตในอนาคต :::
Sync issues / bot falls behind
สาเหตุ: การรัน tool ที่ใช้เวลานานสามารถทำให้ sync loop ล่าช้า หรือ homeserver ช้า
วิธีแก้ไข: sync loop จะพยายามใหม่โดยอัตโนมัติทุก 5 วินาทีเมื่อเกิดข้อผิดพลาด ตรวจสอบ Hermes logs สำหรับคำเตือนที่เกี่ยวข้องกับการ sync หากบอทตามหลังอย่างต่อเนื่อง ให้แน่ใจว่า homeserver ของคุณมีทรัพยากรเพียงพอ
Bot is offline
สาเหตุ: Hermes gateway ไม่ได้รัน หรือล้มเหลวในการเชื่อมต่อ
วิธีแก้ไข: ตรวจสอบว่า hermes gateway กำลังทำงานอยู่ ดูที่ terminal output สำหรับข้อความข้อผิดพลาด ปัญหาทั่วไป: URL homeserver ผิด, access token หมดอายุ, homeserver เข้าถึงไม่ได้
"User not allowed" / Bot ignores you
สาเหตุ: User ID ของคุณไม่ได้อยู่ใน MATRIX_ALLOWED_USERS
วิธีแก้ไข: เพิ่ม User ID ของคุณใน MATRIX_ALLOWED_USERS ใน ~/.hermes/.env และรีสตาร์ท gateway ใช้รูปแบบ @user:server เต็ม
Security
:::warning
ควรตั้งค่า MATRIX_ALLOWED_USERS เสมอเพื่อจำกัดว่าใครสามารถโต้ตอบกับบอทได้ หากไม่มีสิ่งนี้ gateway จะปฏิเสธผู้ใช้ทั้งหมดโดยค่าเริ่มต้นเพื่อความปลอดภัย เพิ่มเฉพาะ User ID ของคนที่คุณไว้ใจเท่านั้น - ผู้ใช้ที่ได้รับอนุญาตมีสิทธิ์เข้าถึงความสามารถของ agent อย่างเต็มที่ รวมถึงการใช้ tool และการเข้าถึงระบบ
:::
สำหรับข้อมูลเพิ่มเติมเกี่ยวกับการรักษาความปลอดภัยการติดตั้ง Hermes Agent ของคุณ ดู Security Guide
Notes
- Any homeserver: ทำงานกับ Synapse, Conduit, Dendrite, matrix.org, หรือ homeserver Matrix ที่ compliant กับ spec ใดๆ ไม่จำเป็นต้องมีซอฟต์แวร์ homeserver เฉพาะ
- Federation: หากคุณอยู่บน homeserver แบบ federated, บอทสามารถสื่อสารกับผู้ใช้จากเซิร์ฟเวอร์อื่นได้ - เพียงแค่เพิ่ม full
@user:serverIDs ของพวกเขาในMATRIX_ALLOWED_USERS - Auto-join: บอทจะยอมรับคำเชิญเข้าห้องและเข้าร่วมโดยอัตโนมัติ มันจะเริ่มตอบกลับทันทีหลังจากเข้าร่วม
- Media support: Hermes สามารถส่งและรับรูปภาพ, เสียง, วิดีโอ, และ file attachments ได้ Media จะถูกอัปโหลดไปยัง homeserver ของคุณโดยใช้ Matrix content repository API
- Native voice messages (MSC3245): Matrix adapter จะติด flag
org.matrix.msc3245.voiceให้กับข้อความเสียงขาออกโดยอัตโนมัติ ซึ่งหมายความว่า TTS responses และ voice audio จะแสดงเป็น native voice bubbles ใน Element และ client อื่นๆ ที่รองรับ MSC3245 แทนที่จะเป็น file attachments เสียงทั่วไป ข้อความเสียงขาเข้าที่มี flag MSC3245 ก็จะถูกระบุและส่งต่อไปยัง speech-to-text transcription อย่างถูกต้อง ไม่จำเป็นต้องตั้งค่า - สิ่งนี้ทำงานโดยอัตโนมัติ
📄 user-guide/messaging/mattermost.md
sidebar_position: 8 title: "Mattermost" description: "Set up Hermes Agent as a Mattermost bot"
การตั้งค่า Mattermost
Hermes Agent ทำงานร่วมกับ Mattermost ในรูปแบบบอท ทำให้คุณสามารถแชทกับผู้ช่วย AI ของคุณได้ผ่านข้อความส่วนตัว (direct messages) หรือช่องทีม (team channels) Mattermost เป็นทางเลือกแบบ open-source ที่โฮสต์เองได้ (self-hosted) สำหรับ Slack - คุณสามารถรันมันบนโครงสร้างพื้นฐานของคุณเอง ทำให้คุณควบคุมข้อมูลได้อย่างเต็มที่ บอทจะเชื่อมต่อผ่าน Mattermost's REST API (v4) และ WebSocket สำหรับเหตุการณ์แบบ real-time โดยจะประมวลผลข้อความผ่าน pipeline ของ Hermes Agent (รวมถึง tool use, memory, และ reasoning) และตอบกลับแบบ real-time รองรับข้อความ (text), ไฟล์แนบ (file attachments), รูปภาพ (images), และ slash commands
ไม่จำเป็นต้องใช้ library ภายนอกของ Mattermost - adapter นี้ใช้ aiohttp ซึ่งเป็น dependency ที่ Hermes มีอยู่แล้ว
ก่อนการตั้งค่า นี่คือส่วนที่คนส่วนใหญ่ต้องการทราบ: Hermes จะทำงานอย่างไรเมื่ออยู่ใน instance Mattermost ของคุณ
วิธีการทำงานของ Hermes
| Context | Behavior |
|---|---|
| DMs | Hermes จะตอบกลับทุกข้อความ ไม่จำเป็นต้อง @mention แต่ละ DM จะมี session เป็นของตัวเอง |
| Public/private channels | Hermes จะตอบกลับเมื่อคุณ @mention มัน หากไม่มีการ mention Hermes จะเพิกเฉยต่อข้อความนั้น |
| Threads | หากตั้งค่า MATTERMOST_REPLY_MODE=thread Hermes จะตอบกลับในรูปแบบ thread ใต้ข้อความของคุณ บริบทของ thread จะถูกแยกออกจากช่องหลัก |
| Shared channels with multiple users | โดยค่าเริ่มต้น Hermes จะแยกประวัติ session เป็นรายผู้ใช้ภายในช่องนั้น ผู้ใช้สองคนที่คุยกันในช่องเดียวกันจะไม่แชร์ transcript เดียวกัน เว้นแต่คุณจะปิดฟังก์ชันนี้อย่างชัดเจน |
:::tip
หากคุณต้องการให้ Hermes ตอบกลับในรูปแบบการสนทนาแบบ thread (ซ้อนอยู่ใต้ข้อความต้นฉบับของคุณ) ให้ตั้งค่า MATTERMOST_REPLY_MODE=thread ค่าเริ่มต้นคือ off ซึ่งจะส่งข้อความแบบ flat ในช่อง
:::
Session Model ใน Mattermost
โดยค่าเริ่มต้น:
- แต่ละ DM จะได้รับ session ของตัวเอง
- แต่ละ thread จะได้รับ namespace session ของตัวเอง
- ผู้ใช้แต่ละคนในช่องที่แชร์กันจะได้รับ session ของตัวเองภายในช่องนั้น
สิ่งนี้ถูกควบคุมโดย config.yaml:
group_sessions_per_user: trueให้ตั้งค่าเป็น false เฉพาะเมื่อคุณต้องการให้มีการสนทนาที่แชร์กันสำหรับทั้งช่องเท่านั้น:
group_sessions_per_user: falseSession ที่แชร์กันอาจมีประโยชน์สำหรับช่องที่เน้นการทำงานร่วมกัน แต่ก็หมายความว่า:
- ผู้ใช้แชร์การเติบโตของ context และค่าใช้จ่าย token
- งานที่ใช้ tool หนักๆ ของคนหนึ่งอาจทำให้ context ของทุกคนบวมได้
- การรันงานที่กำลังดำเนินอยู่ของคนหนึ่งอาจขัดจังหวะการติดตามผลของอีกคนในช่องเดียวกัน
คู่มือนี้จะพาคุณไปตลอดกระบวนการตั้งค่าทั้งหมด - ตั้งแต่การสร้างบอทของคุณบน Mattermost ไปจนถึงการส่งข้อความแรก
ขั้นตอนที่ 1: เปิดใช้งานบัญชีบอท (Bot Accounts)
คุณต้องเปิดใช้งานบัญชีบอทบนเซิร์ฟเวอร์ Mattermost ของคุณก่อนจึงจะสามารถสร้างบอทได้
- เข้าสู่ระบบ Mattermost ในฐานะ System Admin
- ไปที่ System Console → Integrations → Bot Accounts
- ตั้งค่า Enable Bot Account Creation เป็น true
- คลิก Save
:::info หากคุณไม่มีสิทธิ์ System Admin ให้ขอให้ผู้ดูแลระบบ Mattermost ของคุณเปิดใช้งานบัญชีบอทและสร้างบัญชีให้คุณ :::
ขั้นตอนที่ 2: สร้างบัญชีบอท
- ใน Mattermost คลิกเมนู ☰ (มุมซ้ายบน) → Integrations → Bot Accounts
- คลิก Add Bot Account
- กรอกรายละเอียด:
- Username: เช่น
hermes - Display Name: เช่น
Hermes Agent - Description: (ไม่บังคับ)
- Role:
Memberก็เพียงพอ
- Username: เช่น
- คลิก Create Bot Account
- Mattermost จะแสดง bot token คัดลอกทันที
:::warning[Token shown only once] bot token จะแสดงเพียงครั้งเดียวเมื่อคุณสร้างบัญชีบอท หากคุณทำสูญหาย คุณจะต้องสร้างใหม่จากการตั้งค่าบัญชีบอท ห้ามแชร์ token ของคุณสู่สาธารณะหรือ commit มันไปยัง Git - ใครก็ตามที่มี token นี้จะควบคุมบอทได้อย่างเต็มที่ :::
เก็บ token ไว้ในที่ปลอดภัย (เช่น password manager) คุณจะต้องใช้มันในขั้นตอนที่ 5
:::tip คุณยังสามารถใช้ personal access token แทนบัญชีบอทได้ ไปที่ Profile → Security → Personal Access Tokens → Create Token วิธีนี้มีประโยชน์หากคุณต้องการให้ Hermes โพสต์ในฐานะผู้ใช้ของคุณเองแทนผู้ใช้บอทแยกต่างหาก :::
ขั้นตอนที่ 3: เพิ่มบอทเข้าสู่ช่อง (Channels)
บอทจะต้องเป็นสมาชิกของทุกช่องที่คุณต้องการให้มันตอบกลับ:
- เปิดช่องที่คุณต้องการให้บอททำงาน
- คลิกชื่อช่อง → Add Members
- ค้นหาชื่อผู้ใช้บอทของคุณ (เช่น
hermes) และเพิ่มมัน
สำหรับ DMs เพียงแค่เปิดข้อความส่วนตัวกับบอท - มันจะสามารถตอบกลับได้ทันที
ขั้นตอนที่ 4: ค้นหา User ID ของ Mattermost
Hermes Agent ใช้ Mattermost User ID ของคุณเพื่อควบคุมว่าใครสามารถโต้ตอบกับบอทได้ คุณสามารถค้นหาได้โดย:
- คลิก avatar ของคุณ (มุมซ้ายบน) → Profile
- User ID ของคุณจะแสดงในหน้าต่าง profile - คลิกเพื่อคัดลอก
User ID ของคุณคือสตริงตัวอักษรตัวเลข (alphanumeric) 26 ตัว เช่น 3uo8dkh1p7g1mfk49ear5fzs5c
:::warning
User ID ของคุณ ไม่ใช่ username username คือสิ่งที่ปรากฏหลังเครื่องหมาย @ (เช่น @alice) User ID คือตัวระบุตัวอักษรตัวเลขยาวๆ ที่ Mattermost ใช้ภายใน
:::
ทางเลือก: คุณยังสามารถรับ User ID ของคุณผ่าน API ได้:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-mattermost-server/api/v4/users/me | jq .id:::tip ในการรับ Channel ID: คลิกชื่อช่อง → View Info Channel ID จะแสดงในแผงข้อมูล คุณจะต้องใช้สิ่งนี้หากคุณต้องการตั้งค่า home channel ด้วยตนเอง :::
ขั้นตอนที่ 5: กำหนดค่า Hermes Agent
Option A: การตั้งค่าแบบโต้ตอบ (Interactive Setup) (แนะนำ)
รันคำสั่ง setup แบบ guided:
hermes gateway setupเลือก Mattermost เมื่อระบบแจ้งเตือน จากนั้นวาง URL เซิร์ฟเวอร์, bot token, และ user ID ของคุณเมื่อถูกถาม
Option B: การกำหนดค่าด้วยตนเอง (Manual Configuration)
เพิ่มสิ่งต่อไปนี้ในไฟล์ ~/.hermes/.env ของคุณ:
# Required
MATTERMOST_URL=https://mm.example.com
MATTERMOST_TOKEN=***
MATTERMOST_ALLOWED_USERS=3uo8dkh1p7g1mfk49ear5fzs5c
# Multiple allowed users (comma-separated)
# MATTERMOST_ALLOWED_USERS=3uo8dkh1p7g1mfk49ear5fzs5c,8fk2jd9s0a7bncm1xqw4tp6r3e
# Optional: reply mode (thread หรือ off, default: off)
# MATTERMOST_REPLY_MODE=thread
# Optional: respond without @mention (default: true = require mention)
# MATTERMOST_REQUIRE_MENTION=false
# Optional: channels where bot responds without @mention (comma-separated channel IDs)
# MATTERMOST_FREE_RESPONSE_CHANNELS=channel_id_1,channel_id_2การตั้งค่าพฤติกรรมเสริมใน ~/.hermes/config.yaml:
group_sessions_per_user: truegroup_sessions_per_user: trueจะรักษา context ของผู้เข้าร่วมแต่ละคนให้แยกกันภายในช่องที่แชร์และ thread
เริ่มต้น Gateway
เมื่อกำหนดค่าเสร็จแล้ว ให้เริ่ม Mattermost gateway:
hermes gatewayบอทควรเชื่อมต่อกับเซิร์ฟเวอร์ Mattermost ของคุณภายในไม่กี่วินาที ส่งข้อความให้มัน - ไม่ว่าจะเป็น DM หรือในช่องที่เพิ่มมันเข้าไป - เพื่อทดสอบ
:::tip
คุณสามารถรัน hermes gateway ใน background หรือเป็น systemd service เพื่อให้ทำงานอย่างต่อเนื่อง ดูเอกสาร deployment สำหรับรายละเอียด
:::
Home Channel
คุณสามารถกำหนด "home channel" ที่บอทจะส่งข้อความเชิงรุก (proactive messages) (เช่น ผลลัพธ์ของ cron job, การแจ้งเตือน, และการแจ้งเตือน) มีสองวิธีในการตั้งค่า:
การใช้ Slash Command
พิมพ์ /sethome ในช่อง Mattermost ใดก็ได้ที่บอทอยู่ ช่องนั้นจะกลายเป็น home channel
การกำหนดค่าด้วยตนเอง
เพิ่มสิ่งนี้ใน ~/.hermes/.env ของคุณ:
MATTERMOST_HOME_CHANNEL=abc123def456ghi789jkl012mnแทนที่ ID ด้วย channel ID จริง (คลิกชื่อช่อง → View Info → คัดลอก ID)
Reply Mode
การตั้งค่า MATTERMOST_REPLY_MODE ควบคุมวิธีการโพสต์การตอบกลับของ Hermes:
| Mode | Behavior |
|---|---|
off (default) | Hermes โพสต์ข้อความแบบ flat ในช่อง เหมือนผู้ใช้ทั่วไป |
thread | Hermes ตอบกลับในรูปแบบ thread ใต้ข้อความต้นฉบับของคุณ ช่วยให้ช่องดูสะอาดตาเมื่อมีการโต้ตอบไปมาจำนวนมาก |
ตั้งค่าใน ~/.hermes/.env ของคุณ:
MATTERMOST_REPLY_MODE=threadMention Behavior
โดยค่าเริ่มต้น บอทจะตอบกลับในช่องก็ต่อเมื่อมีการ @mention เท่านั้น คุณสามารถเปลี่ยนสิ่งนี้ได้:
| Variable | Default | Description |
|---|---|---|
MATTERMOST_REQUIRE_MENTION | true | ตั้งค่าเป็น false เพื่อตอบกลับข้อความทั้งหมดในช่อง (DMs ทำงานเสมอ) |
MATTERMOST_FREE_RESPONSE_CHANNELS | (none) | Channel IDs ที่คั่นด้วยเครื่องหมายจุลภาคที่บอทจะตอบกลับโดยไม่ต้อง @mention แม้ว่า require_mention จะเป็น true |
ในการค้นหา Channel ID ใน Mattermost: เปิดช่อง คลิกที่ส่วนหัวชื่อช่อง และมองหา ID ใน URL หรือรายละเอียดช่อง
เมื่อบอทถูก @mention การ mention จะถูกลบออกจากข้อความโดยอัตโนมัติก่อนการประมวลผล
การแก้ไขปัญหา (Troubleshooting)
บอทไม่ตอบกลับข้อความ
สาเหตุ: บอทไม่ได้เป็นสมาชิกของช่อง หรือ MATTERMOST_ALLOWED_USERS ไม่ได้รวม User ID ของคุณ
วิธีแก้ไข: เพิ่มบอทเข้าสู่ช่อง (ชื่อช่อง → Add Members → ค้นหาบอท) ตรวจสอบว่า User ID ของคุณอยู่ใน MATTERMOST_ALLOWED_USERS แล้ว และรีสตาร์ท gateway
ข้อผิดพลาด 403 Forbidden
สาเหตุ: bot token ไม่ถูกต้อง หรือบอทไม่มีสิทธิ์ในการโพสต์ในช่อง
วิธีแก้ไข: ตรวจสอบว่า MATTERMOST_TOKEN ในไฟล์ .env ของคุณถูกต้องหรือไม่ ตรวจสอบให้แน่ใจว่าบัญชีบอทไม่ได้ถูกปิดใช้งาน ตรวจสอบว่าบอทได้ถูกเพิ่มเข้าสู่ช่องแล้ว หากใช้ personal access token ให้แน่ใจว่าบัญชีของคุณมีสิทธิ์ที่จำเป็น
WebSocket disconnects / reconnection loops
สาเหตุ: ความไม่เสถียรของเครือข่าย, การรีสตาร์ทเซิร์ฟเวอร์ Mattermost, หรือปัญหา firewall/proxy กับการเชื่อมต่อ WebSocket
วิธีแก้ไข: adapter จะเชื่อมต่อใหม่โดยอัตโนมัติด้วย exponential backoff (2s → 60s) ตรวจสอบการตั้งค่า WebSocket ของเซิร์ฟเวอร์ของคุณ - reverse proxies (nginx, Apache) จำเป็นต้องตั้งค่า WebSocket upgrade headers ให้ถูกต้อง ตรวจสอบว่าไม่มี firewall บล็อกการเชื่อมต่อ WebSocket บนเซิร์ฟเวอร์ Mattermost ของคุณ
สำหรับ nginx ให้แน่ใจว่า config ของคุณรวม:
location /api/v4/websocket {
proxy_pass http://mattermost-backend;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 600s;
}"Failed to authenticate" เมื่อเริ่มต้น
สาเหตุ: token หรือ URL เซิร์ฟเวอร์ไม่ถูกต้อง
วิธีแก้ไข: ตรวจสอบว่า MATTERMOST_URL ชี้ไปยังเซิร์ฟเวอร์ Mattermost ของคุณ (รวม https:// และไม่มี trailing slash) ตรวจสอบว่า MATTERMOST_TOKEN ถูกต้อง - ลองใช้กับ curl:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-server/api/v4/users/meหากสิ่งนี้ส่งคืนข้อมูลผู้ใช้บอทของคุณ แสดงว่า token ถูกต้อง หากส่งคืนข้อผิดพลาด ให้สร้าง token ใหม่
บอทออฟไลน์
สาเหตุ: Hermes gateway ไม่ได้ทำงาน หรือล้มเหลวในการเชื่อมต่อ
วิธีแก้ไข: ตรวจสอบว่า hermes gateway กำลังทำงานอยู่ ดูที่ output ของ terminal เพื่อหาข้อความแสดงข้อผิดพลาด ปัญหาทั่วไป: URL ผิด, token หมดอายุ, Mattermost server เข้าถึงไม่ได้
"User not allowed" / บอทเพิกเฉยต่อคุณ
สาเหตุ: User ID ของคุณไม่ได้อยู่ใน MATTERMOST_ALLOWED_USERS
วิธีแก้ไข: เพิ่ม User ID ของคุณใน MATTERMOST_ALLOWED_USERS ใน ~/.hermes/.env และรีสตาร์ท gateway จำไว้ว่า: User ID คือสตริงตัวอักษรตัวเลข 26 ตัว ไม่ใช่ @username ของคุณ
Per-Channel Prompts
กำหนด system prompts ชั่วคราว (ephemeral) ให้กับช่อง Mattermost เฉพาะเจาะจง Prompt จะถูกแทรกใน runtime ในทุกรอบการสนทนา - ไม่เคยถูกบันทึกในประวัติ transcript - ดังนั้นการเปลี่ยนแปลงจะมีผลทันที
mattermost:
channel_prompts:
"channel_id_abc123": |
You are a research assistant. Focus on academic sources,
citations, and concise synthesis.
"channel_id_def456": |
Code review mode. Be precise about edge cases and
performance implications.Keys คือ Mattermost channel IDs (ค้นหาได้ใน URL ของช่องหรือผ่าน API) ข้อความทั้งหมดในช่องที่ตรงกันจะได้รับ prompt ที่ถูกแทรกเป็นคำสั่ง system ชั่วคราว
ความปลอดภัย (Security)
:::warning
ควรตั้งค่า MATTERMOST_ALLOWED_USERS เสมอ เพื่อจำกัดว่าใครสามารถโต้ตอบกับบอทได้ หากไม่มีการตั้งค่านี้ gateway จะปฏิเสธผู้ใช้ทั้งหมดโดยค่าเริ่มต้นเพื่อความปลอดภัย เพิ่มเฉพาะ User ID ของคนที่คุณไว้ใจเท่านั้น - ผู้ใช้ที่ได้รับอนุญาตจะเข้าถึงความสามารถของ agent ได้อย่างเต็มที่ รวมถึง tool use และ system access
:::
สำหรับข้อมูลเพิ่มเติมเกี่ยวกับการรักษาความปลอดภัยในการใช้งาน Hermes Agent ให้ดูที่ Security Guide
หมายเหตุ (Notes)
- เหมาะสำหรับ self-hosted: ทำงานได้กับ Mattermost instance ที่โฮสต์เองทุกประเภท ไม่จำเป็นต้องมีบัญชีหรือการสมัครสมาชิก Mattermost Cloud
- ไม่ต้องการ dependencies เพิ่มเติม: adapter ใช้
aiohttpสำหรับ HTTP และ WebSocket ซึ่งรวมอยู่ใน Hermes Agent อยู่แล้ว - รองรับ Team Edition: ทำงานได้ทั้ง Mattermost Team Edition (ฟรี) และ Enterprise Edition
📄 user-guide/messaging/open-webui.md
sidebar_position: 8 title: "Open WebUI" description: "Connect Open WebUI to Hermes Agent via the OpenAI-compatible API server"
การรวม Open WebUI
Open WebUI (126k★) เป็น chat interface สำหรับ AI แบบ self-hosted ที่ได้รับความนิยมที่สุด ด้วย API server ที่มาพร้อมกับ Hermes Agent คุณสามารถใช้ Open WebUI เป็น web frontend ที่สวยงามสำหรับ agent ของคุณ ซึ่งมาพร้อมกับการจัดการบทสนทนา บัญชีผู้ใช้ และ chat interface ที่ทันสมัย
สถาปัตยกรรม
flowchart LR
A["Open WebUI<br/>browser UI<br/>port 3000"]
B["hermes-agent<br/>gateway API server<br/>port 8642"]
A -->|POST /v1/chat/completions| B
B -->|SSE streaming response| AOpen WebUI เชื่อมต่อกับ API server ของ Hermes Agent เหมือนกับการเชื่อมต่อกับ OpenAI โดย agent ของคุณจะจัดการ requests ด้วย toolset ทั้งหมดของมัน - terminal, file operations, web search, memory, skills - และส่งคืน response สุดท้าย
Open WebUI สื่อสารกับ Hermes แบบ server-to-server ดังนั้นคุณจึงไม่จำเป็นต้องใช้ API_SERVER_CORS_ORIGINS สำหรับการรวมระบบนี้
การตั้งค่าเบื้องต้น
1. เปิดใช้งาน API server
เพิ่มใน ~/.hermes/.env:
API_SERVER_ENABLED=true
API_SERVER_KEY=your-secret-key2. เริ่มต้น Hermes Agent gateway
hermes gatewayคุณควรเห็น:
[API Server] API server listening on http://127.0.0.1:86423. เริ่มต้น Open WebUI
docker run -d -p 3000:8080 \
-e OPENAI_API_BASE_URL=http://host.docker.internal:8642/v1 \
-e OPENAI_API_KEY=your-secret-key \
--add-host=host.docker.internal:host-gateway \
-v open-webui:/app/backend/data \
--name open-webui \
--restart always \
ghcr.io/open-webui/open-webui:main4. เปิด UI
ไปที่ http://localhost:3000 สร้างบัญชี admin ของคุณ (ผู้ใช้คนแรกจะเป็น admin) คุณควรเห็น agent ของคุณในรายการ model dropdown (ชื่อตามโปรไฟล์ของคุณ หรือ hermes-agent สำหรับโปรไฟล์เริ่มต้น) เริ่มแชทได้เลย!
การตั้งค่าด้วย Docker Compose
สำหรับการตั้งค่าที่ถาวรยิ่งขึ้น ให้สร้างไฟล์ docker-compose.yml:
services:
open-webui:
image: ghcr.io/open-webui/open-webui:main
ports:
- "3000:8080"
volumes:
- open-webui:/app/backend/data
environment:
- OPENAI_API_BASE_URL=http://host.docker.internal:8642/v1
- OPENAI_API_KEY=your-secret-key
extra_hosts:
- "host.docker.internal:host-gateway"
restart: always
volumes:
open-webui:จากนั้น:
docker compose up -dการกำหนดค่าผ่าน Admin UI
หากคุณต้องการกำหนดค่าการเชื่อมต่อผ่าน UI แทนการใช้ environment variables:
- เข้าสู่ระบบ Open WebUI ที่ http://localhost:3000
- คลิก profile avatar ของคุณ → Admin Settings
- ไปที่ Connections
- ใต้ OpenAI API, คลิก wrench icon (Manage)
- คลิก + Add New Connection
- ป้อน:
- URL:
http://host.docker.internal:8642/v1 - API Key: key ของคุณ หรือค่าที่ไม่ว่างเปล่าใดๆ (เช่น
not-needed)
- URL:
- คลิก checkmark เพื่อตรวจสอบการเชื่อมต่อ
- Save
ตอนนี้ agent model ของคุณควรปรากฏใน model dropdown (ชื่อตามโปรไฟล์ของคุณ หรือ hermes-agent สำหรับโปรไฟล์เริ่มต้น)
:::warning Environment variables จะมีผลเฉพาะในการ เปิดใช้งานครั้งแรก ของ Open WebUI เท่านั้น หลังจากนั้น การตั้งค่าการเชื่อมต่อจะถูกจัดเก็บไว้ใน internal database ของมัน หากต้องการเปลี่ยนในภายหลัง ให้ใช้ Admin UI หรือลบ Docker volume และเริ่มใหม่ :::
ประเภท API: Chat Completions เทียบกับ Responses
Open WebUI รองรับสองโหมด API เมื่อเชื่อมต่อกับ backend:
| Mode | Format | When to use |
|---|---|---|
| Chat Completions (default) | /v1/chat/completions | แนะนำ ใช้ได้ทันที |
| Responses (experimental) | /v1/responses | สำหรับการจัดการสถานะบทสนทนาฝั่ง server ผ่าน previous_response_id |
การใช้ Chat Completions (แนะนำ)
นี่คือค่าเริ่มต้นและไม่จำเป็นต้องมีการตั้งค่าเพิ่มเติม Open WebUI จะส่ง requests รูปแบบ OpenAI มาตรฐาน และ Hermes Agent จะตอบกลับตามนั้น แต่ละ requests จะรวมประวัติบทสนทนาทั้งหมด
การใช้ Responses API
ในการใช้โหมด Responses API:
- ไปที่ Admin Settings → Connections → OpenAI → Manage
- แก้ไขการเชื่อมต่อ hermes-agent ของคุณ
- เปลี่ยน API Type จาก "Chat Completions" เป็น "Responses (Experimental)"
- Save
ด้วย Responses API, Open WebUI จะส่ง requests ในรูปแบบ Responses (input array + instructions), และ Hermes Agent สามารถรักษาประวัติ tool call ทั้งหมดข้ามรอบการสนทนาผ่าน previous_response_id เมื่อ stream: true, Hermes ยังจะ stream รายการ function_call และ function_call_output แบบ spec-native ซึ่งช่วยให้สามารถสร้าง UI สำหรับ tool-call แบบ structured ได้ใน client ที่แสดง Responses events
:::note
ปัจจุบัน Open WebUI จัดการประวัติบทสนทนาแบบ client-side แม้ในโหมด Responses - โดยมันจะส่งประวัติข้อความทั้งหมดในแต่ละ request แทนการใช้ previous_response_id ข้อได้เปรียบหลักของ Responses mode ในวันนี้คือ structured event stream: text deltas, function_call, และ function_call_output items จะมาถึงในรูปแบบ OpenAI Responses SSE events แทน Chat Completions chunks
:::
วิธีการทำงาน
เมื่อคุณส่งข้อความใน Open WebUI:
- Open WebUI ส่ง request
POST /v1/chat/completionsพร้อมข้อความของคุณและประวัติบทสนทนา - Hermes Agent สร้าง instance ของ AIAgent ด้วย toolset ทั้งหมดของมัน
- agent จะประมวลผล request ของคุณ - มันอาจเรียกใช้ tools (terminal, file operations, web search, ฯลฯ)
- ขณะที่ tools ทำงาน, inline progress messages จะ stream ไปยัง UI เพื่อให้คุณเห็นว่า agent กำลังทำอะไรอยู่ (เช่น
`💻 ls -la`,`🔍 Python 3.12 release`) - ข้อความตอบกลับที่เป็น text สุดท้ายของ agent จะ stream กลับไปยัง Open WebUI
- Open WebUI แสดง response ใน chat interface ของมัน
agent ของคุณเข้าถึงเครื่องมือและความสามารถทั้งหมดแบบเดียวกับการใช้ CLI หรือ Telegram - ความแตกต่างเพียงอย่างเดียวคือ frontend
:::tip Tool Progress เมื่อเปิดใช้งาน streaming (ค่าเริ่มต้น) คุณจะเห็นตัวบ่งชี้แบบ inline สั้นๆ ขณะที่ tools กำลังทำงาน - คือ emoji ของ tool และ argument หลักของมัน สิ่งเหล่านี้จะปรากฏใน response stream ก่อนคำตอบสุดท้ายของ agent ทำให้คุณเห็นภาพว่าเกิดอะไรขึ้นเบื้องหลัง :::
ข้อมูลอ้างอิงการตั้งค่า
Hermes Agent (API server)
| Variable | Default | Description |
|---|---|---|
API_SERVER_ENABLED | false | เปิดใช้งาน API server |
API_SERVER_PORT | 8642 | พอร์ตของ HTTP server |
API_SERVER_HOST | 127.0.0.1 | ที่อยู่สำหรับ bind |
API_SERVER_KEY | (required) | Bearer token สำหรับการตรวจสอบสิทธิ์ ต้องตรงกับ OPENAI_API_KEY |
Open WebUI
| Variable | Description |
|---|---|
OPENAI_API_BASE_URL | URL ของ API ของ Hermes Agent (ต้องรวม /v1) |
OPENAI_API_KEY | ต้องไม่ว่างเปล่า ต้องตรงกับ API_SERVER_KEY ของคุณ |
การแก้ไขปัญหา
ไม่มี model ปรากฏใน dropdown
- ตรวจสอบว่า URL มี suffix
/v1:http://host.docker.internal:8642/v1(ไม่ใช่แค่:8642) - ตรวจสอบว่า gateway กำลังทำงาน:
curl http://localhost:8642/healthควรคืนค่า{"status": "ok"} - ตรวจสอบการแสดงรายการ model:
curl http://localhost:8642/v1/modelsควรคืนค่ารายการที่มีhermes-agent - Docker networking: จากภายใน Docker,
localhostหมายถึง container ไม่ใช่ host ของคุณ ให้ใช้host.docker.internalหรือ--network=host
Connection test ผ่าน แต่ไม่มี model โหลด
นี่เกือบจะเป็นปัญหาที่ขาด suffix /v1 เสมอ การทดสอบการเชื่อมต่อของ Open WebUI เป็นเพียงการตรวจสอบการเชื่อมต่อพื้นฐาน - มันไม่ได้ตรวจสอบว่าการแสดงรายการ model ทำงานหรือไม่
Response ใช้เวลานานมาก
Hermes Agent อาจกำลังเรียกใช้ tool call หลายครั้ง (อ่านไฟล์, รันคำสั่ง, ค้นหาเว็บ) ก่อนที่จะสร้าง response สุดท้าย นี่เป็นเรื่องปกติสำหรับ queries ที่ซับซ้อน Response จะปรากฏทั้งหมดเมื่อ agent ทำงานเสร็จ
ข้อผิดพลาด "Invalid API key"
ตรวจสอบให้แน่ใจว่า OPENAI_API_KEY ใน Open WebUI ตรงกับ API_SERVER_KEY ใน Hermes Agent
การตั้งค่าหลายผู้ใช้ด้วย Profiles
หากต้องการรัน Hermes instances แยกกันสำหรับผู้ใช้แต่ละคน - โดยแต่ละคนมี config, memory, และ skills ของตัวเอง - ให้ใช้ profiles แต่ละ profile จะรัน API server ของตัวเองบนพอร์ตที่แตกต่างกัน และจะประกาศชื่อ profile เป็น model ใน Open WebUI โดยอัตโนมัติ
1. สร้าง profiles และกำหนดค่า API servers
hermes profile create alice
hermes -p alice config set API_SERVER_ENABLED true
hermes -p alice config set API_SERVER_PORT 8643
hermes -p alice config set API_SERVER_KEY alice-secret
hermes profile create bob
hermes -p bob config set API_SERVER_ENABLED true
hermes -p bob config set API_SERVER_PORT 8644
hermes -p bob config set API_SERVER_KEY bob-secret2. เริ่มต้นแต่ละ gateway
hermes -p alice gateway &
hermes -p bob gateway &3. เพิ่มการเชื่อมต่อใน Open WebUI
ใน Admin Settings → Connections → OpenAI API → Manage, เพิ่มการเชื่อมต่อหนึ่งรายการต่อ profile:
| Connection | URL | API Key |
|---|---|---|
| Alice | http://host.docker.internal:8643/v1 | alice-secret |
| Bob | http://host.docker.internal:8644/v1 | bob-secret |
model dropdown จะแสดง alice และ bob เป็น model ที่แตกต่างกัน คุณสามารถกำหนด model ให้ผู้ใช้ Open WebUI ผ่าน admin panel เพื่อให้ผู้ใช้แต่ละคนมี agent ของ Hermes ที่แยกออกจากกัน
:::tip Custom Model Names
ชื่อ model จะเป็นค่าเริ่มต้นเป็นชื่อ profile หากต้องการเปลี่ยน ให้ตั้งค่า API_SERVER_MODEL_NAME ใน .env ของ profile:
hermes -p alice config set API_SERVER_MODEL_NAME "Alice's Agent":::
Linux Docker (ไม่มี Docker Desktop)
บน Linux ที่ไม่มี Docker Desktop, host.docker.internal จะไม่สามารถ resolve ได้โดยค่าเริ่มต้น มีตัวเลือกดังนี้:
# Option 1: เพิ่ม host mapping
docker run --add-host=host.docker.internal:host-gateway ...
# Option 2: ใช้ host networking
docker run --network=host -e OPENAI_API_BASE_URL=http://localhost:8642/v1 ...
# Option 3: ใช้ Docker bridge IP
docker run -e OPENAI_API_BASE_URL=http://172.17.0.1:8642/v1 ...📄 user-guide/messaging/qqbot.md
QQ Bot
เชื่อมต่อ Hermes เข้ากับ QQ ผ่าน Official QQ Bot API (v2) - รองรับข้อความส่วนตัว (C2C), การกล่าวถึงในกลุ่ม (@-mentions), Guild, และข้อความส่วนตัวพร้อมการถอดเสียงด้วยเสียง
Overview
QQ Bot adapter ใช้ Official QQ Bot API เพื่อ:
- รับข้อความผ่านการเชื่อมต่อ WebSocket แบบถาวรไปยัง QQ Gateway
- ส่งข้อความและข้อความตอบกลับแบบ markdown ผ่าน REST API
- ดาวน์โหลดและประมวลผลรูปภาพ, ข้อความเสียง, และไฟล์แนบ
- ถอดเสียงข้อความเสียงโดยใช้ ASR ที่มีอยู่ในตัวของ Tencent หรือผู้ให้บริการ STT ที่สามารถกำหนดค่าได้
Prerequisites
-
QQ Bot Application - ลงทะเบียนที่ q.qq.com:
- สร้างแอปพลิเคชันใหม่และจดบันทึก App ID และ App Secret
- เปิดใช้งาน intents ที่จำเป็น: C2C messages, Group @-messages, Guild messages
- กำหนดค่าบอทของคุณในโหมด sandbox สำหรับการทดสอบ หรือเผยแพร่สำหรับ Production
-
Dependencies - adapter นี้ต้องการ
aiohttpและhttpx:pip install aiohttp httpx
Configuration
Interactive setup
hermes gateway setupเลือก QQ Bot จากรายการแพลตฟอร์มและทำตามคำแนะนำ
Manual configuration
ตั้งค่า environment variables ที่จำเป็นใน ~/.hermes/.env:
QQ_APP_ID=your-app-id
QQ_CLIENT_SECRET=your-app-secretEnvironment Variables
| Variable | Description | Default |
|---|---|---|
QQ_APP_ID | QQ Bot App ID (required) | — |
QQ_CLIENT_SECRET | QQ Bot App Secret (required) | — |
QQBOT_HOME_CHANNEL | OpenID สำหรับการส่ง cron/notification | — |
QQBOT_HOME_CHANNEL_NAME | ชื่อที่แสดงสำหรับ home channel | Home |
QQ_ALLOWED_USERS | OpenID ของผู้ใช้ที่คั่นด้วยเครื่องหมายจุลภาคสำหรับการเข้าถึง DM | open (all users) |
QQ_ALLOW_ALL_USERS | ตั้งค่าเป็น true เพื่ออนุญาต DM ทั้งหมด | false |
QQ_SANDBOX | เส้นทางคำขอไปยัง QQ sandbox gateway สำหรับการทดสอบการพัฒนา | false |
QQ_STT_API_KEY | API key สำหรับผู้ให้บริการ voice-to-text | — |
QQ_STT_BASE_URL | Base URL สำหรับผู้ให้บริการ STT | https://open.bigmodel.cn/api/coding/paas/v4 |
QQ_STT_MODEL | ชื่อโมเดล STT | glm-asr |
Advanced Configuration
สำหรับการควบคุมที่ละเอียดอ่อน ให้เพิ่ม platform settings ใน ~/.hermes/config.yaml:
platforms:
qq:
enabled: true
extra:
app_id: "your-app-id"
client_secret: "your-secret"
markdown_support: true # enable QQ markdown (msg_type 2). Config-only; no env-var equivalent.
dm_policy: "open" # open | allowlist | disabled
allow_from:
- "user_openid_1"
group_policy: "open" # open | allowlist | disabled
group_allow_from:
- "group_openid_1"
stt:
provider: "zai" # zai (GLM-ASR), openai (Whisper), etc.
baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4"
apiKey: "your-stt-key"
model: "glm-asr"Voice Messages (STT)
การถอดเสียงด้วยเสียงทำงานในสองขั้นตอน:
-
QQ built-in ASR (ฟรี, จะถูกลองก่อนเสมอ) - QQ จะให้
asr_refer_textในไฟล์แนบข้อความเสียง ซึ่งใช้ระบบรู้จำคำพูดของ Tencent เอง -
Configured STT provider (fallback) - หาก ASR ของ QQ ไม่ส่งคืนข้อความ adapter จะเรียกใช้ STT API ที่เข้ากันได้กับ OpenAI:
- Zhipu/GLM (zai): ผู้ให้บริการเริ่มต้น ใช้โมเดล
glm-asr - OpenAI Whisper: ตั้งค่า
QQ_STT_BASE_URLและQQ_STT_MODEL - Endpoint STT ที่เข้ากันได้กับ OpenAI อื่นๆ
- Zhipu/GLM (zai): ผู้ให้บริการเริ่มต้น ใช้โมเดล
Troubleshooting
Bot disconnects immediately (quick disconnect)
โดยทั่วไปหมายความว่า:
- Invalid App ID / Secret - ตรวจสอบ credentials ของคุณอีกครั้งที่ q.qq.com
- Missing permissions - ตรวจสอบให้แน่ใจว่าบอทมีการเปิดใช้งาน intents ที่จำเป็น
- Sandbox-only bot - หากบอทอยู่ในโหมด sandbox มันจะรับข้อความได้เฉพาะจากช่องทดสอบ sandbox ของ QQ เท่านั้น
Voice messages not transcribed
- ตรวจสอบว่า
asr_refer_textที่มีอยู่ในตัวของ QQ มีอยู่ในข้อมูลไฟล์แนบหรือไม่ - หากใช้ผู้ให้บริการ STT แบบกำหนดเอง ให้ตรวจสอบว่า
QQ_STT_API_KEYถูกตั้งค่าอย่างถูกต้อง - ตรวจสอบ log ของ gateway สำหรับข้อความแสดงข้อผิดพลาดของ STT
Messages not delivered
- ตรวจสอบว่า intents ของบอทถูกเปิดใช้งานที่ q.qq.com
- ตรวจสอบ
QQ_ALLOWED_USERSหากการเข้าถึง DM ถูกจำกัด - สำหรับข้อความกลุ่ม ให้แน่ใจว่าบอทถูก @mentioned (นโยบายกลุ่มอาจต้องมีการ allowlisting)
- ตรวจสอบ
QQBOT_HOME_CHANNELสำหรับการส่ง cron/notification
Connection errors
- ตรวจสอบให้แน่ใจว่าติดตั้ง
aiohttpและhttpxแล้ว:pip install aiohttp httpx - ตรวจสอบการเชื่อมต่อเครือข่ายไปยัง
api.sgroup.qq.comและ WebSocket gateway - ตรวจสอบ log ของ gateway สำหรับข้อความแสดงข้อผิดพลาดโดยละเอียดและพฤติกรรมการเชื่อมต่อใหม่
extent analysis
TL;DR
- แก้ไขปัญหาการเชื่อมต่อ Hermes Agent กับแพลตฟอร์มที่เลือก (เช่น Home Assistant, Matrix, Mattermost) โดยตรวจสอบการกำหนดค่าและตัวแปรสิ่งแวดล้อม
Guidance
- ตรวจสอบการกำหนดค่า: ตรวจสอบว่า Hermes Agent ถูกกำหนดค่าให้ทำงานกับแพลตฟอร์มที่เลือกอย่างถูกต้อง (เช่น Home Assistant, Matrix, Mattermost)
- ตัวแปรสิ่งแวดล้อม: ตรวจสอบว่าตัวแปรสิ่งแวดล้อมที่จำเป็น (เช่น
HASS_TOKEN,MATRIX_ACCESS_TOKEN,MATTERMOST_TOKEN) ถูกตั้งค่าและถูกต้อง - การเชื่อมต่อเครือข่าย: ตรวจสอบให้แน่ใจว่ามีการเชื่อมต่อเครือข่ายที่ถูกต้องไปยังเซิร์ฟเวอร์ของแพลตฟอร์มที่เลือก
- บันทึกข้อผิดพลาด: ตรวจสอบบันทึกข้อผิดพลาดของ Hermes Agent เพื่อหาสาเหตุของปัญหา
Notes
- การกำหนดค่าที่ถูกต้อง: การกำหนดค่าที่ถูกต้องเป็นสิ่งสำคัญสำหรับการเชื่อมต่อ Hermes Agent กับแพลตฟอร์มที่เลือก
- การตรวจสอบบันทึก: การตรวจสอบบันทึกข้อผิดพลาดสามารถช่วยระบุสาเหตุของปัญหาและแก้ไขได้อย่างรวดเร็ว
Vote matrix · Quick signals
Still need to ship something?
×6Another batch ranked right after the header list — different links, same matching logic.
TRENDING
- Feature Request: Configurable per-minute rate limiting (RPM) for models to prevent 429 errors
- Android: Hermes App + Termux install share ~/.hermes and cause silent permission loops
- hermes update emits unicode-animations ANSI demo in non-interactive logs
- hermes update downgrades aiohttp from 3.13.4 to 3.13.3
- npm install warns about deprecated @babel/plugin-proposal-private-methods
- DingTalk inbound media URLs are skipped as unreadable native image paths
- fix(dashboard): ChatPage clears header action buttons on ALL pages, not just Sessions
- [Bug]: check_web_api_key() hardcodes built-in backends — third-party web search plugins silently disabled
- Hermes Web UI 修复经验:GatewayManager 补丁、进程 D 状态、数据库升级问题
- Telegram gateway can silently drop turn after /stop with response=0 chars while internal work continues
- Bug Report: v0.14.0 上下文污染 — 历史回复碎片回注到新请求
- Bug: hermes skills search table truncates Identifier column — install fails with copied value
- [skills-index-watchdog] Skills index is stale or degraded (degraded)
- Discord approval embed not rendering on web/mobile — embed data present in API but invisible
- Idea: Discord voice-channel participation / opt-in auto-join mode
- [Feature]: Claude Code--ultrawork
- build-arm64 job deterministically fails on cold cache (Azure SAS token expires mid-build)
- [Enhancement] computer_use: action=type should fall back to key events for terminal emulators (Ghostty/Terminal.app/iTerm2)
- Feature Request: Session Recovery on Temporary Provider Outage
- [Bug]: Hermes dashboard not working on NixOS (container)
- [Feature]: Add option to ignore @all/@everyone mentions in Feishu group chats
- QQ Bot WebSocket 频繁断开:长时间工具执行阻塞 asyncio 事件循环导致心跳超时
- patch tool: new_string escape sequences (\t) get written literally
- Feature Request: i18n / 多语言支持(国际化)
- Bug: web_crawl schema lets models auto-guess "instructions" instead of asking the user via clarify
- feat: `!command` prefix for direct shell execution (like Claude Code)
- Expose currently-running cron jobs via /api/jobs (or new endpoint)
- [Bug]: Kanban parent-child handoff: scratch workspace GC destroys artifacts before child can read them
- [Bug, Windows] hermes gateway restart loses session context — planned_stop_marker not written before SIGTERM
- [Bug]: Codex→DeepSeek fallback sends assistant turns without reasoning_content → HTTP 400 (require-side cross-provider failover)
- [Bug]: Update got stuck half way, reboot it, then ModuleNotFoundError: No module named 'hermes_cli'
- Kanban dispatcher corrupt-board handling and multi-profile gateway ownership ambiguity
- Gateway can resend a short fallback message when the real final Telegram response was already delivered
- [BUG] Bedrock: Fix 'Invalid API Key format' for presigned URL tokens
- Secret redaction corrupts code syntax in tool output (write_file, execute_code, terminal)
- Unable to connect Ollama Cloud with Pro Subscription to Hermes
- feat: fuzzy substring matching for /skill autocomplete
- PRD: Autonomous market-impact prediction briefing system
- Kanban dashboard should support task/card deep links
- [Feature] Native Feishu CardKit Streaming: consolidate best-in-class implementations
- [Feature]: Inject mental model into context when using Hindsight
- Interactive CLI hides tool output despite display.tool_progress=all, and hermes chat -v does not restore it
- fix(api_server): _handle_responses drops text.format JSON schema — structured output constraints silently ignored
- state.db FTS corruption goes undetected — no integrity check, no repair path
- bug: fallback routing can select text-only models for image requests and hide the primary failure
- feat(kanban): persist worker session_id per run and pass --resume on respawn after unblock
- feat(kanban): support GitHub/OMO lifecycle bridge for Xiyou-style automation
- Expose update-safe TUI/composer hooks for voice transcript and composer events
- Hide or configure voice transcript status rows in editable dictation mode
- [Feature]: Per-Tool / Per-Toolset Approval Policies
- Context compression creates orphan sessions missing from state.db
- messaging platform
- feat: Add read-only / silent monitoring mode for WhatsApp adapter
- double-.hermes path mismatch, the HOME env var leak, and the fallback-notification UX problem
- Bug: Plattform-Bundle name `hermes-yuanbao` in `agent.disabled_toolsets` silently kills ALL tools in gateway path (Telegram + cron), CLI unaffected
- CLI /yolo (in-chat) does not bypass dangerous command approvals — env var freeze + missing enable_session_yolo call
- OpenAI Codex provider crashes with "'NoneType' object is not iterable" (HTTP None)
- DEEPSEEK_API_KEY blocked by env blocklist in gateway process — cron jobs fail with deepseek provider
- fix(feishu): Card action callback routing issues - invalid message_id and unrecognized /card command
- Discord plugin: profiles without explicit `discord:` block silently get `require_mention=true` + `auto_thread=true` (regression in cc8e5ec2a)
- [Bug]: DISCORD_ALLOWED_ROLES ignored by gateway _is_user_authorized — role-authorized users get 'Unauthorized user' rejection
- [Bug]: /new, /clear, and /reset commands freeze the terminal session
- openai-codex subscription backend returns HTTP 200 with response.output=None, causing Slack/cron failures
- RFC: Centralized Model/Provider Registry
- bug: openai-codex provider — TypeError: 'NoneType' object is not iterable on every request (gpt-5.5)
- [Feature]: Source-aware instruction gate — architectural mitigation for indirect prompt injection
- Named custom provider stale_timeout_seconds ignored because runtime provider is normalized to `custom`
- guard test (ignore)
- [Feature]: per-platform LLM request_overrides (extra_body / reasoning_effort / service_tier)
- One-shot smoke: add Flue-backed orchestration fixture
- Gateway should not treat stale Codex app-server progress as final response after post-tool silence
- `docker_run_as_host_user: true` breaks bundled skills: Hermes home is mounted into `/root/.hermes` but the container runs as a non-root user (`HOME=/home/pn`)
- [Bug]: gateway api_server streaming bypasses server-side tool-call loop when chat_template_kwargs.enable_thinking=false (model emits tool name as plain text)
- [Feature]: Pre-install python-telegram-bot in Umbrel Hermes Docker image
- YouTube Shorts filter not working in youtube-content skill
- v0.15.0 PyPI release breaks ALL platforms — plugin.yaml manifests missing from package
- RFC: On-demand tool/skill/MCP discovery — decouple schema registration from process lifecycle
- Pixshelf: local-first stock photo workflow command center
- [Bug]: baoyu infographic skill should not silently bypass image_generate
- Pixshelf v1.5: manual submission tracking for stock agencies
- `hermes config set` silently accepts unknown keys, writing them where the runtime never reads
- Honcho memory prefetch hang on fresh CLI subprocess in v0.15.0 (regression from #27190)
- [Bug] v0.15.0 Docker image: stage2-hook.sh, main-wrapper.sh missing; container_boot module removed
- Feature: Reduce cache-read token overhead for DeepSeek providers — configurable cache_ttl, skills snapshot trimming, memory compaction
- Windows: three bugs from daily use (plugin discovery, gateway exit code, Unicode decode
- holographic memory: HRR silently degrades to FTS5 when numpy is missing
- Make max_tokens configurable for aux vision calls
- Conversation compression desynchronizes session ID between agent context and gateway routing, causing silent message loss
- [Bug]: v0.15.0 Docker image:The TUI cannot be used in the dashboard.
- cron: skip_memory=True blocks fact_store/memory tools from all cron jobs
- TUI: Node.js OOM crash when agent uses browser tools repeatedly
- feat: model_profiles — per-model toolset and memory config
- Automatic background skill patching disrupts active sessions (severe impact on local models)
- ensure_hermes_home() creates root-owned dirs in profile subdirectories when kanban workers are dispatched
- Feature: opt-in webhook bypass for DISCORD_ALLOW_BOTS — allow operator-initiated probes without weakening bot-loop guard
- v0.15.0: Codex requests fail HTTP 400 when participant display_name contains non-ASCII (emoji breaks input[].name pattern)
- Architecture: State Persistence Precedence (Memory vs Skills vs Hooks)
- [Bug]: cronjob tool: create action always fails with "schedule is required for create" even when parameters are provided
- codex-oauth: 'NoneType' object is not iterable in _run_codex_stream (gpt-5.5) — every turn fails non-retryably
- Docs/Config: Plugin local scope enablement ambiguity
- [Bug]: CLI freezes after using /new command (WSL)
- Profile Codex auth can ignore global credential pool when local state is stale
- [workflow-engine] CRITICAL: variable substitution crashes on regex metachars in user input
- [workflow-engine] HIGH: loop and bash nodes leak subprocesses on timeout
- [workflow-engine] HIGH: README documents config env vars the engine never reads
- [workflow-engine] MEDIUM: workflow_run rate limit bypassable via concurrent calls (TOCTOU)
- [workflow-engine] chore: manifest gaps, side-effectful register(), dead code, unauth kanban dispatch
- [mcp_lazy] HIGH: synthetic mcp_server_<name> stub collides with a real MCP server named 'server'
- [mcp_lazy] HIGH: promote_server eager flag documented but never persisted
- [mcp_lazy] MEDIUM: _prev_mode dict leaks and goes stale; not cleared on session evict
- [mcp_lazy] MEDIUM: get_pool has unlocked check-then-set race on pool creation
- [mcp_lazy] MEDIUM: pre_tool_call gives no guidance for unpromoted server-stub calls
- [mcp_lazy] chore: undeclared pre_tool_call hook, nonexistent 'mcp_load_tools' name in docs, missing tests
- [a2a_fleet] CRITICAL: server never auto-starts — register() runs outside an event loop
- [a2a_fleet] CRITICAL: auth_required defaults to false on a cross-machine surface
- [a2a_fleet] HIGH: remove invented disable() hook — loader never calls it, port leaks on reload
- [a2a_fleet] HIGH: plugin.yaml missing kind / provides_tools / requires_env (token env undeclared)
- [a2a_fleet] MEDIUM: tighten wide-open CORS, anonymous /health peer leak, and peer-URL SSRF
- [a2a_fleet] MEDIUM: relocate tests to tests/plugins/ and cover sync-register + auth-default paths
- xai-oauth auxiliary client incorrectly uses Responses API (CodexAuxiliaryClient), causing 403 on compression/vision/web_extract
- [Bug]: Direct Copilot gpt-5.5 large resumes are killed by 12s Codex TTFB watchdog
- [Bug]: `hermes uninstall` does not work on Windows
- TUI: Thinking block leaks raw JSON and Σ character
- Hostinger VPS: migration Hermes Agent → Hermes WebUI impossible (tini + UID mismatch + sessions)
- /goal judge over-continues exploratory goals unless the assistant explicitly says the goal is complete
- /goal auto-continuation can be amplified by preflight compression/session split and resurrect stale task state
- Dashboard infinite reload loop in loopback mode — GET /api/auth/me returns 401 on every page load
- [Bug]: Provider/LLM switch leaves stale encrypted_content causing 400 errors on Telegram sessions
- [Bug]: Infinite reload loop / React state loop on Sessions tab (Firefox + Chrome) — repeated 401 on /api/auth/me (v0.15.0)
- show_reasoning should work independently of streaming in CLI mode
- Feature Request: Strip reasoning/<think> blocks from TTS preprocessing
- mcp add / mcp test raise NameError when mcp package not installed
- v0.14.0 dashboard breaks behind reverse proxies — two regressions
- Skills hub creates empty category directories when no skills installed
- [Bug]: Custom endpoint: ChatCompletions returns content, but Hermes treats response as empty (v0.14.0)
- fix: atomic_replace() fails with EXDEV when HERMES_HOME is a cross-filesystem symlink
- fix(gateway): Feishu session cancellation orphans session guard, permanently blocking messages
- Custom endpoint pricing can overestimate Crof qwen3.5-9b cost by 1,000,000x
- MCP OAuth callback: module-level port global causes port collisions and structural weaknesses vs upstream
- Bug: send_message tool bypasses validate_media_delivery_path security check
- Proposal: Add Mnemosyne to official memory provider documentation
- feat(swarm): support custom verifier/synthesizer body + skills
- Template conversion failed
- Error occurred in the operation of the agent node in the workflow.
- PubSub client overrides Sentinel client when REDIS_USE_SENTINEL is enabled
- Frontend description of the Retrieval node output does not match the actual output
- JSON type input var raise Intenal server error
- cannot extract elements from a scalar
- 负载均衡 为模型配置多组凭据,并自动调用,此功能无法选择
- add models is error
- panic: could not create filter
- Persist partially generated messages when /chat-messages/:task_id/stop is called
- MCP server connection fails with 403 — request never leaves Dify (SSRF proxy suspected)
- Support durable async execution backends for long-running workflow steps
- [Xiaomi MiMo] Credentials validation fails with 400 "Not supported model mimo-v2-flash" when using Token Plan endpoint (v0.0.7)
- After clicking preview on a parent-child segmented knowledge base, it shows 0 chunks
- Retrieval score differs between UI upload (.docx) and API upload (.txt) despite identical chunk content and embedding model
- gemini cli crash again
- Xbox gift card code damage
- Damage caused by the gemini cli crash
- ioctl(2) failed, EBADF (Bad File Descriptor)
- Feat: Support Bun as an alternative runtime/package manager for updates and extensions
- fatal error again!!!!
- ioctl error
- Critical Crash: ioctl(2) failed, EBADF in ShellExecutionService.resizePty
- ioctl(2) failed, EBADF
- v0.44.0 Regression: Critical crash with ioctl(2) failed, EBADF during PTY resize
- Crash on startup: ioctl(2) failed, EBADF in UnixTerminal.resize
- Crash: `ioctl(2) failed, EBADF` in `node-pty` during PTY resize on macOS
- Gemini CLI crashes with `ioctl(2) failed, EBADF` in `node-pty` during `resizePty`
- Remote Role
- ERROR ioctl(2) failed, EBADF /home/mich
- RangeError: Maximum call stack size exceeded
- EBADF Error during folder creationg broke session and terminal glitches
- MAIP / Gargoub Project - Mediterania - North Coast
- Gemini cli crash again in this morning
- ERROR ioctl(2) failed, EBADF
- Verified node install fails — Checksum verification failed (Cloud)
- The extended debugging key did not arrive during registration.
- CollaborationPane unmounts collaboration store on single-user instances, causing permanent "No network connection" state
- Workflow cannot be saved when the name contains "->" (Potentially malicious string)
- automation does not work and does not show an error
- Raj Ai Automation
- Default Data Loader: DOMMatrix is not defined error
- Feature: Per-node execution timestamp overlay on canvas during workflow run
- AI Agent + Vertex `gemini-3.5-flash`: 400 "missing thought_signature" on sequential multi-turn tool calls (post-#24982)
- PDF Loader in Pinecone Vector Store fails due to pdf-parse version conflict (v2 not supported)
- emailReadImap: add UID deduplication, batch size cap, and numeric uid enforcement
- Manual node execution fails with "Could not find a node" when autosave is disabled (N8N_WORKFLOWS_AUTOSAVE_DISABLED)
- Schedule Trigger stopped firing — workflow Published & active, manual executions succeed, no automated fires for 2+ hours
- [MCP SDK] create_workflow_from_code intermittently returns HTTP 500, often as a false negative (workflow persists anyway, causing duplicates on retry)
- Credential-load wedge: workflows using googleApi/jwtAuth credentials silently fail to execute after key rotation
- Google Sheets Trigger every minute is not working manual Execute is working sent email
- [BUG] Plugin marketplace MCP connector remains stuck "still connecting" when mcp-remote requires OAuth
- [redacted at user request]
- Opus 4.7 behavioral regression: loaded instruction-following discipline degraded in recent Claude Code/Cowork updates
- [BUG] Tailscale via Homebrew CLI + Mac App Store GUI, both Macs on macOS, Cowork blocked by VPN detector despite Tailscale being a mesh VPN with no traffic interception
- stopShellPty on tab switch kills active sessions (exit 143) — regression in May 27 build
- [BUG] Long URLs are broken into multiple lines and become unclickable in terminal output
- [BUG] claude rm/stop/reap SIGKILLs background session tree without SIGTERM grace, orphaning git index.lock and similar
- [BUG] Default git workflow in the system prompt was pushed without context or consent
- [MODEL] Inconsistent output quality / Ignoring instructions (overfitting and inappropriate repetition of Korean vocabulary)
- You've hit your weekly limit · resets May 31 at 5pm (Asia/Shanghai)
- Paid yearly subscription silently downgraded to Free with no user action
- [Regression v2.1.153] Plugin bash hooks fail with "echo: write error: Permission denied" on Windows (claude-mem, shell: "bash")
- [BUG] Connector toggles in conversation are not clickable — must click text label instead
- [remote-control] Input from mobile app/browser not reaching host session — output works fine
- Model fails to read/reference CLAUDE.md contents despite being loaded in context
- [BUG] Claude Desktop reinstall destroys Code chat history (transcripts + Recents) while regular Chat history, project files, and memory all survive
- Bypass mode clamps to Accept Edits even with the toggle ON (Claude Code Desktop 1.9255.2 / CC 2.1.149)
- [BUG] TUI input freezes randomly mid-typing — entire prompt becomes unresponsive for minutes
- [BUG] Cowork downloads Linux ELF binary instead of macOS binary on macOS Sonoma 14.8.7 — exit code 132 (SIGILL) on every session
- [Feature Request] Persistent project memory — sessions forget everything on close, forcing users to keep many sessions open
- [Bug] Thread context stale after sleep/resume, returns outdated date and calendar data
- [FEATURE] Add context window usage indicator and warning before auto-compaction
- [BUG] Dictation error: Invalid character in header content ["x-config-keyterms"] on Windows
- [Bug] Anthropic API Error: Server rate limiting despite normal usage
- Does delegating work to `claude -p` subprocesses reduce context accumulation in the parent session?
- [BUG] Claude Code hangs on M1 Mac when terminal says "opening browser to sign in" and browser opens
- [BUG] Claude_Preview MCP preview_start spawns dev server with main-repo cwd instead of session's worktree cwd
- [Bug] Anthropic API Error: Server rate limiting during request execution
- [Bug] Anthropic API Error: Server rate limiting on concurrent requests
- [Bug] Ultraplan ready notification fires before cloud agent completes execution
- [BUG] API 500 ERROR ALL THROUGHOUT THE DAY
- [BUG] Cowork: Live Artifacts folder path changed in 1.9255.2, no automatic migration from Documents\Claude\Artifacts
- [Bug] Auto-compact never triggers despite statusline reporting "100% context used" (v2.1.153, Max sub, 200K mode)
- [BUG] [Desktop / macOS] 'Open in → New Window' detached session: font renders smaller than main, no per-window controls, Cmd+/Cmd- keystrokes routed to main window instead
- Feature request: option to switch between classic and new minimal UI
- [Feature Request] Show timestamps for each message
- [BUG] Terminal corruption when permission prompt appears while navigating Agent Teams agent selection menu
- [FEATURE] Allow users to customize the background color of the Claude desktop app beyond the current light/dark theme presets.
- [BUG] Statusline not displaying on Windows [fixed]
- Background agent UI Stop button is a no-op for stuck agents — process keeps consuming tokens
- Background agents silently die on session pause/resume — no completion notification, no work recovery
- Add option to hide email address from welcome banner
- [BUG] SSH Remote: `projects` field in remote ~/.claude.json becomes null after desktop restart — jsonl files intact, UI shows 'No messages yet' for every session
- [Bug] Claude Code not applying fixes despite claiming to complete tasks
- billing is unfair and poorly documented
- [BUG] Claude Code on the web: declared plugins inactive on first session, require restart to fully load
- [BUG] Restore from archive deleted sessions instead of restoring them
- [BUG] M365 connector fails with AADSTS50011 in Cowork — localhost vs 127.0.0.1 redirect URI mismatch
- claude agents: workflow slash-commands missing from dispatch-input completion (regression-adjacent to #61424)
- Claude Desktop's Info.plist missing TCC usage strings, blocks all EventKit-based MCP servers
- False-positive safety blocks on self-administered governance amendments — request for owner-authority mode for verified professional users
- [BUG] Stop pushing "AUTO"-mode
- [DOCS] Plugin marketplace guide omits `skipLfs` option for git-based sources
- [DOCS] MCP docs omit combined startup notification for MCP server and connector authentication
- [DOCS] Agent view docs omit macOS Privacy & Security identity for background agents
- [DOCS] Npm update docs do not explain release-channel behavior for `claude update`
- [DOCS] Agent SDK docs omit `subagent_type: "claude"` worktree and output persistence behavior
- [DOCS] Background session docs omit `$CLAUDE_JOB_DIR` temp-file behavior
- [FR] mask env-var values in 'claude mcp get <server>' output
- [FR] subagent worktrees should not inherit stale local 'user.email' from prior dispatches
- [BUG] Windows: Grep tool leaks rg.exe + conhost.exe processes (~2000 zombies / 14 GB RAM in long sessions)
- [BUG] Stats dashboard "Peak hour" appears off by one hour
- [BUG] Diff highlight (teal SGR background) bleeds past changed text in 2.1.150–2.1.153
- [FEATURE] confirm before deleting session
- Plugin PostToolUse hooks still silently skip in Claude Desktop / Cowork (re-filing closed #51904)
- /code-review skill: silent fallback to main...HEAD reviews other people's commits, and JSON-only output is hard to read
- Monitor tool doesn't source the shell snapshot like Bash does; PATH-dependent tools (jq, sleep, etc.) fail in Monitor commands on macOS/Nix
- [Bug] Long input lines truncated with ellipsis while typing instead of wrapping in terminal UI
- [FEATURE] VS Code extension: Render submitted user messages as Markdown in chat
- OSC 52 copy from Claude TUI doesn't reach clipboard inside tmux (regression in 2.1.146–2.1.153)
- [BUG] RemoteTrigger create/update returns HTTP 400 with circular error: "event_type is required" / "unknown field event_type"
- [BUG] Option to hide or minimize the built-in "status footer" (multi-line debug/cost panel) [re-raise of #31475]
- [Bug] Feedback submissions being closed without review or action
- [FEATURE] Word-jump cursor navigation in Chat input (option+arrow / bindable actions)
- [FEATURE] ! shell mode: filesystem tab completion
- [BUG] API Error: Usage credits required for 1M context
- claude agents: OSC 52 clipboard emission broken in tmux (regression in 2.1.146–2.1.153)
- CLI crashes on macOS 15 M3 - exit code 1
- [FEATURE] Support Cmd+V image paste from clipboard
- [FEATURE] Enhance claude.ai M365 connector to support MS Planner
- [BUG] Slash command autocomplete hijacks pasted absolute file paths starting with /
- PreToolUse hook `if` filter false-positives on complex Bash commands
- [BUG] Diff panel hangs/whites out
- Feature Request: Support drag-and-drop for binary documents (.wps, .doc, .docx, .xlsx, .pdf) in VS Code extension
- [BUG] activation of 1M context in VSCode
- [FEATURE] Support i18n / language localization for built-in slash command outputs
- Ctrl+V para colar imagens deixou de funcionar no CLI (Windows, PowerShell)
- [FEATURE] Please add Norwegian (Bokmål/Nynorsk) language support to the Claude Code interface
- [BUG] OTel log events (claude_code.user_prompt, api_request_body, tool_decision, hook_execution_complete) emitted with empty trace_id/span_id while sibling spans correlate correctly
- [BUG] Cowork crashes on every message, no VM logs generated, missing AppData\Roaming\Claude
- [FEATURE] first-class session handoff + per-session token budgets for unattended runs
- [FEATURE] Smart paste: convert clipboard code to file reference chips (like Cursor)
- [Feature Request] Restore chat pin functionality to title chat submenu
- [BUG] SIGILL issues with version 2.1.153
- [BUG] Cowork plugin upload fails with generic "Plugin validation failed" when a `description` field in any SKILL.md frontmatter contains angle brackets (`<…>`)
- [BUG] Desktop App 2.1.144+: startup scanner deletes cliSessionId from claude-code-sessions local files on every launch — session not found on disk
- [Feature Request] Add keyboard shortcut to copy last message with proper formatting
- [MODEL] Opus 4.7 not 1M
- Allow naming/renaming background agents in `claude agents` view
- Stale worktrees in .claude/worktrees/ are never cleaned up, consuming massive disk space
- Agent worktrees are never cleaned up, silently consuming disk space
- Subagent worktrees not auto-cleaned when reviewer writes scratch files
- [Bug] Skill initialization hangs for extended duration in Plan Mode
- Claude Desktop writes malformed registry Run entry (nested escaped quotes) - crashes Windows Task Manager and other Run-key parsers
- IME candidate window shows at bottom-right corner instead of caret position (Windows CMD)
- [BUG] Pressing 'Escape' doesn't close the /BTW conversation when the main conversation is asking for approval
- [BUG] Opus 4.7 (1M) intermittently emits empty-string values for tool_use.input fields, killing the session
- FleetView agent UI shows "running" with incrementing elapsed time after agent has returned
- /doctor flags context-scoped cmd+c binding as macOS conflict (false positive)
- [BUG] Text Rendering in Elvish
- Desktop app: Bypass Permissions mode flips to Accept Edits on first prompt (M5 / macOS 26.5)
- [Workaround] Date-Weekday Verification Hook — Prevents Claude from writing wrong weekdays
- [BUG] Claude Code create c:/memfs directory without asking me.
- [BUG] Claude Code's Bash execution waits forever with no processes running
- [BUG] usage stays stuck waiting for 5 hr limit after upgrading to premium seat in team plan
- [Workflow tool] resume cache is unreachable for nontrivial workflows because LLM dispatchers can't transcribe args byte-exactly
- Code review (Preview): "Add a repository" shows no results for private GitHub org repos
- [BUG] /context commands blows up context
- [Feature Request] Add precache expiry hook to enable proactive compaction before token eviction
- [BUG] Context indicator shows 0% at session start despite ~20K+ tokens already loaded
- [Feature Request] Add semantic search for --resume session history
- [Feature Request] Add session search, tagging, and filtering capabilities
- [BUG] Cowork Dispatch reports "desktop not available" on Windows 11 while standard Cowork works normally
- [Bug] Claude Code provides incorrect suggestions with high confidence despite errors
- defaultMode: acceptEdits silently overrides per-path permissions.ask rules for Write/Edit
- [FEATUR configurable tip interval (e.g. tipIntervalSeconds: 30 in settings)E]
- Plugin marketplace fails to load: schema rejects 'displayName' key (v2.1.153)
- claude agents: in-session copy uses broken OSC 52 path while overview correctly uses tmux buffer
- [BUG] Plugin agent descriptions (and custom agents) load unconditionally into context — no parity with disable-model-invocation for skills
- Crashed ultrareview consumed a free credit despite producing zero findings
- [Bug] Character rendering issue - invisible or missing text display
- [BUG] Cowork: processo Claude Code encerra com código 3 — .claude.json não contém token de autenticação (Windows 11 25H2)
- [BUG] 2.1.153 silently discards tools/list response from rmcp 0.12.0 HTTP MCP server (works in 2.1.152, wire-identical handshake)
- VS Code extension: option to auto-resume last session when reopening a workspace folder
- [Bug] Conversation continuation failure
- [BUG] Cowork crashes every time I start a new chat or attempt to continue an existing one in any project. The error displayed is: "Claude Code è andato in crash
- [Bug] Unannounced quota changes
- Native update/install fails with 'socket connection was closed unexpectedly' behind proxy — undici TLS incompatibility
- [BUG] Session name reverting after manual change
- [BUG] 非正常思考,上下文过长时,一直显示思考,点击interrupt按钮失效
- Honor `tools:` frontmatter when an agent is invoked via `@mention` — strip `Task` only when the agent did not declare it
- macOS TCC popup still recurring on v2.1.153 — "2.1.153" would like to access data from other apps
- Claude Code leaks pty handles — exhausts pseudo-terminals on macOS after long session
- [Bug] Agent fails to execute or respond to user input
- [BUG] Persistent "Expecting value: line 1 column 1 (char 0)" JSON parse error after tool execution
- [Feature Request] Implement proactive unit test coverage recommendations for recurring bugs
- VS Code panel lacks status line + terminal lacks image paste in Codespaces, forcing a tradeoff
- `/powerup` only shows ~10 lessons — allow viewing the full catalog
- [Bug] Context contamination after auto-compact with unrelated email draft of Tejo/Sado Basin
- [Bug] VSCode terminal output displays corrupted text with garbled symbols
- [Feature Request] Add LaTeX/KaTeX math rendering to TUI
- [Bug] Sub-agent PR review results not validated by orchestrating agent
- Subagents on Pro 1M tier: trivial probes pass, real workloads fail at first tool call (probe-vs-workload divergence)
- Path-scoped rules and subdirectory CLAUDE.md not loaded when creating new files matching the pattern
- AskUserQuestion: cancelling during extended thinking poisons the whole session with 400 'thinking blocks cannot be modified' (2.1.153); concurrent prompts overwrite each other
- Ideas Missing from Claude Cowork Menu (Windows)
- [BUG_BOUNTY_SAFE_POC_2026] Prompt Injection RCE Test - Command Execution Proof
- [BUG] Cowork scheduled task: execution history row not showing after successful run
- Resuming an extended-thinking session fails permanently with 400 "thinking blocks cannot be modified" (transcript stores thinking text as empty but keeps signature)
- [Bug] Plugin-registered CwdChanged and FileChanged hooks don't fire (settings.json works) — v2.1.153
- Auto-archive on PR merge / branch delete — clarify autoArchiveSessions semantics or add dedicated opt-out
- `claude mcp add` echoes Authorization header value verbatim to stdout, leaks bearer tokens to terminal and session transcripts
- [BUG] Bug report — /insights skill, Claude Code The /insights skill outputs a malformed file path.
- Plugin slash commands render with '*'-inline format instead of two-column, despite matching official plugin shape
- [Bug] Unexpected long text generation without user input or goal
- [Bug] Thinking blocks causing task progression blocked without user modification
- [BUG] (Critical!) contamination by an unknown session simirlar to the report => [Bug] Context contamination after auto-compact with unrelated email draft of Tejo/Sado Basin #63137
- [Critical] Opus 4.7 Korean output degeneration — Korean grammar itself collapses in long contexts
- [BUG] Title: Autocompact buffer persists across /clear — wastes tokens for irrelevant old context
- [Bug] Auto-Compact loses user input before processing in conversation history
- Feature: per-invocation effort parameter + runtime session-config introspection for skills
- Auto-mode classifier mislabels Azure DevOps vote -5 as "Reject" when denying PR vote actions
- [BUG] Claude Desktop and Claude Code CLI never re-register MCP tools after OAuth 2.1 handshake on a remote HTTP server
- [BUG] Workspace file tags leak across sessions
- [BUG] Ink renderer crashes on Windows 11 build 26200 (Canary) duplicate banners, terminal mode leaks, mid-operation aborts
- [BUG] Claude Code Desktop issue
- PTY master fd leak in Claude desktop app exhausts macOS kern.tty.ptmx_max after ~2-3 days
- [BUG] Claude Code — Session Management after Unexpected Interruption
- [Windows] Cowork OpenTelemetry exporter does not initialize - zero events emitted to any destination, including loopback
- [Bug] Opus 4.7: 400 `thinking blocks ... cannot be modified` on long extended-thinking sessions, triggered by history-altering events (scheduled prompts / parallel tool-call cancellation)
- [BUG] API Error: Server is temporarily limiting requests (not your usage limit) · Rate limited
- Multi-plugin custom marketplace: only first plugin registered in installed_plugins.json, skills don't load
- [BUG] Git push through the SDK's git proxy fan-outs into ~500 GitHub REST API calls, exhausting the 5,000/hour budget after a handful of pushes
- [BUG] Claude took liberties it really shouldn't with my global config
- [BUG] Agent window focus lost after navigating with arrow keys, causing scroll deadlock
- [BUG] `--model` flag silently ignored in interactive sessions (works in `--print` only)
- [BUG] Dispatch permanently shows "desktop appears offline" on Windows 11 - never worked on first use
- feat: support per-command enableWeakerNetworkIsolation as safer alternative to dangerouslyDisableSandbox
- /code-review outputs a raw JSON array instead of readable findings
- [BUG] Cowork — Additional allowed domains ignored on Team plan; same domain works on Pro plan
- Haiku
- [Bug] False positive blocking beneficial outcomes in tool execution
- 3P Bedrock SSO: credentials silently expire without triggering re-auth on day 2+
- CLAUDE_AUTOCOMPACT_PCT_OVERRIDE in settings.json env block silently ignored by autocompact logic
- Auto-compaction deletes main session JSONL before verifying summary completion, causing data loss
- [Bug] Claude Code not executing stated actions or producing expected results
- [FEATURE] Deferred Messages — Queue Input for End of Turn
- [BUG] Up/Down arrows in input box navigate history instead of moving cursor — regression in 2.1.149+
- Cancelling a parallel tool-call batch corrupts thinking blocks -> 400 "thinking blocks cannot be modified" permanently wedges the session
- Claude Code caused data loss, then contradicted itself about recovery (two incidents, one session)
- [Bug] Unclear error messages from Claude Code CLI
- [Bug] Agent tool rejecting due to context size limit exceeded
- claude agents: daemon and bg-spare processes spin at ~100% CPU when idle
- [BUG] Compaction fails with "context window limit" error even when context usage is low (e.g., 20%) — regression in v2.1.153
- Remote Control entitlement lost after May 27-28 incident — `Error: Remote Control is not yet enabled for your account` on active Max subscription
- PreToolUse hook exit code 2 does not block Write tool
- [Bug] Thinking blocks in latest assistant message are immutable
- GUI: dispatch file:// and custom-scheme clicks to OS shell handler
- Show current model in statusLine by default
- [Bug] Agent console becomes unresponsive to keyboard input after multiple agents initialized
- [FEATURE] PreToolUse hooks should have a way of updating the environment
- [Bug] Unable to start or use Claude Code CLI
- [BUG] Repository not visible in Claude Code web repo picker
- Session permanently wedged on 400 "thinking blocks cannot be modified" after parallel tool_results
- [Bug] @ autocomplete loses sibling repos after a file edit in multi-repo workspace
- Unclear error message when creating sub-agent without authentication
- [Bug] Anthropic API errors causing frequent failures and high token usage
- [BUG] @ mention file picker only shows packages, not individual files (desktop app - Code tab)
- [Bug] TUI panel footer remains sticky and consumes excessive terminal space
- PR-status polling exhausts GitHub GraphQL rate limit on repos with many open PRs
- [BUG] Windows: welcome panel not shown in some project folders (2.1.153)
- [Bug] Anthropic API Error: thinking blocks corrupted during context compaction with extended thinking enabled
- API 400 "thinking blocks cannot be modified" permanently bricks session during agent activation (interleaved thinking + tool use)
- Right-click Copy copies the whole message instead of the selection; pasted text retains dark background
- Mid-session model switch corrupts conversation when extended thinking is enabled (API 400: 'thinking blocks cannot be modified')
- [BUG] Markdown file links in chat output do not open files when clicked (VS Code extension)
- Stuck retry loop: `400 thinking blocks cannot be modified` on large interleaved-thinking turns using AskUserQuestion
- [FEATURE] Prompt user for approval before auto-compaction proceeds
- Custom MCP connectors not attachable to scheduled routines — no UUID discovery path
- [BUG] Claude in Chrome — Navigation blocked for teams.cloud.microsoft and outlook.cloud.microsoft after Microsoft domain migration**
- [BUG] Claude Desktop — Personal plugins panel renders list but is entirely non-interactive (macOS, v1.9255.2)
- [Bug] error when using Workflows
- [BUG] Persistent "update available" notification despite being on latest version
- [BUG] Sweep Agent from /code-review never completes
- [Bug] Tool calls not executing or returning results
- [FEATURE] Cloud-synced memory and settings across machines
- [Bug] Terminal UI freezes when Ctrl+O view exits during interactive prompt in plan mode
- Continuous api errors when using claude code with Opus 4.7 with thinking on low
- [Feature Request] Add support for installing and using previous Claude Code versions
- [Bug] Extended Thinking: Summarized thinking blocks fail signature validation when resent to API
- [Bug] Anthropic API Error: 'thinking' blocks cannot be modified
- [Bug] Anthropic API Error: Thinking blocks cannot be modified with extended thinking mode
- Feature request: Lazy/on-demand MCP server connections
- [Bug] Tool Arguments Parsed as String Instead of Object
- [Bug] Anthropic API Error: Insufficient context provided
- [Bug] Claude Opus occasionally uses moskovian(russian) orthography instead of Ukrainian in system-prompted responses
- Opus 4.8: backgrounded task completions (subagents AND Bash) crash with 400 "thinking blocks cannot be modified"
- [Bug] Opus 4.7 fabricates stable preferences ("my default") to rationalize arbitrary choices when challenged
- [Bug] Unable to update Claude Code CLI
- [BUG] Desktop app: /remote-control mints link + connects bridge (main.log) but in-chat link/QR panel never renders
- Feature: sessionColor and sessionName in .claude/settings.json
- [BUG] Anthropic API error: thinking blocks
- [FEATURE] Support Remote MCPs in Cowork as in Claude Code
- [Bug] Anthropic API Error: 400 Bad Request with Redacted Thinking - 0 4.7 & 4.8
- [Bug] Anthropic API Error: Cannot modify thinking blocks from different model versions
- Interleaved thinking + multi-tool turn corrupts thinking block (text blanked, signature kept) → permanent 400 'blocks must remain as they were'
- [BUG] Mode/permission changes mid-tool-loop (effortLevel: xhigh) poisons entire session
- Session failure log: Opus 4.6 ignores its own rules for an entire session
- [BUG] "400 Guardrail was enabled" error when using Claude Opus 4.8 with AWS Bedrock
- [Feature Request] Add subagent approach selection option to avoid accidental feedback
- Persistent 400 'thinking blocks in the latest assistant message cannot be modified' — interleaved thinking persisted with empty text + signature bricks sessions
- [BUG] DesktopvsApp
- [BUG] Opus 4.7 cache hit rate collapse after May 27 incident — Messages 1.1k→88.9k in 9 minutes, $630/session
- [Bug] Anthropic API Error: Invalid thinking block format
- [BUG] FUCK CLAUDE
- Opus 4.8 extended thinking: Stop hook block re-entry corrupts thinking blocks → 400
- [Bug] 4.8 Fails when accessing previous model history
- [Bug] Unintended File Modifications During Execution
- [DOCS] Model configuration docs omit lean system prompt default scope and model exceptions
- Add "Always allow globally" option to permission prompts
- Server-side model upgrade (Opus 4.7→4.8) wedges in-flight sessions with `thinking blocks cannot be modified` 400
- [DOCS] AskUserQuestion docs missing multiple-choice prompt decision threshold
- [DOCS] Agent view docs omit shell-command background session launch syntax
- [DOCS] Agent view dispatch input docs incorrectly imply `/logout` dispatches as a prompt
- [DOCS] Claude in Chrome docs omit connected-browser selection behavior
- [DOCS] Plugin docs omit `defaultEnabled: false` for opt-in plugins
- Feature Request: Customizable chat text colors for user and assistant messages
- [DOCS] `/plugin` Discover tab docs omit directory-based suggested plugin pins
- VSCode Chrome integration silently fails: 3 distinct bugs
- [DOCS] MCP stdio docs omit session environment variables
- [Bug] Anthropic API error on second request within session with Claude Opus 4.8
- Cowork emits a blank session "index" handoff on focus when a CLI session is paused awaiting input
- [DOCS] MCP docs omit `claude mcp list/get` pending-approval output for unapproved project servers
- [BUG] /compact fails with 400 error when last assistant turn contains thinking blocks
- [DOCS] `/claude-api` docs omit Opus 4.8 migration guidance
- [DOCS] Fast mode docs still recommend deprecated Opus 4.6 override variable
- [DOCS] Bash tool docs omit `$TMPDIR` consistency across sandboxed and unsandboxed commands
- [Bug] Anthropic API Error: 400 Bad Request on Extended Thinking
- [DOCS] Background session docs omit worktree-isolation behavior for spawned subagents
- Built-in mechanistic self-verification of verifiable claims (symmetric to the auto permission gate)
- [DOCS] Worktree docs do not clarify `worktree.baseRef: "head"` inside linked worktrees
- [BUG] Excessive RAM usage with multiple parallel chats (~10 sessions → 30 GB memory pressure, macOS OOM)
- [DOCS] Managed MCP policy docs omit invalid `allowedMcpServers`/`deniedMcpServers` entry behavior
- [DOCS] Effort docs omit `CLAUDE_CODE_ALWAYS_ENABLE_EFFORT` unsupported-model behavior
- Regression (2.1.147–2.1.150?): resuming an extended-thinking session after a CC update/model-switch → unrecoverable 400, session bricked
- [DOCS] Windows updater docs omit `claude.exe` in-use recovery guidance
- [DOCS] VS Code auto mode docs still tie mode-picker visibility to bypass-permissions setting
- [DOCS] MCP docs omit `/mcp` tool list and detail rendering behavior
- [DOCS] Fine-grained tool streaming docs still describe provider opt-in behavior
- bypassPermissions: session startup reads flat pref, GUI toggle writes per-account pref — they never sync
- [BUG] Claude Desktop Code tab causes disk write limit violation — 8.5GB in 11 min, macOS kills app (M5, v1.9659.1)
- Ultrareview v2.1.96: docs describe /tasks command + claude ultrareview --json subcommand that don't exist; findings hard to read after completion
- I'd be happy to help create a GitHub issue title, but I don't see the error message in your message. Could you please share the specific error you're encountering? That way I can generate an accurate and descriptive issue title for you.
- [BUG] Claude in Chrome `file_upload` rejects all scheduled-task sessions with misleading error (real cause: INVALID_SESSION)
- Extended thinking: signed thinking block 'cannot be modified' (400) permanently wedges session
- RTL text support for Hebrew (and Arabic) in Claude Code
- [Bug] Random errors occurring across multiple operations