mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
`id` is optional in JSON-RPC and may legitimately be `null`. The previous
`int(payload.get("id", 0))` only defaults when the key is absent — a present
`"id": null` reaches `int(None)` and raises TypeError. The exception
propagates out of the message handler, the MCP handshake never completes, and
the session is left with ready=False (no device tools) and no clear error.
Use `or 0` so both the missing-key and explicit-null cases collapse to 0.
Applies to the result and error branches.
|
||
|---|---|---|
| .. | ||
| config | ||
| core | ||
| models | ||
| music | ||
| performance_tester | ||
| plugins_func | ||
| agent-base-prompt.txt | ||
| app.py | ||
| config.yaml | ||
| config_from_api.yaml | ||
| docker-compose.yml | ||
| docker-compose_all.yml | ||
| mcp_server_settings.json | ||
| performance_tester.py | ||
| requirements.txt | ||