Update version to 0.1.39 and align chat requests with OpenClaw session behavior

This commit is contained in:
techartdev
2026-02-20 23:10:32 +02:00
parent 9ed13e4e96
commit 367541044c
7 changed files with 16 additions and 3 deletions
+8
View File
@@ -2,6 +2,14 @@
All notable changes to the OpenClaw Home Assistant Integration will be documented in this file. All notable changes to the OpenClaw Home Assistant Integration will be documented in this file.
## [0.1.39] - 2026-02-20
### Fixed
- Aligned gateway chat requests with OpenClaw session behavior by sending OpenAI `user` with the stable session ID.
- Added `x-openclaw-session-key` request header for explicit session routing on OpenClaw gateways.
- Improves multi-turn continuity where `/v1/chat/completions` would otherwise default to stateless per-request sessions.
- Removed per-request chat-history replay to avoid unnecessary prompt growth when gateway session memory is active.
## [0.1.37] - 2026-02-20 ## [0.1.37] - 2026-02-20
### Fixed ### Fixed
+2 -1
View File
@@ -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) # URL at which the card JS is served (registered via register_static_path)
_CARD_STATIC_URL = f"/openclaw/{_CARD_FILENAME}" _CARD_STATIC_URL = f"/openclaw/{_CARD_FILENAME}"
# Versioned URL used for Lovelace resource registration to avoid stale browser cache # Versioned URL used for Lovelace resource registration to avoid stale browser cache
_CARD_URL = f"{_CARD_STATIC_URL}?v=0.1.37" _CARD_URL = f"{_CARD_STATIC_URL}?v=0.1.39"
OpenClawConfigEntry = ConfigEntry OpenClawConfigEntry = ConfigEntry
@@ -386,6 +386,7 @@ def _async_register_services(hass: HomeAssistant) -> None:
system_prompt = apply_context_policy(raw_context, max_chars, strategy) system_prompt = apply_context_policy(raw_context, max_chars, strategy)
_append_chat_history(hass, session_id, "user", message) _append_chat_history(hass, session_id, "user", message)
response = await client.async_send_message( response = await client.async_send_message(
message=message, message=message,
session_id=session_id, session_id=session_id,
+4
View File
@@ -193,6 +193,7 @@ class OpenClawApiClient:
} }
if session_id: if session_id:
payload["session_id"] = session_id payload["session_id"] = session_id
payload["user"] = session_id
if model: if model:
payload["model"] = model payload["model"] = model
@@ -200,6 +201,7 @@ class OpenClawApiClient:
headers = self._headers() headers = self._headers()
if session_id: if session_id:
headers["X-Session-Id"] = session_id headers["X-Session-Id"] = session_id
headers["x-openclaw-session-key"] = session_id
session = await self._get_session() session = await self._get_session()
url = f"{self._base_url}{API_CHAT_COMPLETIONS}" url = f"{self._base_url}{API_CHAT_COMPLETIONS}"
@@ -253,12 +255,14 @@ class OpenClawApiClient:
} }
if session_id: if session_id:
payload["session_id"] = session_id payload["session_id"] = session_id
payload["user"] = session_id
if model: if model:
payload["model"] = model payload["model"] = model
headers = self._headers() headers = self._headers()
if session_id: if session_id:
headers["X-Session-Id"] = session_id headers["X-Session-Id"] = session_id
headers["x-openclaw-session-key"] = session_id
session = await self._get_session() session = await self._get_session()
url = f"{self._base_url}{API_CHAT_COMPLETIONS}" url = f"{self._base_url}{API_CHAT_COMPLETIONS}"
+1 -1
View File
@@ -8,7 +8,7 @@
"iot_class": "local_polling", "iot_class": "local_polling",
"issue_tracker": "https://github.com/techartdev/OpenClawHomeAssistant/issues", "issue_tracker": "https://github.com/techartdev/OpenClawHomeAssistant/issues",
"requirements": [], "requirements": [],
"version": "0.1.37", "version": "0.1.39",
"dependencies": ["conversation"], "dependencies": ["conversation"],
"after_dependencies": ["hassio", "lovelace"] "after_dependencies": ["hassio", "lovelace"]
} }
+1 -1
View File
@@ -1,7 +1,7 @@
(async () => { (async () => {
try { try {
if (!customElements.get("openclaw-chat-card")) { if (!customElements.get("openclaw-chat-card")) {
const src = "/openclaw/openclaw-chat-card.js?v=0.1.37"; const src = "/openclaw/openclaw-chat-card.js?v=0.1.39";
console.info("OpenClaw loader importing", src); console.info("OpenClaw loader importing", src);
await import(src); await import(src);
} }