Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ All notable changes to **omp-web** (`@kahme247/ompweb`) are documented in this f
- **Delivered messages leave every shared-server chat's pending list.** When another web-server process delivers a message from the shared outbox, open chats now receive its updated state and delivery confirmation without switching sessions or reloading. Startup retries resync existing chats, observer failures cannot interrupt delivery or other observers, and pending, failed and delivered messages retain their historical session identities through repeated native moves. Per-session revisions prevent unrelated database writes from resending unchanged chat payloads.
- **A pending message is replaced, never dropped.** With an OMP that reports `supportsClientMessageIds`, each message carries its outbox ID to OMP, and the pending row stays until that exact message, queue entry or explicit withdrawal appears in the chat, even when another server delivers it or its echo arrives late. If OMP no longer has any trace of it (its process ended, or `/new` ran while it was queued), the row turns into **Not sent: it may have been sent** and can be dismissed. An older OMP is sent messages as before and their rows clear on delivery.
- **Anthropic stays visible when usage limits are unavailable.** The Provider Usage panel keeps accounts that omp reports without usage data and marks them as unavailable rather than unlimited.
- **A reply that is still streaming looks live again.** The streaming reply was rendered as if it had finished, so its live header and tokens-per-second badge never appeared and its copy and read-aloud actions showed while omp was still writing. It is marked as streaming again; a finished reply held until its saved copy arrives still renders as finished.
- **A delayed archive restore cannot overwrite newer archived work.** Restore now pins the compressed source generation it staged and verifies an atomically captured archive entry before moving artifacts. If another server restored, updated and re-archived that session meanwhile, the stale restore is refused and the newer transcript and artifacts remain available. Captured archives remain discoverable by session ID before publication and after an interrupted restore, so held messages are not falsely failed as belonging to a missing session; orphaned restore claims report their manual-recovery path.
- **In-progress archive captures are evidence, not restore targets.** Captures have unique keys and disabled Restore controls, so a capture and a newer archive cannot select the wrong session. Archive discovery rechecks names and source generations after reading to avoid missing a capture during concurrent replacement; a capture encountered while pinning still reports its restore-claim recovery path.
- **Unreadable archive directories no longer look empty.** Access and disk I/O errors retain affected outbox messages instead of proving their session absent. A corrupt or unreadable local archive is reported as one unavailable host in the archive browser, without hiding healthy linked hosts.
Expand Down
48 changes: 48 additions & 0 deletions components/ChatWindow-live-tail.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import assert from "node:assert/strict";
import "../tests/setup-dom.mjs";
import test, { afterEach } from "node:test";
import React from "react";
const { cleanup, render } = await import("@testing-library/react/pure.js");

const { ChatLiveTail } = await import("./ChatWindow-live-tail.tsx");
afterEach(cleanup);

const reply = {
role: "assistant",
provider: "p",
model: "m",
timestamp: 1_700_000_000_000,
content: [{ type: "text", text: "Hello from the live reply" }],
};

function renderTail(isStreaming) {
return render(React.createElement(ChatLiveTail, {
streamingMessage: reply,
isStreaming,
liveTokensPerSecond: isStreaming ? 42 : undefined,
pendingToolHeaders: [],
deferredBash: [],
pendingBash: null,
toolResults: new Map(),
modelNames: {},
cwd: undefined,
sessionId: "s",
toolCallsDefaultCollapsed: true,
expandThinkingByDefault: false,
hideThinking: false,
}));
}

test("a reply omp is still generating renders as live: speed shown, finished-reply actions hidden", () => {
const { container } = renderTail(true);
assert.ok(container.querySelector('[data-live="true"]'), "the live reply is marked live");
assert.match(container.textContent, /42\.0 t\/s/);
assert.equal(container.querySelector(".message-assistant-footer"), null);
});

test("a finished reply held until its saved row appears renders as finished", () => {
const { container } = renderTail(false);
assert.equal(container.querySelector('[data-live="true"]'), null);
assert.doesNotMatch(container.textContent, /t\/s/);
assert.ok(container.querySelector(".message-assistant-footer"), "copy actions are available once the reply finished");
});
5 changes: 4 additions & 1 deletion components/ChatWindow-live-tail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { MessageView } from "./MessageView";
export interface ChatLiveTailProps {
/** The reply omp is streaming, also while held until its committed row replaces it. */
streamingMessage: Partial<AgentMessage> | null;
/** True while omp is still generating `streamingMessage`; false for a finished reply held until its saved row appears. */
isStreaming: boolean;
liveTokensPerSecond?: number | null;
/** Running tools no message renders yet, shown as status rows while tool calls are collapsed. */
pendingToolHeaders: { id: string; name: string }[];
Expand All @@ -27,7 +29,7 @@ export interface ChatLiveTailProps {

/** The running turn's live end after the committed transcript: streaming reply, pending tool rows, `!command` output. */
export function ChatLiveTail({
streamingMessage, liveTokensPerSecond, pendingToolHeaders, deferredBash, pendingBash, toolResults, modelNames, cwd, onOpenFile, sessionId,
streamingMessage, isStreaming, liveTokensPerSecond, pendingToolHeaders, deferredBash, pendingBash, toolResults, modelNames, cwd, onOpenFile, sessionId,
toolCallsDefaultCollapsed, expandThinkingByDefault, hideThinking,
}: ChatLiveTailProps) {
const { t } = useI18n();
Expand All @@ -39,6 +41,7 @@ export function ChatLiveTail({
<MessageView
key={streamingMessage.timestamp ?? "stream"}
message={streamingMessage as AgentMessage}
isStreaming={isStreaming}
modelNames={modelNames}
cwd={cwd}
onOpenFile={onOpenFile}
Expand Down
1 change: 1 addition & 0 deletions components/ChatWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,7 @@ export function ChatWindow({ session, newSessionCwd, newSessionHostId, hostStatu
/>
<ChatLiveTail
streamingMessage={streamState.streamingMessage}
isStreaming={streamState.isStreaming}
liveTokensPerSecond={streamState.isStreaming ? tokensPerSecond : undefined}
pendingToolHeaders={pendingToolHeaders}
deferredBash={deferredBash}
Expand Down
2 changes: 1 addition & 1 deletion graphify-out/graph.json

Large diffs are not rendered by default.

Loading