Skip to content
Open
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 @@ -49,6 +49,7 @@ All notable changes to **omp-web** (`@kahme247/ompweb`) are documented in this f

### Fixes & Improvements

- **A queued message no longer flashes in the chat before it becomes a queue chip.** A follow-up or steer sent during a run stays out of the chat for up to one second while omp takes it; if omp has not queued it by then, it appears in the chat with its delivery status. A message the host is offline for, or that failed, shows at once, and **Send** (an idle prompt) still shows instantly.
- **Sorting, pinning and reordering work in the cluster's sidebar group.** The group listed the cluster's shared projects first whatever the sort, and Move up/down, drag and pins only worked among projects of the same machine, so a pinned or alphabetically earlier project of a member could not move above a shared one. The group is now one list: the chosen sort, pins and manual order apply across shared projects and every member's own projects.
- **Cluster members install plugins from the source this machine installed them from.** A plugin installed here from Git (`github:…`, `git+…`) or a tarball URL is installed the same way on each member instead of as an unrelated npm package of the same name and version, and a member that already has that npm package replaces it. A plugin linked or installed from a local folder here is not installed on members; Settings → Hosts shows the member as failed and names the plugin to install there by hand. A source that installs a different version than this machine runs (an unpinned Git branch, for example) also shows the member as failed, with both versions. Credentials in a source never appear in the host daemon log.
- **Resuming an idle session no longer fails while omp is still starting.** omp can take more than five seconds to answer its first commands after a cold start (model refresh, plugin updates, hooks). The startup handshake now allows 30 seconds, so a message sent to an idle session is no longer marked **Not sent** with `RPC command get_state timed out after 5000ms`. Status polls of a running session keep their five-second limit.
Expand Down
4 changes: 2 additions & 2 deletions components/ChatWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ export function ChatWindow({ session, newSessionCwd, newSessionHostId, newSessio
sessionIdRef, messagesEndRef, scrollContainerRef, holdScrollPosition,
handleSend, handleAbort, handleFork, handleEdit, handleModelChange, retrySession,
handleSteer, handleFollowUp, handleAbortCompaction, handleCompact,
heldMessages, deleteHeldMessage,
heldMessages, deleteHeldMessage, followHeldMessages,
removeQueuedMessage, promoteQueuedToSteer,
handleBuiltinSlashCommand, togglePreCompactionHistory,
handleThinkingLevelChange, handleFastModeChange, handleSlowModeChange, handleCycleModel, handleCycleThinkingLevel, handleAbortRetry, loadSlashCommands,
Expand Down Expand Up @@ -1340,7 +1340,7 @@ export function ChatWindow({ session, newSessionCwd, newSessionHostId, newSessio

{/* After the live turn, in submission order: what omp does not have yet. */}
{heldMessages.map((held) => (
<HeldMessageView key={held.id} held={held} hostLabel={hostLabel} onDelete={deleteHeldMessage} />
<HeldMessageView key={held.id} held={held} hostLabel={hostLabel} onDelete={deleteHeldMessage} onReveal={followHeldMessages} />
))}

<div ref={messagesEndRef} />
Expand Down
29 changes: 29 additions & 0 deletions components/MessageView.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,35 @@ test("Delete confirmation never claims omp has not seen a message that may have
}
});

test("a queued message on its way stays hidden for a second; known-unqueued ones and prompts show at once", (t) => {
const base = { id: "held", message: "Queued text.", createdAt: Date.now(), local: true };
const shown = (held) => {
const view = render(React.createElement(HeldMessageView, { held }));
const count = view.container.querySelectorAll("[data-held-message]").length;
view.unmount();
return count;
};
for (const mode of ["followUp", "steer"]) {
for (const state of ["sending", "held", "delivering"]) assert.equal(shown({ ...base, mode, state }), 0, `${mode} ${state}`);
for (const state of ["failed", "waiting_host"]) assert.equal(shown({ ...base, mode, state }), 1, `${mode} ${state}`);
}
assert.equal(shown({ ...base, mode: "prompt", state: "sending" }), 1);
t.mock.timers.enable({ apis: ["setTimeout"] });
let reveals = 0;
const props = { held: { ...base, mode: "followUp", state: "sending" }, onReveal: () => { reveals += 1; } };
const view = render(React.createElement(HeldMessageView, props));
const count = () => view.container.querySelectorAll("[data-held-message]").length;
act(() => t.mock.timers.tick(999));
assert.equal(count(), 0);
act(() => view.rerender(React.createElement(HeldMessageView, { ...props, held: { ...props.held, state: "delivering" } })));
act(() => t.mock.timers.tick(1));
assert.equal(count(), 1, "the timer survives state changes along the way");
assert.equal(reveals, 1, "the chat is told so it can follow the late bubble");
act(() => view.rerender(React.createElement(HeldMessageView, { ...props, held: { ...props.held, state: "held" } })));
assert.equal(count(), 1, "a shown bubble stays shown");
view.unmount();
});

test("sent messages without timestamps or branch metadata still offer copy", () => {
const html = renderToStaticMarkup(React.createElement(MessageView, {
message: { role: "user", content: "Keep this message copyable." },
Expand Down
19 changes: 18 additions & 1 deletion components/MessageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -530,15 +530,32 @@ const heldActionStyle = {
fontSize: 11, whiteSpace: "nowrap",
} as const;

/** How long a queued (follow-up or steer) held message stays hidden: omp's queue chip usually replaces it sooner. */
const QUEUED_HELD_REVEAL_MS = 1000;

/** A message omp-web holds until omp has it (docs/specs/2026-11-04-message-outbox-design.md O1): dimmed, after the
* live turn, naming the leg it waits on. Delete only while nothing of it can have reached omp. */
export function HeldMessageView({ held, hostLabel, onDelete }: {
export function HeldMessageView({ held, hostLabel, onDelete, onReveal }: {
held: HeldMessage;
hostLabel?: string;
onDelete?: (id: string) => void;
/** Called when a bubble that started hidden appears, so the chat can follow it. */
onReveal?: () => void;
}) {
const { t, locale } = useI18n();
const [confirmingDelete, setConfirmingDelete] = useState(false);
// A queued message that is on its way would flash here before becoming omp's queue chip; one known not to be queued
// (failed, host offline) shows at once, and an idle prompt always does. Once shown, it stays shown.
const deferred = held.mode !== "prompt" && held.state !== "failed" && held.state !== "waiting_host";
const [revealed, setRevealed] = useState(!deferred);
useEffect(() => {
if (revealed) return;
const reveal = () => { setRevealed(true); onReveal?.(); };
if (!deferred) return reveal();
const timer = setTimeout(reveal, QUEUED_HELD_REVEAL_MS);
return () => clearTimeout(timer);
}, [revealed, deferred, onReveal]);
if (!revealed && deferred) return null;
const failed = held.state === "failed";
const status = failed
? held.mayHaveBeenSent ? t("heldMessage.mayHaveBeenSent") : held.error ? t("heldMessage.notSentReason", { reason: held.error }) : t("heldMessage.notSent")
Expand Down
4 changes: 3 additions & 1 deletion hooks/useAgentSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4456,6 +4456,8 @@ export function useAgentSession(opts: UseAgentSessionOptions) {
const handleSteer = useCallback((message: string, images?: AttachedImage[], uploads?: string[], uploadProofs?: Record<string, string>) => handleQueued("steer", message, images, uploads, uploadProofs), [handleQueued]);
const handleFollowUp = useCallback((message: string, images?: AttachedImage[], uploads?: string[], uploadProofs?: Record<string, string>) => handleQueued("followUp", message, images, uploads, uploadProofs), [handleQueued]);

// A held bubble that appears late (HeldMessageView's reveal delay) re-runs the follow-scroll effect.
const followHeldMessages = useCallback(() => setHeldFollow((n) => n + 1), []);
const heldMessagesRef = useRef(heldMessages);
heldMessagesRef.current = heldMessages;
const localOutboxRef = useRef(localOutbox);
Expand Down Expand Up @@ -4961,7 +4963,7 @@ export function useAgentSession(opts: UseAgentSessionOptions) {
handleSend, handleAbort, handleFork, handleEdit, handleModelChange, handleFastModeChange, handleSlowModeChange, handleAutoRetryChange, handleInterruptModeChange, handleAutoCompactionChange, handleSteeringModeChange, handleFollowUpModeChange, handleCycleModel, handleCycleThinkingLevel, handleAbortRetry, handleInterruptAndReply, setSkillStartupDiagnostics,
retrySession: () => { const sid = sessionIdRef.current; if (sid) void loadSession(sid, true, true); },
handleCompact, handleHandoff, handleSteer, handleFollowUp, handleAbortCompaction,
heldMessages, deleteHeldMessage,
heldMessages, deleteHeldMessage, followHeldMessages,
handleBuiltinSlashCommand, togglePreCompactionHistory,
handleToolPresetChange, handleThinkingLevelChange, loadSlashCommands, removeQueuedMessage, promoteQueuedToSteer, setActiveLeafId, setData, setMessages,
dispatch, setAgentRunning, setForkingEntryId,
Expand Down
Loading