From f696be950bdd210ba45739eb25142656b26ca5d0 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sat, 2 May 2026 22:10:35 -0700 Subject: [PATCH] fix(gateway): keep runtime metadata on session rows --- CHANGELOG.md | 1 + src/gateway/session-utils.test.ts | 2 +- src/gateway/session-utils.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a05f47ceb40..9ec796f569d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ Docs: https://docs.openclaw.ai - Control UI/WebChat: explain compaction boundaries in chat history and link directly to session checkpoint controls so pre-compaction turns no longer look silently lost after refresh. Fixes #76415. Thanks @BunsDev. - Channels/WhatsApp: attach native outbound mention metadata for group text and media captions by resolving `@+` and `@` tokens against WhatsApp participant data, including LID groups. Fixes #39879; carries forward #56863. Thanks @kengi1437, @joe2643, and @fridayck. - Gateway/sessions: keep async `sessions.list` title and preview hydration bounded to transcript head/tail reads so Control UI polling cannot full-scan large session transcripts every refresh. Thanks @vincentkoc. +- Gateway/sessions: keep agent runtime metadata on lightweight `sessions.list` rows so model-only session patches do not make Control UI lose runtime identity. Thanks @vincentkoc. - Gateway/sessions: keep bulk `sessions.list` rows lightweight by skipping per-row transcript usage fallback, display model inference, and plugin projection, avoiding event-loop stalls in large session stores. Thanks @Marvinthebored and @vincentkoc. - CLI/plugins: reject missing plugin ids before config writes in `plugins enable` and `plugins disable` so a typo no longer persists a stale config entry. (#73554) Thanks @ai-hpc. - Agents/sessions: preserve delivered trailing assistant replies during session-file repair so Telegram/WebChat history is not rewritten to drop already-delivered responses. Fixes #76329. Thanks @obviyus. diff --git a/src/gateway/session-utils.test.ts b/src/gateway/session-utils.test.ts index 017057b6694..8b88909f537 100644 --- a/src/gateway/session-utils.test.ts +++ b/src/gateway/session-utils.test.ts @@ -1143,7 +1143,7 @@ describe("listSessionsFromStore selected model display", () => { lastMessagePreview: "last 0", }), ); - expect(listed.sessions[0]?.agentRuntime).toBeUndefined(); + expect(listed.sessions[0]?.agentRuntime).toEqual({ id: "pi", source: "implicit" }); expect(listed.sessions[0]?.thinkingOptions).toEqual([]); } finally { fs.rmSync(tmpDir, { recursive: true, force: true }); diff --git a/src/gateway/session-utils.ts b/src/gateway/session-utils.ts index 3b470adec58..18c1e967a55 100644 --- a/src/gateway/session-utils.ts +++ b/src/gateway/session-utils.ts @@ -1582,7 +1582,7 @@ export function buildGatewaySessionRow(params: { const latestCompactionCheckpoint = buildCompactionCheckpointPreview( resolveLatestCompactionCheckpoint(entry), ); - const agentRuntime = lightweight ? undefined : resolveAgentRuntimeMetadata(cfg, sessionAgentId); + const agentRuntime = resolveAgentRuntimeMetadata(cfg, sessionAgentId); const selectedOrRuntimeModelProvider = selectedModel?.provider ?? modelProvider; const selectedOrRuntimeModel = selectedModel?.model ?? model; const rowModelIdentity = lightweight