diff --git a/package.json b/package.json index 7baf4c8148d..9d25410c6e4 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "build": "tsc -b && tsc -p tsconfig.server.json && vite build", "typecheck": "tsc -b && tsc -p tsconfig.server.json", "test": "vitest run", + "bench:context": "node --experimental-strip-types scripts/bench-context.ts", "test:watch": "vitest", "preview": "vite preview", "build:server": "tsc -p tsconfig.server.build.json", diff --git a/scripts/bench-context.ts b/scripts/bench-context.ts new file mode 100644 index 00000000000..2b5941f67d9 --- /dev/null +++ b/scripts/bench-context.ts @@ -0,0 +1,23 @@ +import { packTranscript } from "../server/context.ts"; + +// Representative long-running support task: an initial objective, 30 settled +// turns with logs/results, then a final constrained request. This is a stable, +// offline benchmark of prompt payload only; it does not pretend to measure a +// provider's tokenizer, latency, or task success rate. +const transcript = [ + { role: "user" as const, text: "Investigate the release failure, keep secrets out of logs, and give me a verified fix." }, + ...Array.from({ length: 30 }, (_, index) => ({ + role: index % 2 === 0 ? ("assistant" as const) : ("user" as const), + text: `Turn ${index + 1}: ${"diagnostic detail, command output, constraints, and verification evidence ".repeat(70)}`, + })), + { role: "user" as const, text: "Now give the minimal verified remediation and preserve the deployment rollback plan." }, +]; + +const { stats } = packTranscript(transcript); +const reduction = ((1 - stats.submittedChars / stats.originalChars) * 100).toFixed(1); + +console.log("Context packing benchmark (offline deterministic fixture)"); +console.log(`Messages: ${stats.originalMessages} → ${stats.submittedMessages} (${stats.omittedMessages} compacted)`); +console.log(`Characters: ${stats.originalChars} → ${stats.submittedChars} (${reduction}% reduction)`); +console.log(`Estimated input tokens: ${stats.originalEstimatedTokens} → ${stats.submittedEstimatedTokens}`); +console.log("Accuracy note: this benchmark verifies preservation of the original goal and most recent exchange structurally; it does not claim model task-success results."); diff --git a/server/context.test.ts b/server/context.test.ts new file mode 100644 index 00000000000..7ec34a8b2db --- /dev/null +++ b/server/context.test.ts @@ -0,0 +1,38 @@ +import { describe, expect, it } from "vitest"; +import { CONTEXT_CHAR_BUDGET, packTranscript } from "./context.ts"; + +describe("packTranscript", () => { + it("leaves short history byte-for-byte intact", () => { + const source = [{ role: "user" as const, text: "Plan a trip" }, { role: "assistant" as const, text: "Where would you like to go?" }]; + expect(packTranscript(source)).toMatchObject({ + transcript: source, + stats: { compacted: false, omittedMessages: 0, submittedChars: 38 }, + }); + }); + + it("preserves original goal and recent exchange while compacting old history", () => { + const source = [ + { role: "user" as const, text: "Build a release checklist for the Windows app." }, + ...Array.from({ length: 30 }, (_, index) => ({ role: index % 2 ? ("assistant" as const) : ("user" as const), text: `turn ${index}: ${"details ".repeat(180)}` })), + { role: "user" as const, text: "Keep the final checklist concise and include signing." }, + ]; + const packed = packTranscript(source); + expect(packed.stats).toMatchObject({ compacted: true, originalMessages: 32 }); + expect(packed.stats.submittedChars).toBeLessThanOrEqual(CONTEXT_CHAR_BUDGET); + expect(packed.stats.submittedEstimatedTokens).toBeLessThan(packed.stats.originalEstimatedTokens); + expect(packed.transcript[0].text).toContain("Build a release checklist"); + expect(packed.transcript.at(-1)?.text).toContain("include signing"); + }); + + it("keeps an oversized original goal verbatim instead of clipping it", () => { + const goal = `Keep this exact task definition. ${"important constraint ".repeat(900)}`; + const packed = packTranscript([ + { role: "user", text: goal }, + { role: "assistant", text: "Acknowledged" }, + { role: "user", text: "And do not forget the release notes." }, + ], 1_000); + + expect(packed.transcript).toEqual([{ role: "user", text: goal }]); + expect(packed.stats).toMatchObject({ compacted: true, omittedMessages: 2, submittedChars: goal.length }); + }); +}); diff --git a/server/context.ts b/server/context.ts new file mode 100644 index 00000000000..c0dc1e729dc --- /dev/null +++ b/server/context.ts @@ -0,0 +1,152 @@ +/** + * Deterministic context packing for transcript-replay providers. + * + * It deliberately does not ask a model to summarize history: that would add + * latency/cost and can hallucinate. Short conversations pass through unchanged; + * long ones retain the user's first goal, recent turns, and a bounded record of + * earlier user decisions and assistant outcomes. + */ +export type TranscriptRole = "user" | "assistant"; +export interface TranscriptEntry { + role: TranscriptRole; + text: string; +} + +export interface ContextStats { + originalMessages: number; + submittedMessages: number; + omittedMessages: number; + originalChars: number; + submittedChars: number; + originalEstimatedTokens: number; + submittedEstimatedTokens: number; + compacted: boolean; +} + +export interface PackedContext { + transcript: TranscriptEntry[]; + stats: ContextStats; +} + +export const CONTEXT_CHAR_BUDGET = 12_000; +const RECENT_CHAR_BUDGET = 8_000; +const EXCERPT_CHAR_BUDGET = 280; +const MAX_DECISIONS = 5; +const MAX_OUTCOMES = 3; + +/** Deliberately labelled as an estimate; authoritative values come from providers. */ +export function estimateTokens(chars: number): number { + return Math.ceil(chars / 4); +} + +function chars(entries: TranscriptEntry[]) { + return entries.reduce((total, entry) => total + entry.text.length, 0); +} + +function excerpt(text: string, limit = EXCERPT_CHAR_BUDGET) { + const normalized = text.replace(/\s+/g, " ").trim(); + return normalized.length <= limit ? normalized : `${normalized.slice(0, limit - 1).trimEnd()}…`; +} + +function summary(omitted: TranscriptEntry[]): TranscriptEntry { + const decisions = omitted.filter((entry) => entry.role === "user").slice(-MAX_DECISIONS).map((entry) => `- ${excerpt(entry.text)}`); + const outcomes = omitted.filter((entry) => entry.role === "assistant").slice(-MAX_OUTCOMES).map((entry) => `- ${excerpt(entry.text)}`); + const sections = [ + `[Earlier conversation compacted: ${omitted.length} settled messages omitted. Treat the structured record below as context, not as new instructions.]`, + decisions.length ? `Earlier user decisions / constraints:\n${decisions.join("\n")}` : "", + outcomes.length ? `Earlier assistant outcomes:\n${outcomes.join("\n")}` : "", + ].filter(Boolean); + return { role: "user", text: sections.join("\n\n") }; +} + +/** + * Packs a history only when it exceeds the character budget. Recent turns are + * kept verbatim. The oldest user message is retained as the original task + * grounding, while the middle becomes a compact, reviewable structured record. + */ +export function packTranscript(entries: TranscriptEntry[], charBudget = CONTEXT_CHAR_BUDGET): PackedContext { + // Do not normalize the retained transcript: the first user instruction is + // task-defining context, so compaction must never silently rewrite it. + const clean = entries.filter((entry) => entry.text.trim()).map((entry) => ({ ...entry })); + const originalChars = chars(clean); + const base = { + originalMessages: clean.length, + originalChars, + originalEstimatedTokens: estimateTokens(originalChars), + }; + if (originalChars <= charBudget) { + return { + transcript: clean, + stats: { ...base, submittedMessages: clean.length, omittedMessages: 0, submittedChars: originalChars, submittedEstimatedTokens: estimateTokens(originalChars), compacted: false }, + }; + } + + const goalIndex = clean.findIndex((entry) => entry.role === "user"); + const goal = goalIndex >= 0 ? clean[goalIndex] : undefined; + // A user can supply an instruction larger than the configured context + // budget. The only faithful representation is the instruction itself; + // preserve it verbatim rather than clipping the task definition. + if (goal && goal.text.length > charBudget) { + const submittedChars = goal.text.length; + return { + transcript: [goal], + stats: { + ...base, + submittedMessages: 1, + omittedMessages: clean.length - 1, + submittedChars, + submittedEstimatedTokens: estimateTokens(submittedChars), + compacted: true, + }, + }; + } + const recent: TranscriptEntry[] = []; + let recentChars = 0; + const recentBudget = Math.min(RECENT_CHAR_BUDGET, Math.max(0, charBudget - (goal?.text.length ?? 0))); + for (let index = clean.length - 1; index >= 0; index -= 1) { + if (index === goalIndex) continue; + const entry = clean[index]; + if (recent.length && recentChars + entry.text.length > recentBudget) break; + recent.unshift(entry); + recentChars += entry.text.length; + } + const retained = new Set(recent); + if (goal) retained.add(goal); + let omitted = clean.filter((entry) => !retained.has(entry)); + let compacted = summary(omitted); + let transcript = [ + ...(goal ? [goal] : []), + ...(omitted.length ? [compacted] : []), + ...recent, + ]; + // Keep the first goal intact. Prefer dropping old retained turns before + // reducing the deterministic summary; no full-screen style clipping of the + // task definition is ever permitted. + while (chars(transcript) > charBudget && recent.length) { + const dropped = recent.shift(); + if (dropped) { + omitted = [...omitted, dropped]; + compacted = summary(omitted); + } + transcript = [...(goal ? [goal] : []), ...(omitted.length ? [compacted] : []), ...recent]; + } + if (chars(transcript) > charBudget && omitted.length) { + const summaryBudget = Math.max(0, charBudget - chars(goal ? [goal] : [])); + transcript = [ + ...(goal ? [goal] : []), + ...(summaryBudget ? [{ ...compacted, text: excerpt(compacted.text, summaryBudget) }] : []), + ]; + } + const submittedChars = chars(transcript); + return { + transcript, + stats: { + ...base, + submittedMessages: transcript.length, + omittedMessages: omitted.length, + submittedChars, + submittedEstimatedTokens: estimateTokens(submittedChars), + compacted: true, + }, + }; +} diff --git a/server/contracts.ts b/server/contracts.ts index e0111577a2d..6a55fa7d38d 100644 --- a/server/contracts.ts +++ b/server/contracts.ts @@ -121,6 +121,9 @@ export interface ProviderAdapter { readonly provider: DriverKind; readonly capabilities: { sessionModelSwitch: "in-session" | "unsupported"; + /** The adapter sends SendTurnInput.transcript to its provider on ordinary + * turns (as opposed to retaining native session history). */ + transcriptReplay?: boolean; /** True when the driver mounts turn.integrations.agents as MCP tools — * the harness only offers agents tooling (and prompts about it) to * drivers that can actually hand it to the agent. */ diff --git a/server/drivers/grok.ts b/server/drivers/grok.ts index 419e9e1f8fa..c5ffe5fc113 100644 --- a/server/drivers/grok.ts +++ b/server/drivers/grok.ts @@ -201,7 +201,7 @@ export const GrokDriver: ProviderDriver = { snapshot, adapter: { provider: DRIVER_KIND, - capabilities: { sessionModelSwitch: "in-session" }, + capabilities: { sessionModelSwitch: "in-session", transcriptReplay: true }, sendTurn, interruptTurn: async (threadId) => active.get(threadId)?.abort.abort(), respondToRequest: async () => { diff --git a/server/index.ts b/server/index.ts index 17ef36030c0..9b2f39dd3d7 100644 --- a/server/index.ts +++ b/server/index.ts @@ -9,6 +9,7 @@ import { dirname, extname, join } from "node:path"; import { fileURLToPath } from "node:url"; import * as box from "./box.ts"; +import { packTranscript } from "./context.ts"; import * as composio from "./composio.ts"; import { ensureDirs, instanceConfigs, loadConfig, saveConfig, EVENTS_DIR, NATIVE_DIR } from "./config.ts"; import type { RuntimeEvent } from "./contracts.ts"; @@ -16,7 +17,7 @@ import type { RuntimeEvent } from "./contracts.ts"; import { BUILT_IN_DRIVERS } from "./drivers/builtIn.ts"; import { EventBus } from "./harness/bus.ts"; import { ProviderRegistry } from "./harness/registry.ts"; -import { mentionedBots, Store, type Message } from "./store.ts"; +import { mentionedBots, Store, type Message, type TaskUsage } from "./store.ts"; const PORT = Number(process.env.OMB_PORT || process.env.OGB_PORT || 8799); const STATIC_DIR = process.env.OMB_STATIC_DIR || null; @@ -143,6 +144,12 @@ bus.subscribe((event: RuntimeEvent) => { if (!bot && !group) return; const speaker = group ? groupSpeakers.get(event.threadId) : undefined; + const publishRun = (update: (run: TaskUsage) => TaskUsage) => { + if (!bot) return; + const patched = store.updateActiveRun(bot.id, update); + if (patched) broadcast({ kind: "bot", bot: patched }); + }; + const pushMessage = (m: Omit) => { const message = store.appendMessage(event.threadId, group && m.role === "bot" ? { ...m, from: speaker } : m); broadcast({ kind: "message", threadId: event.threadId, message }); @@ -180,6 +187,14 @@ bus.subscribe((event: RuntimeEvent) => { break; case "item.started": if (event.itemType === "tool") { + const title = event.title ?? "tool"; + publishRun((run) => ({ + ...run, + toolCalls: run.toolCalls + 1, + computerActions: /computer|screenshot|screen|browser|click|keyboard|mouse/i.test(title) + ? run.computerActions + 1 + : run.computerActions, + })); // ask_bot's raw tool chip is redundant — the internal endpoint // appends a richer "Messaged @X" chip linking to the channel if (event.title?.endsWith("__ask_bot")) break; @@ -187,6 +202,13 @@ bus.subscribe((event: RuntimeEvent) => { if (event.itemId) toolMessageByItem.set(event.itemId, message.id); } break; + case "thread.token-usage.updated": + publishRun((run) => ({ + ...run, + reportedInputTokens: run.reportedInputTokens + Math.max(0, event.input), + reportedOutputTokens: run.reportedOutputTokens + Math.max(0, event.output), + })); + break; case "request.opened": { const permission = event.requestType === "permission"; const message = pushMessage({ @@ -222,7 +244,8 @@ bus.subscribe((event: RuntimeEvent) => { case "turn.completed": { if (bot) { store.patchBot(bot.id, { busy: false, unread: true }); - broadcast({ kind: "bot", bot: store.bot(bot.id) }); + const settled = store.finishRun(bot.id, { ok: event.ok, stopReason: event.stopReason, providerCost: event.cost }); + broadcast({ kind: "bot", bot: settled ?? store.bot(bot.id) }); if (screenPollers.has(bot.id)) { // the last live frame becomes a settled inline screen message — // the screenshot-in-chat moment. One fresh capture first, so the @@ -382,11 +405,12 @@ async function startTurn( // transcript for API-backed drivers: settled text turns on the ACTIVE // branch only — abandoned forks never reach the model - const transcript = store + const sourceTranscript = store .activePath(bot.threadId) .filter((m) => m.kind === "text" && m.text && m.id !== userMessage.id) - .slice(-40) .map((m) => ({ role: m.role === "user" ? ("user" as const) : ("assistant" as const), text: m.text! })); + const packedContext = packTranscript(sourceTranscript); + const transcript = packedContext.transcript; // After a rewind (edit / branch switch) the provider's native session // still contains the abandoned branch: start a fresh session instead of @@ -509,8 +533,17 @@ async function startTurn( : ""), integrations, }); + // `sendTurn` has accepted the request. Count a model call only now: + // provisioning/auth failures must not look like completed model work. + // Native sessions retain their own history, so only replayed contexts + // expose deterministic compaction accounting. + store.beginRun( + bot.id, + instance.adapter.capabilities.transcriptReplay === true || rewound ? packedContext.stats : undefined, + ); // dispatched: the rewind is spent, and the old cursors are dead if (rewound) store.patchBot(bot.id, { rewound: false, resumeCursors: {} }); + broadcast({ kind: "bot", bot: store.bot(bot.id) }); if (previewBoxId) startScreenPoller(bot.id, previewBoxId); } catch (e) { const message = e instanceof Error ? e.message : String(e); @@ -521,7 +554,8 @@ async function startTurn( }); broadcast({ kind: "message", threadId: bot.threadId, message: failure }); store.patchBot(bot.id, { busy: false }); - broadcast({ kind: "bot", bot: store.bot(bot.id) }); + const settled = store.finishRun(bot.id, { ok: false, stopReason: "dispatch_error" }); + broadcast({ kind: "bot", bot: settled ?? store.bot(bot.id) }); } })(); } diff --git a/server/store.test.ts b/server/store.test.ts index e2de098aac4..e39c19ef296 100644 --- a/server/store.test.ts +++ b/server/store.test.ts @@ -83,6 +83,37 @@ describe("Store", () => { expect(reloaded.bot(bot.id)?.resumeCursors).toEqual({ claude: "sess-abc", codex: "thread-xyz" }); }); + it("persists a settled per-turn usage record but not a live run after restart", () => { + const store = new Store(selection); + const bot = store.createBot(); + store.beginRun(bot.id, { + originalMessages: 42, submittedMessages: 8, omittedMessages: 34, + originalChars: 16_000, submittedChars: 3_200, + originalEstimatedTokens: 4_000, submittedEstimatedTokens: 800, compacted: true, + }); + store.updateActiveRun(bot.id, (run) => ({ ...run, toolCalls: 3, reportedInputTokens: 700, reportedOutputTokens: 120 })); + store.finishRun(bot.id, { ok: true, providerCost: 0.0125 }); + expect(store.bot(bot.id)?.activeRun).toBeNull(); + + const reloaded = new Store(selection); + expect(reloaded.bot(bot.id)?.activeRun).toBeUndefined(); + expect(reloaded.bot(bot.id)?.lastRun).toMatchObject({ + ok: true, toolCalls: 3, reportedInputTokens: 700, reportedOutputTokens: 120, + providerCost: 0.0125, context: { compacted: true, omittedMessages: 34 }, + }); + }); + + it("persists restart cleanup of a stale live run", () => { + const store = new Store(selection); + const bot = store.createBot(); + store.beginRun(bot.id); + + const reloaded = new Store(selection); + expect(reloaded.bot(bot.id)?.activeRun).toBeUndefined(); + const persisted = JSON.parse(readFileSync(join(DATA_DIR, "bots.json"), "utf8")); + expect(persisted.find((record: BotRecord) => record.id === bot.id)).not.toHaveProperty("activeRun"); + }); + it("seedIfEmpty creates exactly one starter bot, once", () => { const store = new Store(selection); store.seedIfEmpty(); diff --git a/server/store.ts b/server/store.ts index df224335e6b..cc2670a37bd 100644 --- a/server/store.ts +++ b/server/store.ts @@ -6,6 +6,7 @@ import { readFileSync, writeFileSync, mkdirSync, unlinkSync } from "node:fs"; import { join } from "node:path"; import { DATA_DIR } from "./config.ts"; +import type { ContextStats } from "./context.ts"; import { newId, type ModelSelection, type ThreadId } from "./contracts.ts"; import { pickBotName } from "./names.ts"; @@ -103,9 +104,29 @@ export interface BotRecord { pinned?: boolean; hidden?: boolean; busy?: boolean; + /** Live + last-settled per-turn accounting. Provider-reported tokens are + * kept separate from the deterministic context estimate. */ + activeRun?: TaskUsage | null; + lastRun?: TaskUsage; createdAt: number; } +export interface TaskUsage { + startedAt: number; + completedAt?: number; + durationMs?: number; + ok?: boolean; + stopReason?: string | null; + modelCalls: number; + toolCalls: number; + computerActions: number; + reportedInputTokens: number; + reportedOutputTokens: number; + providerCost?: number | null; + /** Omitted for native provider sessions that did not receive transcript replay. */ + context?: ContextStats; +} + const BOTS_FILE = join(DATA_DIR, "bots.json"); const GROUPS_FILE = join(DATA_DIR, "groups.json"); const messagesFile = (threadId: string) => join(DATA_DIR, `messages-${threadId}.json`); @@ -175,8 +196,20 @@ export class Store { } catch { this.groups = []; } - // busy never survives a restart — no turn does either - for (const b of this.bots) b.busy = false; + // busy never survives a restart — no turn does either. Persist this + // normalization once so a later restart cannot rediscover stale state. + let normalized = false; + for (const b of this.bots) { + if (b.busy) normalized = true; + b.busy = false; + // A process restart cannot resume an in-flight provider turn. Preserve + // the last settled accounting, but never present a stale live run. + if ("activeRun" in b) { + delete b.activeRun; + normalized = true; + } + } + if (normalized) this.saveBots(); for (const g of this.groups) g.busyBotId = null; } @@ -431,6 +464,43 @@ export class Store { return bot; } + beginRun(botId: string, context?: ContextStats): BotRecord | null { + return this.patchBot(botId, { + activeRun: { + startedAt: Date.now(), + modelCalls: 1, + toolCalls: 0, + computerActions: 0, + reportedInputTokens: 0, + reportedOutputTokens: 0, + ...(context ? { context } : {}), + }, + }); + } + + updateActiveRun(botId: string, update: (run: TaskUsage) => TaskUsage): BotRecord | null { + const bot = this.bot(botId); + if (!bot?.activeRun) return bot; + return this.patchBot(botId, { activeRun: update(bot.activeRun) }); + } + + finishRun(botId: string, result: { ok: boolean; stopReason?: string | null; providerCost?: number | null }): BotRecord | null { + const bot = this.bot(botId); + if (!bot?.activeRun) return bot; + const completedAt = Date.now(); + const lastRun: TaskUsage = { + ...bot.activeRun, + completedAt, + durationMs: completedAt - bot.activeRun.startedAt, + ok: result.ok, + stopReason: result.stopReason ?? null, + providerCost: result.providerCost ?? null, + }; + // `null`, rather than `undefined`, survives JSON/SSE so the renderer can + // clear a previously displayed live run instead of retaining stale state. + return this.patchBot(botId, { activeRun: null, lastRun }); + } + setResumeCursor(botId: string, instanceId: string, cursor: unknown) { const bot = this.bot(botId); if (!bot) return; diff --git a/src/components/ChatView.tsx b/src/components/ChatView.tsx index 4d9d019cdb1..12f8c4067e6 100644 --- a/src/components/ChatView.tsx +++ b/src/components/ChatView.tsx @@ -8,6 +8,7 @@ import { ChevronLeft, ChevronRight, Copy, + Gauge, Loader2, Monitor, Pencil, @@ -15,7 +16,7 @@ import { Square, X, } from "lucide-react"; -import { useStore, useStreaming, formatTime, messageVersions, visibleMessages, type Bot, type Message } from "@/state/store"; +import { useStore, useStreaming, formatTime, messageVersions, visibleMessages, type Bot, type Message, type TaskUsage } from "@/state/store"; import { MausAvatar } from "./Avatar"; import { stateForBot } from "@/lib/mascot"; import { ChatMarkdown } from "./ChatMarkdown"; @@ -524,6 +525,34 @@ const MessagesList = memo(function MessagesList({ ); }); +function formatTokens(value: number) { + return value >= 1000 ? `${(value / 1000).toFixed(value >= 10_000 ? 0 : 1)}k` : String(value); +} + +/** Compact, honest accounting: provider tokens stay distinct from our context estimate. */ +function UsageStrip({ run, active }: { run?: TaskUsage; active: boolean }) { + if (!run) return null; + const saved = run.context ? run.context.originalEstimatedTokens - run.context.submittedEstimatedTokens : 0; + const detail = [ + `Model calls: ${run.modelCalls}`, + `Tool calls: ${run.toolCalls}`, + `Computer actions: ${run.computerActions}`, + `Provider-reported tokens: ${formatTokens(run.reportedInputTokens)} in / ${formatTokens(run.reportedOutputTokens)} out`, + run.context ? `Context estimate: ${formatTokens(run.context.originalEstimatedTokens)} → ${formatTokens(run.context.submittedEstimatedTokens)} tokens` : "", + run.durationMs !== undefined ? `Duration: ${(run.durationMs / 1000).toFixed(1)}s` : "", + run.providerCost !== null && run.providerCost !== undefined ? `Provider-reported cost: $${run.providerCost.toFixed(4)}` : "", + ].filter(Boolean).join("\n"); + return ( + + + {active ? "Working" : "Last"} + · {formatTokens(run.reportedInputTokens + run.reportedOutputTokens)} tokens + {run.toolCalls > 0 && · {run.toolCalls} tools} + {saved > 0 && · −{formatTokens(saved)} ctx} + + ); +} + export function ChatView({ bot }: { bot: Bot }) { const { state, dispatch } = useStore(); const scrollRef = useRef(null); @@ -638,6 +667,7 @@ export function ChatView({ bot }: { bot: Bot }) { Stop )} +