mesh-api icon indicating copy to clipboard operation
mesh-api copied to clipboard

Feature request: Assign agent_id to Home Assistant

Open Th3H0ff opened this issue 5 months ago • 3 comments

Greetings

I tried to add the agent_id config to the Home Assistant extension but Mesh-API doesnt seem to honor it. I'm still sent to the default conversation agent and I find it limited and have built my own.

{ "channel_index": 2, "enable_pin": false, "enabled": true, "secure_pin": "1234", "timeout": 90, "agent_id": "conversation.llama_cpp_model", "token": "xxxx", "url": "http://xxxxx:8123/api/conversation/process" }

Reference https://developers.home-assistant.io/docs/intent_conversation_api/

Th3H0ff avatar Jun 23 '26 11:06 Th3H0ff

Thanks @Th3H0ff — you're right, agent_id was being ignored. Confirmed in the code: the Home Assistant extension only ever sent {"text": ...} to /api/conversation/process, so HA always fell back to its default conversation agent regardless of what you put in config.json.

Proposed fix (staged, pending the next release): the request body now includes agent_id (and language) when set, per the HA conversation API:

{
  "text": "...",
  "agent_id": "conversation.llama_cpp_model",   // your configured agent
  "language": "en",                              // optional
  "conversation_id": "..."                       // carried over for multi-turn continuity
}

Details:

  • New agent_id and language keys in the extension's config.json (both optional; blank = HA default).
  • conversation_id from HA's response is now retained and echoed back on the next turn, so follow-ups stay in the same conversation.
  • Same support added to the legacy core Home Assistant path (home_assistant_agent_id / home_assistant_language) and surfaced as Agent ID / Language fields in the WebUI HA section, so it's not raw-JSON-only.

Your exact config ("agent_id": "conversation.llama_cpp_model") is what I tested the payload against. Leaving this open for now — once it ships, can you confirm your custom agent actually receives the requests? If you also want per-message agent selection (vs. one fixed agent), let me know and we can look at that separately.

mr-tbot avatar Jul 08 '26 17:07 mr-tbot

Implemented in v0.7.5.0 Beta (just released).

The Home Assistant conversation requests now include agent_id (plus language and conversation_id for multi-turn continuity), so a configured custom agent is actually used instead of HA's default. There are now Agent ID / Language fields in the WebUI too. Your exact config ("agent_id": "conversation.llama_cpp_model") is what the payload was tested against.

Please update and confirm your custom agent now receives the requests. Leaving open for your feedback.

mr-tbot avatar Jul 19 '26 00:07 mr-tbot

Update: this is shipped in v0.7.5.2 Beta — https://github.com/mr-tbot/mesh-api/releases/tag/v0.7.5.2-beta

Note: v0.7.5.0/v0.7.5.1 were pulled (a dashboard bug), so please use v0.7.5.2. Home Assistant conversation requests now send agent_id (plus language and conversation_id), with Agent ID / Language fields in the WebUI, so your configured conversation.llama_cpp_model agent is actually used.

Grab v0.7.5.2 (or docker pull mrtbot/mesh-api:latest) and let me know if your custom agent now receives the requests. Leaving open for feedback.

mr-tbot avatar Jul 19 '26 04:07 mr-tbot