Skip to content

Commit 16454f5

Browse files
authored
fix(ui): show session runtime in sessions table
1 parent 430814e commit 16454f5

3 files changed

Lines changed: 51 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Docs: https://docs.openclaw.ai
8787
### Fixes
8888

8989
- Agents/generated media: treat attachment-style message tool actions as completed chat sends, preventing duplicate fallback media posts when generated files were already uploaded.
90+
- Control UI/sessions: show each session's agent runtime in the Sessions table and allow filtering by runtime labels, matching the Agents panel runtime wording. Thanks @vincentkoc.
9091
- Discord/streaming: show live reasoning text in progress drafts instead of a bare `Reasoning` status line.
9192
- Doctor/status: warn when `OPENCLAW_GATEWAY_TOKEN` would shadow a different active `gateway.auth.token` source for local CLI commands, while avoiding false positives when config points at the same env token. Fixes #74271. Thanks @yelog.
9293
- Gateway/HTTP: avoid loading managed outgoing-image media handlers for unrelated requests, so disabled OpenAI-compatible routes return 404 without waiting on lazy media sidecars. Thanks @vincentkoc.

‎ui/src/ui/views/sessions.test.ts‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,41 @@ describe("sessions view", () => {
367367
expect(badge?.textContent?.trim()).toBe("cron");
368368
});
369369

370+
it("renders and filters the session runtime", async () => {
371+
const container = document.createElement("div");
372+
render(
373+
renderSessions({
374+
...buildProps(
375+
buildMultiResult([
376+
{
377+
key: "agent:main:claude",
378+
kind: "direct",
379+
updatedAt: 20,
380+
agentRuntime: { id: "claude-cli", fallback: "none", source: "agent" },
381+
},
382+
{
383+
key: "agent:main:pi",
384+
kind: "direct",
385+
updatedAt: 10,
386+
agentRuntime: { id: "pi", source: "implicit" },
387+
},
388+
]),
389+
),
390+
searchQuery: "fallback none",
391+
}),
392+
container,
393+
);
394+
await Promise.resolve();
395+
396+
expect(
397+
Array.from(container.querySelectorAll("thead th")).map((cell) => cell.textContent?.trim()),
398+
).toContain("Runtime");
399+
expect(container.querySelector(".session-runtime-cell")?.textContent?.trim()).toBe(
400+
"claude-cli (fallback none)",
401+
);
402+
expect(container.textContent).not.toContain("agent:main:pi");
403+
});
404+
370405
it("keeps raw keys for inherited identity object properties", async () => {
371406
const container = document.createElement("div");
372407
render(

‎ui/src/ui/views/sessions.ts‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type {
1313
SessionCompactionCheckpoint,
1414
SessionsListResult,
1515
} from "../types.ts";
16+
import { resolveAgentRuntimeLabel } from "./agents-utils.ts";
1617

1718
export type SessionsProps = {
1819
loading: boolean;
@@ -178,7 +179,14 @@ function filterRows(
178179
const label = normalizeLowercaseStringOrEmpty(row.label);
179180
const kind = normalizeLowercaseStringOrEmpty(row.kind);
180181
const displayName = normalizeLowercaseStringOrEmpty(row.displayName);
181-
if (key.includes(q) || label.includes(q) || kind.includes(q) || displayName.includes(q)) {
182+
const runtime = normalizeLowercaseStringOrEmpty(resolveAgentRuntimeLabel(row.agentRuntime));
183+
if (
184+
key.includes(q) ||
185+
label.includes(q) ||
186+
kind.includes(q) ||
187+
displayName.includes(q) ||
188+
runtime.includes(q)
189+
) {
182190
return true;
183191
}
184192
const keyParts = parseSessionKeyParts(row.key);
@@ -543,6 +551,7 @@ export function renderSessions(props: SessionsProps) {
543551
${sortHeader("key", t("sessionsView.key"), "data-table-key-col")}
544552
<th>${t("sessionsView.label")}</th>
545553
${sortHeader("kind", t("sessionsView.kind"))}
554+
<th>${t("agents.context.runtime")}</th>
546555
${sortHeader("updated", t("sessionsView.updated"))}
547556
${sortHeader("tokens", t("sessionsView.tokens"))}
548557
<th>${t("sessionsView.compaction")}</th>
@@ -556,7 +565,7 @@ export function renderSessions(props: SessionsProps) {
556565
${paginated.length === 0
557566
? html`
558567
<tr>
559-
<td colspan="11" class="data-table-empty-cell">
568+
<td colspan="12" class="data-table-empty-cell">
560569
${emptyBecauseFiltered
561570
? html`
562571
<div class="data-table-empty-state" role="status" aria-live="polite">
@@ -748,6 +757,9 @@ function renderRows(row: GatewaySessionRow, props: SessionsProps) {
748757
<td>
749758
<span class="data-table-badge ${badgeClass}">${row.kind}</span>
750759
</td>
760+
<td class="session-runtime-cell">
761+
<span class="mono">${resolveAgentRuntimeLabel(row.agentRuntime)}</span>
762+
</td>
751763
<td>${updated}</td>
752764
<td class="session-token-cell">${formatSessionTokens(row)}</td>
753765
<td>
@@ -858,7 +870,7 @@ function renderRows(row: GatewaySessionRow, props: SessionsProps) {
858870
...(isExpanded && hasCheckpoints
859871
? [
860872
html`<tr id=${detailsId} class="session-checkpoint-details-row">
861-
<td colspan="11" style="padding: 0;">
873+
<td colspan="12" style="padding: 0;">
862874
<div
863875
style="padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface-2, rgba(127, 127, 127, 0.05));"
864876
>

0 commit comments

Comments
 (0)