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
13 changes: 13 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,16 @@ wait for that commit:
finished turn. `AppShell` must pass `hideToolActivity` into `ChatWindow` for
the switch to do anything. The fold row is the expand affordance, so a hidden
tool call is one click away rather than gone.
- Two more UI switches shape the fold, both planned in
`planTurnSegments` (`lib/chat-transcript-plan.ts`): `showThinking`
(driven by "Expand thinking blocks by default") and `showToolCalls` ("Show
tool calls outside Process details", `omp-web:show-tool-calls-unfolded`)
treat those blocks like text, so they never fold. A text segment can
therefore carry thinking, and `ChatWindow` passes its `sourceBlockIndices`
so deferred thinking loads the right block. "Never fold tool activity"
(`omp-web:never-fold-activity`, planner option `neverFold`) plans every turn
as standalone message rows, so the render window still counts messages and a
long turn never mounts at once; it overrides "Hide tool activity while working".
- `tool_execution_update` is coalesced per tool call at display rate in
`lib/message-update-coalescer.ts` (chatty commands emit ~10-100+ frames/s),
like `message_update` (which carries omp deltas, see "Streaming message
Expand All @@ -625,6 +635,9 @@ wait for that commit:
- Auto-expanded historical blocks are `deferred` (thinking text is fetched on
demand), so a mount effect loads their content through the same loader the
click path uses — one request per mount, cached per (session, entry, block).
- While the preference is on, thinking never folds into **Process details**:
a streamed block mounts expanded, and folding it when the step commits would
hide it in a closed row, which reads as the block collapsing on its own.

### Tool-result images (`lib/media-cache.ts`, `/api/media/[hash]`)
- Tool-result images never reach the browser as base64. History (`deferMedia`)
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ All notable changes to **omp-web** (`@kahme247/ompweb`) are documented in this f
- **Attach any file to a message, up to 2 GiB each.** The composer no longer refuses archives, PDFs or other binary files, and images are no longer capped at 5 MB per message. A file that cannot go inline is uploaded to the session's `local://` directory (`local/uploads/`) on the machine the session runs on, and the message tells the agent its `local://` URL and absolute path. Each image has an **Inline / As file** switch: Inline sends it with the message as before (omp resizes it for the model), As file keeps the exact bytes. An image too large to go inline switches to As file by itself. Uploads stream in chunks over the browser connection (or over HTTP in SSE mode) and on to the host, and show progress on each chip; Send waits until they finish. Over the browser's WebSocket connection, an upload resumes by itself after that connection drops or the web server restarts; in SSE mode, when the server loses the host's link, or when an upload makes no progress for 2 minutes, the chip shows an error and its **Retry** continues from what the host already has. Update ompweb on the server first, then on its hosts: a host on an older build shows "Update ompweb on the session's host to attach files" when a file is attached. After an in-place upgrade, "This machine" takes uploads only once the ompweb host service (`ompweb-host`) is restarted, and the chip says so; restarting it ends the runs on this machine.
- **Keep a host running with the single binary.** The README's "Keep a host running as a service" section has a systemd user unit (Linux), a logon scheduled task (Windows) and, for macOS, a restart script to run in tmux: launchd jobs cannot use the login keychain and SSH agent that omp sessions need. In tmux, macOS Local Network privacy blocks the daemon from LAN addresses, so link it to a URL that does not resolve to one (the server's public URL, or a VPN or tailnet name).
- **Session search shows where each session matched.** While searching the sidebar, the arrow beside a session lists its matches one per line, best match first and newest first among equals, ten at a time with **Load more…**. Matches in the messages of the open conversation are highlighted, typos and partial words included (thinking, tool output and math are not searched; link addresses and image descriptions do not count), and clicking a match opens its session, scrolls to it and marks it as the current one, like the browser's find. Closing or clearing the search removes the highlights. Browsers without the CSS Custom Highlight API (before Chrome 105, Safari 17.2 or Firefox 140) still jump to the match but do not paint it.
- **Show tool calls outside Process details.** A new setting keeps each tool call's row in the transcript instead of folding it; whether the row opens still follows "Keep tool calls collapsed".
- **Never fold tool activity.** A new setting renders every turn flat, with no Process details rows at all. Long turns are paged, and jumping to a search match reveals its message even outside the current page.

### Fixes & Improvements

Expand All @@ -32,6 +34,7 @@ All notable changes to **omp-web** (`@kahme247/ompweb`) are documented in this f
- Browsers older than Safari 16.2 or Chrome 111 lose the colours ompweb mixes with `color-mix()` (tints, borders and focus rings), which no longer carry a solid fallback. Those browsers were outside the Next.js build's targets too.
- **The service installers set up the host daemon too.** `ompweb systemd install`, `ompweb-launchd install` and the Windows tray install now register `ompweb host` as a second unit (`ompweb-host`) next to the web service, restarting it after a 10 s delay so it can wait for the web server to write its host link on first install. `uninstall` and `status` cover both, and the tray menus show the daemon state.
- **Forking a session or editing a message asks first.** The Fork button under a message and the Edit button under your own message now open a confirmation dialog, so a stray tap while scrolling no longer creates a new session or rewinds the current one.
- **Expanded thinking blocks no longer collapse when a step finishes.** With "Expand thinking blocks by default" on, a thinking block opened while streaming, then moved into a closed Process details row as soon as the step committed. Thinking now stays out of the fold while the setting is on.
- **In-app updates work when ompweb runs as a systemd service.** The update worker ran inside the service's cgroup, so stopping the server killed the worker too: nothing was installed, the service could stay down (`Restart=on-failure` does not restart a clean SIGTERM exit), and every page load reopened the update dialog at "Stop ompweb-managed sessions". The worker now runs in its own transient scope (`systemd-run --scope`) and stops, updates and starts the unit through `systemctl`, starting it again if the install fails.
- **An update whose worker died is reported as failed.** A running update whose worker process is gone, or whose lease has expired, now becomes a failed attempt the dialog can show and clean up, instead of waiting forever.
- **Upgrade ompweb before its hosts.** The web server links a host daemon one link protocol version older than its own, so a host keeps running sessions until its `ompweb` is updated. After a web restart the server adopts that daemon's live runs, as it does a current daemon's, without resuming them; only a large message from such a host still arrives whole instead of in pieces, which can stall that host's link on a slow connection. A daemon older than that, or newer than the web server, is still asked to upgrade.
Expand Down
28 changes: 28 additions & 0 deletions components/AppShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@

const TOOL_CALLS_COLLAPSED_STORAGE_KEY = "omp-web:tool-calls-collapsed";
const HIDE_TOOL_ACTIVITY_STORAGE_KEY = "omp-web:hide-tool-activity";
const NEVER_FOLD_ACTIVITY_STORAGE_KEY = "omp-web:never-fold-activity";
const SHOW_TOOL_CALLS_UNFOLDED_STORAGE_KEY = "omp-web:show-tool-calls-unfolded";
// Off by default, so the transcript keeps collapsing reasoning until asked.
const EXPAND_THINKING_STORAGE_KEY = "omp-web:expand-thinking";
const PROVIDER_USAGE_VISIBLE_STORAGE_KEY = "omp-web:provider-usage-visible";
Expand Down Expand Up @@ -157,6 +159,8 @@
const [sidebarWidth, setSidebarWidth] = useState<number>(SIDEBAR_DEFAULT_WIDTH);
const [toolCallsDefaultCollapsed, setToolCallsDefaultCollapsed] = useState(true);
const [hideToolActivity, setHideToolActivity] = useState(true);
const [neverFoldActivity, setNeverFoldActivity] = useState(false);
const [showToolCallsUnfolded, setShowToolCallsUnfolded] = useState(false);
// "Expand thinking blocks by default" — like the tool-call preference, a
// UI-only behavior, so it lives in localStorage rather than omp's config.
const [expandThinkingByDefault, setExpandThinkingByDefault] = useState(false);
Expand Down Expand Up @@ -191,6 +195,8 @@
try {
setToolCallsDefaultCollapsed(window.localStorage.getItem(TOOL_CALLS_COLLAPSED_STORAGE_KEY) !== "false");
setHideToolActivity(window.localStorage.getItem(HIDE_TOOL_ACTIVITY_STORAGE_KEY) !== "false");
setNeverFoldActivity(window.localStorage.getItem(NEVER_FOLD_ACTIVITY_STORAGE_KEY) === "true");
setShowToolCallsUnfolded(window.localStorage.getItem(SHOW_TOOL_CALLS_UNFOLDED_STORAGE_KEY) === "true");
setExpandThinkingByDefault(window.localStorage.getItem(EXPAND_THINKING_STORAGE_KEY) === "true");
setProviderUsageVisible(window.localStorage.getItem(PROVIDER_USAGE_VISIBLE_STORAGE_KEY) !== "false");
setScopeNativeSelectAll(window.localStorage.getItem(NATIVE_SELECT_ALL_STORAGE_KEY) === "true");
Expand All @@ -215,6 +221,22 @@
// The preference still applies for this page load.
}
}, []);
const handleNeverFoldActivityChange = useCallback((never: boolean) => {
setNeverFoldActivity(never);
try {
window.localStorage.setItem(NEVER_FOLD_ACTIVITY_STORAGE_KEY, String(never));
} catch {
// The preference still applies for this page load.
}
}, []);
const handleShowToolCallsUnfoldedChange = useCallback((show: boolean) => {
setShowToolCallsUnfolded(show);
try {
window.localStorage.setItem(SHOW_TOOL_CALLS_UNFOLDED_STORAGE_KEY, String(show));
} catch {
// The preference still applies for this page load.
}
}, []);
const handleExpandThinkingByDefaultChange = useCallback((expand: boolean) => {
setExpandThinkingByDefault(expand);
try {
Expand Down Expand Up @@ -341,7 +363,7 @@
if (container && active instanceof HTMLElement && container.contains(active)) {
active.blur();
}
}, [sidebarOpen, mobileSidebarReady]);

Check warning on line 366 in components/AppShell.tsx

View workflow job for this annotation

GitHub Actions / Verify (ubuntu-latest)

React Hook useLayoutEffect has a missing dependency: 'sidebarContainerRef'. Either include it or remove the dependency array

Check warning on line 366 in components/AppShell.tsx

View workflow job for this annotation

GitHub Actions / Verify (windows-latest)

React Hook useLayoutEffect has a missing dependency: 'sidebarContainerRef'. Either include it or remove the dependency array
useEffect(() => {
const controller = new AbortController();
void fetch("/api/omp-update", {
Expand Down Expand Up @@ -857,7 +879,7 @@
sidebarResizeHandlersRef.current = { onMove, onUp };
window.addEventListener("mousemove", onMove);
window.addEventListener("mouseup", onUp);
}, [isMobile, sidebarWidth]);

Check warning on line 882 in components/AppShell.tsx

View workflow job for this annotation

GitHub Actions / Verify (ubuntu-latest)

React Hook useCallback has a missing dependency: 'sidebarContainerRef'. Either include it or remove the dependency array

Check warning on line 882 in components/AppShell.tsx

View workflow job for this annotation

GitHub Actions / Verify (windows-latest)

React Hook useCallback has a missing dependency: 'sidebarContainerRef'. Either include it or remove the dependency array

// If the app unmounts mid-drag, remove the window listeners and restore the
// body cursor; otherwise the handlers leak and body stays cursor:col-resize.
Expand All @@ -874,7 +896,7 @@
const resetRightPanelWidth = useCallback(() => {
rightPanelRef.current?.style.removeProperty("--right-panel-width");
setRightPanelWidth(null);
}, []);

Check warning on line 899 in components/AppShell.tsx

View workflow job for this annotation

GitHub Actions / Verify (ubuntu-latest)

React Hook useCallback has a missing dependency: 'rightPanelRef'. Either include it or remove the dependency array

Check warning on line 899 in components/AppShell.tsx

View workflow job for this annotation

GitHub Actions / Verify (windows-latest)

React Hook useCallback has a missing dependency: 'rightPanelRef'. Either include it or remove the dependency array

const changeRightPanelWidth = useCallback((delta: number) => {
setRightPanelWidth((prev) => {
Expand All @@ -885,7 +907,7 @@
rightPanelRef.current?.style.setProperty("--right-panel-width", `${next}px`);
return next;
});
}, []);

Check warning on line 910 in components/AppShell.tsx

View workflow job for this annotation

GitHub Actions / Verify (ubuntu-latest)

React Hook useCallback has a missing dependency: 'rightPanelRef'. Either include it or remove the dependency array

Check warning on line 910 in components/AppShell.tsx

View workflow job for this annotation

GitHub Actions / Verify (windows-latest)

React Hook useCallback has a missing dependency: 'rightPanelRef'. Either include it or remove the dependency array

const handleRightPanelResizeKey = useCallback((e: React.KeyboardEvent) => {
// The handle sits on the panel's left edge: left widens, right narrows.
Expand Down Expand Up @@ -946,7 +968,7 @@
rightResizeHandlersRef.current = { onMove, onUp };
window.addEventListener("mousemove", onMove);
window.addEventListener("mouseup", onUp);
}, [isMobile]);

Check warning on line 971 in components/AppShell.tsx

View workflow job for this annotation

GitHub Actions / Verify (ubuntu-latest)

React Hook useCallback has a missing dependency: 'rightPanelRef'. Either include it or remove the dependency array

Check warning on line 971 in components/AppShell.tsx

View workflow job for this annotation

GitHub Actions / Verify (windows-latest)

React Hook useCallback has a missing dependency: 'rightPanelRef'. Either include it or remove the dependency array

// If the app unmounts mid-drag, remove the window listeners and restore the
// body cursor; otherwise the handlers leak and body stays cursor:col-resize.
Expand Down Expand Up @@ -2051,6 +2073,10 @@
onToolCallsDefaultCollapsedChange={handleToolCallsDefaultCollapsedChange}
hideToolActivity={hideToolActivity}
onHideToolActivityChange={handleHideToolActivityChange}
neverFoldActivity={neverFoldActivity}
onNeverFoldActivityChange={handleNeverFoldActivityChange}
showToolCallsUnfolded={showToolCallsUnfolded}
onShowToolCallsUnfoldedChange={handleShowToolCallsUnfoldedChange}
expandThinkingByDefault={expandThinkingByDefault}
onExpandThinkingByDefaultChange={handleExpandThinkingByDefaultChange}
onHideThinkingBlockChange={setHideThinkingBlock}
Expand Down Expand Up @@ -2594,6 +2620,8 @@
onOpenProviders={() => setSettingsTab("providers")}
toolCallsDefaultCollapsed={toolCallsDefaultCollapsed}
hideToolActivity={hideToolActivity}
neverFoldActivity={neverFoldActivity}
showToolCallsUnfolded={showToolCallsUnfolded}
expandThinkingByDefault={expandThinkingByDefault}
hideThinkingBlock={hideThinkingBlock}
searchQuery={chatSearchQuery}
Expand Down
Loading
Loading