fix: handle gateway slash command replies in TUI
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
} from "../routing/session-key.js";
|
||||
import type { ChatLog } from "./components/chat-log.js";
|
||||
import type { GatewayAgentsList, GatewayChatClient } from "./gateway-chat.js";
|
||||
import { asString, extractTextFromMessage } from "./tui-formatters.js";
|
||||
import { asString, extractTextFromMessage, isCommandMessage } from "./tui-formatters.js";
|
||||
import type { TuiOptions, TuiStateAccess } from "./tui-types.js";
|
||||
|
||||
type SessionActionContext = {
|
||||
@@ -161,6 +161,11 @@ export function createSessionActions(context: SessionActionContext) {
|
||||
for (const entry of record.messages ?? []) {
|
||||
if (!entry || typeof entry !== "object") continue;
|
||||
const message = entry as Record<string, unknown>;
|
||||
if (isCommandMessage(message)) {
|
||||
const text = extractTextFromMessage(message);
|
||||
if (text) chatLog.addSystem(text);
|
||||
continue;
|
||||
}
|
||||
if (message.role === "user") {
|
||||
const text = extractTextFromMessage(message);
|
||||
if (text) chatLog.addUser(text);
|
||||
|
||||
Reference in New Issue
Block a user