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 @@ -77,6 +77,7 @@ All notable changes to **omp-web** (`@kahme247/ompweb`) are documented in this f
- **Sending a command detects a silently broken browser connection sooner.** Queued messages and steers initially reconnect after 5–6 seconds without delivery-acknowledgement progress, rather than waiting for the 30-second silence check. This also detects a dead uplink while replies still stream down. Recovery uses the existing ordered replay and deduplication; slow command results do not trigger retries. Repeated delivery stalls increase the deadline up to 30 seconds for slow links. Server restarts and expired replay windows retain the existing explicit "may have run" error rather than risking duplicate actions.
- **An open chat now picks up a run that started after it loaded.** When a run started from another tab or device, or from the same chat opened again while its message was still starting omp, the sidebar showed the session running but the chat stayed idle until a reload. The chat now attaches to the run as soon as the sidebar shows it.
Running updates received during a state check are retained, and compaction controls immediately reflect the attached run. Compaction started in another tab also releases its controls when it finishes while you are reading a historical branch, without replacing that branch. A late state check cannot take over a command this chat has started or bring back a shell command that has finished or been stopped. The chat waits for its first load before attaching, so the branch navigator never comes up empty, and it attaches once its own send, `!` command, Edit or compaction is done if a run started meanwhile; a failed check is retried. A compaction you start keeps its Stop control until it ends, even when the session's omp is still starting.
- **A finished compaction no longer reports "The agent stopped without returning a response".** When a chat caught up with a session that was only compacting (started from another tab, or while the chat was reconnecting), it treated the compaction as a prompt run, showed it as running, and reported an empty reply once the compaction ended. A compaction now shows only its own Stop compaction control; a compaction during a run still keeps that run going.
- **The dictation waveform no longer stays flat while you speak.** The meter's audio context was created only after the microphone opened; when that took longer than the click's activation window, the browser kept the context suspended and the bars showed silence even though the recording and transcription were fine. The context now starts inside the click.
- **Streaming replies use about a sixth of the bandwidth.** ompweb now asks omp (18.13.2 or later) for only what changed in a streaming reply instead of the whole reply several times a second, and the browser rebuilds the reply itself. In one measured reply the live stream fell from 232 KB to 91 KB, and the reply updates themselves from 178 KB to 30 KB, so replies keep up on slow mobile links. A tab opened mid-reply, a reconnect and a restarted server still show the whole reply. An older omp keeps sending whole replies and works as before.
- **The host link is now one WebSocket**, with fewer requests and large results sent in the same connection. A reverse proxy in front of ompweb must forward WebSocket upgrades on `/api/hosts/link` (see the README's hosts section). Update ompweb on the server first, then on its hosts: a host linked with an earlier build of this release shows **needs upgrade** until it is updated.
Expand Down
2 changes: 1 addition & 1 deletion graphify-out/graph.json

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions hooks/useAgentSession.rpc.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2031,6 +2031,29 @@ test("an idle chat reconciles auto-compaction when its completion event is lost"
assert.equal(w.latest.isCompacting, false, "the ref and rendered state share the same compaction lifecycle");
});

/** A catch-up snapshot of `sid` at `sequence` with no prompt running, only (maybe) a compaction. */
function compactionSnapshot(sid, sequence, isCompacting) {
return { cursor: { streamId: `stream-${sid}`, sequence }, isStreaming: false, isPromptRunning: false, isCompacting, streamingMessage: null, toolEvents: [] };
}

test("a compaction-only catch-up snapshot is not a prompt run and does not fail when it ends", async () => {
resetWorld();
toastCalls.length = 0;
const sid = "snapshot-compaction";
primeSession(sid, [userMsg("u0", "q")]);
world.agents.set(sid, { running: true, state: { isCompacting: true } });
world.live.set(sid, compactionSnapshot(sid, 0, true));
const w = await mountSession(sid);
await act(async () => { lastEs().open(); await settle(); });
assert.equal(w.latest.isCompacting, true);
assert.equal(w.latest.agentRunning, false, "a compaction runs no prompt");
world.agents.set(sid, { running: true, state: { isCompacting: false } });
world.live.set(sid, compactionSnapshot(sid, 1, false));
await act(async () => { window.dispatchEvent(new Event("online")); await settle(); });
assert.equal(w.latest.isCompacting, false);
assert.deepEqual(w.latest.notices.filter((notice) => notice.type === "error"), [], "a finished compaction is not an empty prompt reply");
});

test("matching running frames received during an idle lookup trigger one fresh lookup", async () => {
resetWorld();
primeSession("late-start", [userMsg("u0", "q")]);
Expand Down
9 changes: 6 additions & 3 deletions hooks/useAgentSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2879,9 +2879,12 @@ export function useAgentSession(opts: UseAgentSessionOptions) {
// Newer queued message/tool events belong to fields we will retain below.
// Flush rather than dropping them when another snapshot field is recoverable.
eventCoalescer.flush();
const busy = snapshot.isStreaming || snapshot.isPromptRunning || snapshot.isCompacting;
// A compaction keeps a running prompt alive (omp may compact mid-run), but alone it is no
// prompt run: nothing would end it with a reply, and settling it reported an empty response.
const promptBusy = snapshot.isStreaming || snapshot.isPromptRunning;
const busy = promptBusy || snapshot.isCompacting;
if (fields.lifecycle) {
if (busy && !agentRunningRef.current) {
if (promptBusy && !agentRunningRef.current) {
promptRunIdRef.current += 1;
runPreviousEntryIdsRef.current = dispatchBaselineRef.current ?? catchUp.history()?.entryIds ?? [];
dispatchBaselineRef.current = null;
Expand All @@ -2898,7 +2901,7 @@ export function useAgentSession(opts: UseAgentSessionOptions) {
if (!promptDispatchPendingRef.current && sessionIdRef.current) void reconcileAgentState(sessionIdRef.current);
return;
}
if (busy && !agentRunningRef.current) {
if (promptBusy && !agentRunningRef.current) {
agentRunningRef.current = true;
setAgentRunning(true);
}
Expand Down
Loading