Skip to content

fix(rpc): clear the awaiting-input mark when a reload drops pending dialogs - #482

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

OrwellVII wants to merge 1 commit into
ompweb-dev:mainfrom
OrwellVII:fix/awaiting-input-reload

Conversation

@OrwellVII

@OrwellVII OrwellVII commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Why

#461 marks a running session as waiting for input while its wrapper holds a pending dialog, and clears the mark by broadcasting from forgetPendingUiRequest. The bulk path, clearPendingUiRequests (reload, destroy), drops every pending dialog without broadcasting. Destroy and a successful reload broadcast afterwards, but a reload whose new omp process fails to start throws before its final notifyRunningChange, so every open sidebar keeps the session marked as waiting on a dialog that no longer exists until some unrelated running change.

What changed

  • clearPendingUiRequests broadcasts a running change when it drops at least one dialog, like forgetPendingUiRequest.
  • Tests in lib/rpc-manager.test.mjs:
    • a reload that fails to spawn clears the mark (fails on main);
    • a host resync whose get_state read fails, and a dialog found expired when replayed to a new tab, both clear the mark. These pass on main; they fail if the broadcast in forgetPendingUiRequest is removed, which the existing answer-path test does not catch (raised in the review of feat(sidebar): show sessions waiting for your answer #319).
  • CHANGELOG.md (extends feat(sidebar): mark sessions waiting for user input #461's entry) and one AGENTS.md line: a new path that drops dialogs must go through one of the two removal functions.

Verification

npm test 4110 pass, 36 skip, 0 fail; tsc clean; lint 0 errors; npm run build ok. On main the reload test fails with the sidebar is told, not left waiting on a dialog nobody can answer.

Not changed (for the maintainers)

  • open_url UI requests also count as pending, so a session that sent one shows the waiting icon although the web app never answers that request (the browser just opens the tab); it clears when omp cancels it or exits. This is from reading the code, not a live reproduction. I left feat(sidebar): mark sessions waiting for user input #461's semantics alone; happy to send a follow-up if you want open_url excluded.
  • A waiting session in a collapsed workspace counts as running in the workspace badge.

Supersedes #319.

Summary by CodeRabbit

  • Bug Fixes
    • The sidebar’s waiting-for-input indicator now clears when a reload dismisses a pending dialog, including when the app fails to restart afterward.
    • The indicator now updates correctly when pending input is cleared during recovery or after a dialog expires.

…ialogs

ompweb-dev#461 marks a running session as awaitingInput while its wrapper holds a
pending dialog and broadcasts from forgetPendingUiRequest. The other
removal path, clearPendingUiRequests (reload, destroy), dropped every
pending dialog without broadcasting. destroy and a successful reload
broadcast afterwards, but a reload whose replacement spawn fails threw
past its final notifyRunningChange, so the sidebar kept the session
running and waiting on a dialog that no longer exists until some
unrelated change. clearPendingUiRequests now broadcasts when it drops
anything, like forgetPendingUiRequest.

Also covers the two settlement paths raised in review of ompweb-dev#319: a host
resync that clears dialogs before a get_state reconcile that then fails,
and a dialog found expired when replayed to a new tab. Both already
clear through forgetPendingUiRequest; the tests fail if that broadcast
is removed, which the existing answer-path test does not catch.

Supersedes ompweb-dev#319, whose sidebar marking predates the host/daemon
architecture and was replaced by ompweb-dev#461.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 14:43

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. Try requesting a review at a lower effort level.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When pending UI requests are cleared, the running-state broadcast now updates if requests were present. Tests cover host resync, replay after dialog expiry, and reload failure. The documentation and changelog describe the awaiting-input state and reload behavior.

Changes: Running-state updates

Layer / File(s) Summary
Clear requests and verify running-state updates
lib/rpc-manager.ts, lib/rpc-manager.test.mjs, AGENTS.md, CHANGELOG.md
clearPendingUiRequests broadcasts a running-state change when it clears pending requests. Tests cover host resync, replay after dialog expiry, and reload failure. Documentation describes the awaitingInput state and reload behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: andrebrait

Merge Risk: Minimal · up to 470a6

Sidebars should now stop showing a session as waiting for input after a reload drops its dialog, including when the replacement process fails to start. The change is small and tested, and no merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: clearing the awaiting-input mark when a reload drops pending dialogs. The changeset adds a broadcast in clearPendingUiRequests when pending requests are removed, plus …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: clearing the awaiting-input mark when a reload drops pending dialogs. The changeset adds a broadcast in clearPendingUiRequests when pending requests are removed, plus tests for the reload-failure, host resync, and expired-dialog paths. The title is specific and matches the primary fix. It follows the conventional commit style used in the project.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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

A rabbit watched the dialogs fade,
Then saw the running marks update.
Through resync, replay, and reload,
The waiting state was cleared away.
It thumped once softly: tests agree.

Recent review info

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: b346e577-7a94-45f9-9df0-896fd782a80f
Commits

Reviewing files that changed from the base of the PR and between 546a945 and 470a68f.

Files selected for processing: 4

  • AGENTS.md
  • CHANGELOG.md
  • lib/rpc-manager.test.mjs
  • lib/rpc-manager.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 2

  • GitHub Check: CodeRabbit
  • GitHub Check: Kilo Code Review
Additional context used

Code guidelines: 1

AGENTS.md — auto-discovered
Path-based instructions: 1

Source excerpt: A full `message_update` carries the whole message twice (`message` and `assistantMessageEvent.partial`), 7-11 KB per frame at several frames per second.

CodeRabbit inference engine (AGENTS.md)

Files:

  • lib/rpc-manager.ts
Additional comments: 4

lib/rpc-manager.ts: 1

1490-1491: LGTM!

Also applies to: 1493-1493

lib/rpc-manager.test.mjs: 1

3041-3111: LGTM!

AGENTS.md: 1

1441-1441: LGTM!

CHANGELOG.md: 1

26-26: LGTM!

@coderabbitai
coderabbitai Bot requested a review from andrebrait November 13, 2026 14:44
@kilo-code-bot

kilo-code-bot Bot commented Nov 13, 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 (4 files)
  • AGENTS.md
  • CHANGELOG.md
  • lib/rpc-manager.test.mjs
  • lib/rpc-manager.ts

Reviewed by free · Input: 19.2K · Output: 1.2K · Cached: 95.2K

@andrebrait

Copy link
Copy Markdown
Collaborator

Hi @OrwellVII, thank you for your contribution, and apologies for the long wait on this PR. We really appreciate the time and effort you have put into it.

We are working through a major refactor of ompweb, including switching to our own build of omp. We are close to finishing that work; once the refactor is complete, we will turn our attention back to the pending PRs, including this one.

Thank you for your patience and for helping improve ompweb!

@kahme247

Copy link
Copy Markdown
Collaborator

Hi, thanks for this PR. It currently conflicts with main and can't be merged as-is — please rebase it onto current main and resolve the conflicts. Once it's rebased I'll re-run the checks.

This is rebase-only: a 3-line fix. Note it overlaps #444 on lib/rpc-manager.ts / AGENTS.md / CHANGELOG.md.

@kahme247

Copy link
Copy Markdown
Collaborator

Superseded by #564, a rebased replacement of this PR.

On rebase against current main, the production fix from this PR was found to be already present: main reworked clearPendingUiRequests() to settle every pending dialog through settlePendingUiRequest(), which broadcasts the cleared awaitingInput mark via forgetPendingUiRequest() (and retracts each dialog's notification), so re-applying this PR's plain map clear would have been a regression. #564 therefore carries over the 3 regression tests — translated from the old bare extension_ui_request lines to the current ui_request / ompLine envelope, assertions unchanged — plus the AGENTS.md note and CHANGELOG.md line from this PR. All 178 tests in lib/rpc-manager.test.mjs pass, including the 3 translated ones.

Closing this PR in favor of #564.

@kahme247 kahme247 closed this Nov 23, 2026
1zun4 pushed a commit to 1zun4/ompweb that referenced this pull request Nov 23, 2026
1zun4 pushed a commit to 1zun4/ompweb that referenced this pull request Nov 23, 2026
…11-23

fix(rpc): clear the awaiting-input mark when a reload drops pending dialogs (rebased from ompweb-dev#482)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants