diff --git a/CHANGELOG.md b/CHANGELOG.md index dbc669b..5dbe60a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to the OpenClaw Home Assistant Integration will be documented in this file. +## [0.1.37] - 2026-02-20 + +### Fixed +- Improved conversation continuity by sending `session_id` in chat completion JSON payloads (in addition to `X-Session-Id` header), for both regular and streaming requests. +- Reduces cases where the gateway treats each message as a new conversation when custom headers are ignored upstream. + ## [0.1.36] - 2026-02-20 ### Fixed diff --git a/custom_components/openclaw/__init__.py b/custom_components/openclaw/__init__.py index 9adefcc..26a6f7e 100644 --- a/custom_components/openclaw/__init__.py +++ b/custom_components/openclaw/__init__.py @@ -78,7 +78,7 @@ _CARD_PATH = Path(__file__).parent / "www" / _CARD_FILENAME # URL at which the card JS is served (registered via register_static_path) _CARD_STATIC_URL = f"/openclaw/{_CARD_FILENAME}" # Versioned URL used for Lovelace resource registration to avoid stale browser cache -_CARD_URL = f"{_CARD_STATIC_URL}?v=0.1.36" +_CARD_URL = f"{_CARD_STATIC_URL}?v=0.1.37" OpenClawConfigEntry = ConfigEntry diff --git a/custom_components/openclaw/__pycache__/api.cpython-312.pyc b/custom_components/openclaw/__pycache__/api.cpython-312.pyc index bd0bfb0..1e25152 100644 Binary files a/custom_components/openclaw/__pycache__/api.cpython-312.pyc and b/custom_components/openclaw/__pycache__/api.cpython-312.pyc differ diff --git a/custom_components/openclaw/api.py b/custom_components/openclaw/api.py index b4777ca..8d4fc10 100644 --- a/custom_components/openclaw/api.py +++ b/custom_components/openclaw/api.py @@ -191,6 +191,8 @@ class OpenClawApiClient: "messages": messages, "stream": False, } + if session_id: + payload["session_id"] = session_id if model: payload["model"] = model @@ -249,6 +251,8 @@ class OpenClawApiClient: "messages": messages, "stream": True, } + if session_id: + payload["session_id"] = session_id if model: payload["model"] = model diff --git a/custom_components/openclaw/manifest.json b/custom_components/openclaw/manifest.json index 470305b..79dc099 100644 --- a/custom_components/openclaw/manifest.json +++ b/custom_components/openclaw/manifest.json @@ -8,7 +8,7 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/techartdev/OpenClawHomeAssistant/issues", "requirements": [], - "version": "0.1.36", + "version": "0.1.37", "dependencies": ["conversation"], "after_dependencies": ["hassio", "lovelace"] } diff --git a/www/openclaw-chat-card.js b/www/openclaw-chat-card.js index c219949..5807994 100644 --- a/www/openclaw-chat-card.js +++ b/www/openclaw-chat-card.js @@ -1,7 +1,7 @@ (async () => { try { if (!customElements.get("openclaw-chat-card")) { - const src = "/openclaw/openclaw-chat-card.js?v=0.1.36"; + const src = "/openclaw/openclaw-chat-card.js?v=0.1.37"; console.info("OpenClaw loader importing", src); await import(src); }