Skip to content

feat(sidebar): show sessions waiting for your answer - #319

Closed
OrwellVII wants to merge 1 commit into
ompweb-dev:mainfrom
OrwellVII:feat/sidebar-awaiting-input
Closed

OrwellVII wants to merge 1 commit into
ompweb-dev:mainfrom
OrwellVII:feat/sidebar-awaiting-input

Conversation

@OrwellVII

@OrwellVII OrwellVII commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Why

An agent often stops mid-turn to ask the user something — omp's ask tool, 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

  • Sidebar: a session with a pending dialog shows an amber question bubble (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, …").
  • Which requests count: select, confirm, input, editor and ask — the dialog methods that need an extension_ui_response per omp's RPC "Extension UI Sub-Protocol", and exactly the ones useAgentSession.handleExtensionUiRequest opens a dialog for. Tool approvals arrive as confirm, so they are included; when approvals are auto-allowed the server answers them before tracking, so they never show as waiting. open_url and the presentation methods (notify, setStatus, setWidget, setTitle, set_editor_text) are fire-and-forget and do not count. These live in DIALOG_UI_METHODS (lib/notification-events.ts); BLOCKING_UI_METHODS is now that list plus open_url, so notifications are unchanged.
  • Payload: getRunningRpcSessions() adds awaitingInput: true and awaitingInputMethod (the oldest pending dialog's method) to each runningSessions entry of GET /api/sessions. Existing fields are unchanged. RunningRpcSession moved from lib/rpc-manager.ts to lib/types.ts so the client and server share it.
  • Live updates: answering a dialog and a dialog timing out now broadcast a sessions-changed update (before, they cleared the request without telling the sidebar). A cancel from omp, process exit, destroy and restart already broadcast, so every open browser updates on each transition.
  • lib/project-ordering.ts per-project activity gains a waiting count. en / zh-CN / ja strings, CHANGELOG.md, and a note in AGENTS.md under "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 and open_url never 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. New components/SessionSidebar.awaiting-input.test.mjs (4 cases): the waiting indicator replaces the spinner, the workspace count and summary.
  • tsc --noEmit is clean; eslint reports 0 errors (the 10 existing warnings are elsewhere). npm test: 1724 tests, 1708 pass, 0 fail, 16 skipped (OMP_WEB_DISABLE_AUTOUPDATE unset; 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).
  • Manual run against a dev server on macOS with a real omp (v18.12.6), twice, in a throwaway workspace, with a prompt that makes the agent call ask:
    • while the question was pending, /api/sessions returned awaitingInput: 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, …";
    • the row switched from spinner to waiting about 5 s after the prompt, went back to the spinner about 260 ms after Submit, and became idle when the turn finished.

Found while testing, not changed here

  • open_url is in BLOCKING_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 an open_url reaching 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 ask dialog ("Red or blue?"), throwaway workspace.

Light Dark
Before (main): running spinner on the row, running dot on the workspace before light before dark
After: amber "Waiting for your answer" icon on the row and the workspace badge after light after dark

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.
Copilot AI balanced review requested due to automatic review settings October 28, 2026 10:36
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 75193794-3c91-4232-80bf-d695f7f25490
Commits

Reviewing files that changed from the base of the PR and between 1317bf3 and d408600.

Files selected for processing: 15
  • AGENTS.md
  • CHANGELOG.md
  • components/SessionSidebar-chrome.tsx
  • components/SessionSidebar-rows.tsx
  • components/SessionSidebar.awaiting-input.test.mjs
  • components/SessionSidebar.tsx
  • lib/i18n/locales/en.json
  • lib/i18n/locales/ja.json
  • lib/i18n/locales/zh-CN.json
  • lib/notification-events.ts
  • lib/project-ordering.test.mjs
  • lib/project-ordering.ts
  • lib/rpc-manager.test.mjs
  • lib/rpc-manager.ts
  • lib/types.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@kilo-code-bot

kilo-code-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

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)
  • AGENTS.md
  • CHANGELOG.md
  • components/SessionSidebar-chrome.tsx
  • components/SessionSidebar-rows.tsx
  • components/SessionSidebar.awaiting-input.test.mjs
  • components/SessionSidebar.tsx
  • lib/i18n/locales/en.json
  • lib/i18n/locales/ja.json
  • lib/i18n/locales/zh-CN.json
  • lib/notification-events.ts
  • lib/project-ordering.test.mjs
  • lib/project-ordering.ts
  • lib/rpc-manager.test.mjs
  • lib/rpc-manager.ts
  • lib/types.ts

Reviewed by free · Input: 54.6K · Output: 10K · Cached: 1.9M

@kahme247 kahme247 added the needs rebase Rebase onto current main; needs re-review label Nov 5, 2026
@kahme247

kahme247 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

The Bun server/daemon architecture has landed on main, so this PR needs to be rebased and re-reviewed against the new architecture before it can be merged. Please rebase onto current main, resolve the conflicts, and request re-review once CI is green.

@andrebrait andrebrait left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

RoyaLemonade added a commit to RoyaLemonade/ompweb that referenced this pull request Nov 9, 2026
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.
RoyaLemonade added a commit to RoyaLemonade/ompweb that referenced this pull request Nov 9, 2026
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.
@OrwellVII

Copy link
Copy Markdown
Contributor Author

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 forgetPendingUiRequest. One path doesn't: clearPendingUiRequests (reload/destroy) drops dialogs without a broadcast, and a reload whose new omp fails to start leaves the session marked as waiting. #482 fixes that and adds tests for the resync and replay-expiry paths that fail if #461's broadcast is removed.

@OrwellVII OrwellVII closed this Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Rebase onto current main; needs re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants