LeoYeAI/agent-master-skills / skills/agent-chat-ux-v1-4-0
agent-chat-ux
VerifiedMulti-agent UX for OpenClaw Control UI — agent selector, per-agent sessions, session history viewer with search, agent-filtered Sessions tab with friendly names, Create Agent wizard, emoji picker, and backend agent CRUD.
| File | Kind | Size |
|---|---|---|
| .metadata.json | config | 5.6 KB |
| SKILL.md | skill md | 27.1 KB |
| _meta.json | config | 329 B |
| references/agents-panels-cron.txt | markdown | 1.9 KB |
| references/agents-utils.txt | markdown | 2.4 KB |
| references/agents-view.txt | markdown | 13.5 KB |
| references/app-main.txt | markdown | 850 B |
| references/app-render-helpers.txt | markdown | 1.1 KB |
| references/app-render.txt | markdown | 7.4 KB |
| references/schema-agents.txt | markdown | 561 B |
| references/server-agents.txt | markdown | 4.5 KB |
| references/v1.4.0/patch-01-sessions-history-rpc.txt | markdown | 7.3 KB |
| references/v1.4.0/patch-02-sessions-tab-overhaul.txt | markdown | 14.5 KB |
| references/v1.4.0/patch-03-app-wiring.txt | markdown | 8.8 KB |
| references/v1.4.0/patch-04-sessions-history-modal.ts | script | 9.4 KB |
| references/v1.4.0/patch-05-chat-sessions-all.txt | markdown | 441 B |
references/v1.4.0/patch-01-sessions-history-rpc.txt
View on GitHubdiff --git a/src/gateway/protocol/index.ts b/src/gateway/protocol/index.ts
index 98f1e0e52..66624b4ce 100644
--- a/src/gateway/protocol/index.ts
+++ b/src/gateway/protocol/index.ts
@@ -179,6 +179,8 @@ import {
SessionsResolveParamsSchema,
type SessionsUsageParams,
SessionsUsageParamsSchema,
+ type SessionsHistoryParams,
+ SessionsHistoryParamsSchema,
type ShutdownEvent,
ShutdownEventSchema,
type SkillsBinsParams,
@@ -294,6 +296,8 @@ export const validateSessionsCompactParams = ajv.compile<SessionsCompactParams>(
);
export const validateSessionsUsageParams =
ajv.compile<SessionsUsageParams>(SessionsUsageParamsSchema);
+export const validateSessionsHistoryParams =
+ ajv.compile<SessionsHistoryParams>(SessionsHistoryParamsSchema);
export const validateConfigGetParams = ajv.compile<ConfigGetParams>(ConfigGetParamsSchema);
export const validateConfigSetParams = ajv.compile<ConfigSetParams>(ConfigSetParamsSchema);
export const validateConfigApplyParams = ajv.compile<ConfigApplyParams>(ConfigApplyParamsSchema);
@@ -437,6 +441,7 @@ export {
SessionsDeleteParamsSchema,
SessionsCompactParamsSchema,
SessionsUsageParamsSchema,
+ SessionsHistoryParamsSchema,
ConfigGetParamsSchema,
ConfigSetParamsSchema,
ConfigApplyParamsSchema,
@@ -583,6 +588,7 @@ export type {
SessionsDeleteParams,
SessionsCompactParams,
SessionsUsageParams,
+ SessionsHistoryParams,
CronJob,
CronListParams,
CronStatusParams,
diff --git a/src/gateway/protocol/schema/sessions.ts b/src/gateway/protocol/schema/sessions.ts
index 0b32ef862..2c0fe1975 100644
--- a/src/gateway/protocol/schema/sessions.ts
+++ b/src/gateway/protocol/schema/sessions.ts
@@ -121,3 +121,19 @@ export const SessionsUsageParamsSchema = Type.Object(
},
{ additionalProperties: false },
);
+
+export const SessionsHistoryParamsSchema = Type.Object(
+ {
+ /** Session key to load history for. */
+ key: NonEmptyString,
+ /** Max messages to return (default 200, max 500). */
+ limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 500 })),
+ /** Pagination offset (default 0). */
+ offset: Type.Optional(Type.Integer({ minimum: 0 })),
+ /** Text search filter (case-insensitive substring match). */
+ search: Type.Optional(Type.String()),
+ /** Filter by role(s). */
+ rolesFilter: Type.Optional(Type.Array(Type.String())),
+ },
+ { additionalProperties: false },
+);
diff --git a/src/gateway/protocol/schema/types.ts b/src/gateway/protocol/schema/types.ts
index ead66ca78..ac1848a9c 100644
--- a/src/gateway/protocol/schema/types.ts
+++ b/src/gateway/protocol/schema/types.ts
@@ -119,6 +119,7 @@ import type {
SessionsResetParamsSchema,
SessionsResolveParamsSchema,
SessionsUsageParamsSchema,
+ SessionsHistoryParamsSchema,
} from "./sessions.js";
import type { PresenceEntrySchema, SnapshotSchema, StateVersionSchema } from "./snapshot.js";
import type {
@@ -167,6 +168,7 @@ export type SessionsResetParams = Static<typeof SessionsResetParamsSchema>;
export type SessionsDeleteParams = Static<typeof SessionsDeleteParamsSchema>;
export type SessionsCompactParams = Static<typeof SessionsCompactParamsSchema>;
export type SessionsUsageParams = Static<typeof SessionsUsageParamsSchema>;
+export type SessionsHistoryParams = Static<typeof SessionsHistoryParamsSchema>;
export type ConfigGetParams = Static<typeof ConfigGetParamsSchema>;
export type ConfigSetParams = Static<typeof ConfigSetParamsSchema>;
export type ConfigApplyParams = Static<typeof ConfigApplyParamsSchema>;
diff --git a/src/gateway/server-methods/sessions.ts b/src/gateway/server-methods/sessions.ts
index ffe69ba88..8689f739b 100644
--- a/src/gateway/server-methods/sessions.ts
+++ b/src/gateway/server-methods/sessions.ts
@@ -24,6 +24,7 @@ import {
validateSessionsPreviewParams,
validateSessionsResetParams,
validateSessionsResolveParams,
+ validateSessionsHistoryParams,
} from "../protocol/index.js";
import {
archiveFileOnDisk,
@@ -498,4 +499,98 @@ export const sessionsHandlers: GatewayRequestHandlers = {
undefined,
);
},
+
+ "sessions.history": ({ params, respond }) => {
+ if (!assertValidParams(params, validateSessionsHistoryParams, "sessions.history", respond)) {
+ return;
+ }
+ const p = params;
+ const key = requireSessionKey(p.key, respond);
+ if (!key) return;
+
+ const cfg = loadConfig();
+ const storeTarget = resolveGatewaySessionStoreTarget({ cfg, key, scanLegacyKeys: false });
+ const store = loadSessionStore(storeTarget.storePath);
+ const target = resolveGatewaySessionStoreTarget({ cfg, key, store });
+ const entry = target.storeKeys.map((candidate) => store[candidate]).find(Boolean);
+
+ if (!entry?.sessionId) {
+ respond(true, { key, sessionId: "", agentId: target.agentId ?? "", total: 0, offset: 0, items: [] }, undefined);
+ return;
+ }
+
+ const candidates = resolveSessionTranscriptCandidates(
+ entry.sessionId,
+ target.storePath,
+ entry.sessionFile,
+ target.agentId,
+ );
+ const filePath = candidates.find((p) => fs.existsSync(p));
+ if (!filePath) {
+ respond(true, { key, sessionId: entry.sessionId, agentId: target.agentId ?? "", total: 0, offset: 0, items: [] }, undefined);
+ return;
+ }
+
+ const limit = Math.min(p.limit ?? 200, 500);
+ const offset = p.offset ?? 0;
+ const search = typeof p.search === "string" ? p.search.trim().toLowerCase() : "";
+ const rolesFilter = Array.isArray(p.rolesFilter) && p.rolesFilter.length > 0
+ ? new Set(p.rolesFilter.map((r: string) => r.toLowerCase()))
+ : null;
+
+ // Read full JSONL and extract messages
+ type HistoryItem = { role: string; text: string; timestamp: string };
+ const allItems: HistoryItem[] = [];
+ try {
+ const content = fs.readFileSync(filePath, "utf-8");
+ for (const line of content.split("\n")) {
+ if (!line.trim()) continue;
+ try {
+ const parsed = JSON.parse(line);
+ if (parsed?.type !== "message") continue;
+ const msg = parsed?.message;
+ if (!msg || typeof msg !== "object") continue;
+
+ const role: string = msg.role ?? "other";
+ let text = "";
+ if (typeof msg.content === "string") {
+ text = msg.content;
+ } else if (Array.isArray(msg.content)) {
+ text = msg.content
+ .filter((c: { type?: string }) => c?.type === "text")
+ .map((c: { text?: string }) => c?.text ?? "")
+ .join("\n");
+ }
+
+ const timestamp: string = parsed.timestamp ?? "";
+
+ // Apply filters
+ if (rolesFilter && !rolesFilter.has(role.toLowerCase())) continue;
+ if (search && !text.toLowerCase().includes(search)) continue;
+
+ allItems.push({ role, text, timestamp });
+ } catch {
+ // skip malformed lines
+ }
+ }
+ } catch {
+ respond(true, { key, sessionId: entry.sessionId, agentId: target.agentId ?? "", total: 0, offset: 0, items: [] }, undefined);
+ return;
+ }
+
+ const total = allItems.length;
+ const paged = allItems.slice(offset, offset + limit);
+ respond(
+ true,
+ {
+ key,
+ sessionId: entry.sessionId,
+ agentId: target.agentId ?? "",
+ total,
+ offset,
+ items: paged,
+ },
+ undefined,
+ );
+ },
};
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |