Repository navigation
Conversation
A running session paused on a dialog the user must answer (ask tool, select/confirm/input/editor, "Allow tool" prompts) now carries `awaitingInput` + `awaitingInputMethod` in each `runningSessions` entry of /api/sessions and the `running` channel. The sidebar shows an amber "Waiting for your answer" bubble instead of the spinner, and the project activity summary counts the session as waiting rather than running. Only DIALOG_UI_METHODS count; open_url stays a replayed blocking request but is fire-and-forget per omp's RPC docs. Answering a dialog and its expiry timer now broadcast a running-change, alongside the existing omp cancel, process exit, destroy and restart paths.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 10 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything. 📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are. Files Reviewed (15 files)
Reviewed by free · Input: 54.6K · Output: 10K · Cached: 1.9M |
|
The Bun server/daemon architecture has landed on |
andrebrait
left a comment
There was a problem hiding this comment.
Thank you for distinguishing sessions blocked on a user answer from sessions doing work. Maintainer triage at d408600406352392b27b74dbe4140d9d42ee6ef6: this is a useful feature with a sound narrow dialog list, existing running-channel reuse and sensible activity accounting.
The three targeted files passed on the PR head under the node runner (148 passes, one skip). Removing the answer-path broadcast, including open_url as a dialog or double-counting waiting as running each failed relevant regressions.
Please rebase onto the current host-aware sidebar and daemon lifecycle. Preserve hostId on RunningRpcSession, add waiting counts to foldedHostProjectKey grouping, retain HostGroup/LivePlace rendering and put settlement broadcasts after main's serverUiRequests/sendFrame handling. Resolving the type conflict by dropping hostId would misgroup remote placeholders.
Also cover resync/replay expiry: main can clear pending dialogs before get_state reconciliation; if that read fails, a waiting flag needs a clearing broadcast rather than remaining stale. Removing replay-time expiry broadcast escaped the targeted tests, unlike timer expiry. That resync concern is code-traced, not a live-daemon reproduction.
Coordinate the answerable DIALOG_UI_METHODS with #414/#417 rather than duplicate the list, preserving your attribution. No full suite, CI, current-main build or real-browser/daemon run was performed. This is a good candidate to progress after the rebase, not formal merge approval. CI authorization was accepted.
A blocking dialog that stays unanswered is repeated on the device's own notification, with a per-device toggle in the notifications settings. Only `select`/`confirm`/`input`/`editor`/`ask` are armed: `open_url` has no answer, so `DIALOG_UI_METHODS` (introduced by ompweb-dev#319) is reused instead of `BLOCKING_UI_METHODS`. The timer is released with the pending state, so every settlement path (answer from the desktop or a notification, omp's cancel, expiry, replay-time expiry, restart, destroy) stops it instead of leaving it to fire once more; the cap bounds a dialog nobody answers. The notifier election is rechecked on every fire, so a former notifier falls silent once another web server takes the host's notifications. A repeat states an elapsed duration ("2 hours") rather than a server-timezone clock time, which a device in another timezone cannot read.
A blocking dialog that stays unanswered is repeated on the device's own notification, with a per-device toggle in the notifications settings. Only `select`/`confirm`/`input`/`editor`/`ask` are armed: `open_url` has no answer, so `DIALOG_UI_METHODS` (introduced by ompweb-dev#319) is reused instead of `BLOCKING_UI_METHODS`. The timer is released with the pending state, so every settlement path (answer from the desktop or a notification, omp's cancel, expiry, replay-time expiry, restart, destroy) stops it instead of leaving it to fire once more; the cap bounds a dialog nobody answers. The notifier election is rechecked on every fire, so a former notifier falls silent once another web server takes the host's notifications. A repeat states an elapsed duration ("2 hours") rather than a server-timezone clock time, which a device in another timezone cannot read.
|
Thanks for the review. #461 has since landed the maintainer's version of this feature, so I'm closing this rather than rebasing a second design over it. Checking your resync/replay concern against main: both paths already clear the mark through |
Why
An agent often stops mid-turn to ask the user something — omp's
asktool, a select/confirm/input/editor dialog, or an "Allow tool" approval — and the turn waits for the answer. In the sidebar such a session shows the same spinner as one that is working, so with several sessions running there is no way to see which ones are blocked on you without opening each of them.What Changed
MessageCircleQuestionMark,--status-warning) with tooltip and aria-label Waiting for your answer instead of the running spinner. Its workspace row counts it as waiting rather than running ("N waiting for your answer"; the summary reads "{running} running, {waiting} waiting for your answer, …").select,confirm,input,editorandask— the dialog methods that need anextension_ui_responseper omp's RPC "Extension UI Sub-Protocol", and exactly the onesuseAgentSession.handleExtensionUiRequestopens a dialog for. Tool approvals arrive asconfirm, so they are included; when approvals are auto-allowed the server answers them before tracking, so they never show as waiting.open_urland the presentation methods (notify,setStatus,setWidget,setTitle,set_editor_text) are fire-and-forget and do not count. These live inDIALOG_UI_METHODS(lib/notification-events.ts);BLOCKING_UI_METHODSis now that list plusopen_url, so notifications are unchanged.getRunningRpcSessions()addsawaitingInput: trueandawaitingInputMethod(the oldest pending dialog's method) to eachrunningSessionsentry ofGET /api/sessions. Existing fields are unchanged.RunningRpcSessionmoved fromlib/rpc-manager.tstolib/types.tsso the client and server share it.lib/project-ordering.tsper-project activity gains awaitingcount. en / zh-CN / ja strings,CHANGELOG.md, and a note inAGENTS.mdunder "Running state + reconciliation".Verification
lib/rpc-manager.test.mjs(9 new cases): each dialog method sets the state and an answer clears it; fire-and-forget methods andopen_urlnever set it; a cancel from omp, a timeout (mock timers) and process exit clear it; every transition broadcasts.lib/project-ordering.test.mjs: waiting counted separately from running. Newcomponents/SessionSidebar.awaiting-input.test.mjs(4 cases): the waiting indicator replaces the spinner, the workspace count and summary.tsc --noEmitis clean;eslintreports 0 errors (the 10 existing warnings are elsewhere).npm test: 1724 tests, 1708 pass, 0 fail, 16 skipped (OMP_WEB_DISABLE_AUTOUPDATEunset; when set, the fix(update): finish in-app updates under systemd and fail attempts whose worker died #306 self-update tests fail regardless of this change).ask:/api/sessionsreturnedawaitingInput: true, awaitingInputMethod: "ask"; the session row and the workspace badge showed the bubble, with no spinner, and the summary read "0 running, 1 waiting for your answer, …";Found while testing, not changed here
open_urlis inBLOCKING_UI_METHODS, so the session wrapper keeps it pending until omp cancels it or the process ends. omp never cancels a fire-and-forget request and the client never answers it, so anopen_urlreaching a session keeps it counted as running indefinitely (no idle cleanup; it also blocks title generation and history edits), and its "waiting for your answer" notification is misleading.Screenshots
A session paused on an
askdialog ("Red or blue?"), throwaway workspace.