Skip to content

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

Merged
kahme247 merged 2 commits into
mainfrom
rebase-pr-482-2026-11-23
Nov 23, 2026
Merged

kahme247 merged 2 commits into
mainfrom
rebase-pr-482-2026-11-23

Conversation

@kahme247

@kahme247 kahme247 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Rebased from #482 by OrwellVII: "fix(rpc): clear the awaiting-input mark when a reload drops pending dialogs".

What changed on rebase

The production fix from #482 is not carried over, because current main already has the behavior it fixed. Since #482's base, main reworked clearPendingUiRequests() (lib/rpc-manager.ts) to settle every pending dialog through settlePendingUiRequest() instead of clearing the map in one go. Each settlement goes through forgetPendingUiRequest(), which calls notifyRunningChange(), so a reload that drops dialogs — including one whose spawn then fails — already broadcasts the cleared awaitingInput mark, and additionally retracts each dialog's notification. Re-applying #482's plain pendingUiRequests.clear() on top of that would have been a regression (lost notification retraction), so it was deliberately left out.

What this PR does carry over from #482, translated to current main:

  • The 3 regression tests, re-encoded for the current dialog protocol. The originals emitted bare JSON.stringify({ type: "extension_ui_request", ... }) lines, which RpcProcess.receive now drops (lines need the t envelope, and the live dialog frame type is ui_request). The translated tests emit ompLine({ type: "ui_request", id, method, args }) instead:
    • resync whose get_state read fails still clears the awaiting-input mark
    • a dialog that expired before a tab attached clears the mark on replay (timeout now in args[2], replay filter on ui_request)
    • a reload that fails to spawn clears the mark of the dialog it dropped
  • The assertions are unchanged — same behavior checked, only the frame encoding changed.
  • The AGENTS.md note (every dialog removal broadcasts a running change) and the CHANGELOG.md line (the mark also clears when a reload drops the dialog) from fix(rpc): clear the awaiting-input mark when a reload drops pending dialogs #482, both still accurate against current main.

Tests

  • bun test --parallel lib/rpc-manager.test.mjs: 178 pass, 0 fail, including the 3 translated tests above.
  • npm run typecheck (tsc --noEmit): clean.

Verified that the 3 translated tests pass on unmodified main at 5d7232a — i.e. they lock in behavior main already has, rather than fixing a live bug.

Summary by CodeRabbit

  • Bug Fixes
    • The sidebar’s waiting-for-input indicator now clears when a dialog is answered, cancelled, or expires. It also clears when a reload removes the dialog, including when the reload fails to restart the app.
  • Documentation
    • Clarified when the waiting-for-input state is shown and how pending dialogs are cleared.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The documentation describes how pending UI requests affect the running-session awaitingInput marker. Tests cover marker removal during host resync, dialog expiry during replay, and reload failure.

Changes: Running-state updates

Layer / File(s) Summary
Pending-dialog cleanup coverage
lib/rpc-manager.test.mjs, AGENTS.md, CHANGELOG.md
Tests cover marker removal after host resync, dialog expiry during replay, and reload failure. Documentation describes running-state broadcasts when requests are removed and adds the reload-failure case.

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

Change: Other

Suggested reviewers: andrebrait, royalemonade

Merge Risk: Minimal · up to 8fa73

Merge Risk: ⚪ Minimal · up to 8fa73

This change adds tests and documentation for how the awaiting-input marker clears when pending dialogs are removed. It does not change runtime behavior, so the risk of merging is minimal.

Security architecture risk: Minimal · up to fef03

This PR adds regression tests and documentation for existing dialog cleanup behavior. It does not change how live sessions handle dialogs or report that they are awaiting input.

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, scoped to the rpc component. The PR objectives confirm this is the intended fix, carried over fro…
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, scoped to the rpc component. The PR objectives confirm this is the intended fix, carried over from #482. The changeset includes the CHANGELOG line and the AGENTS.md note on the same behavior, and tests covering reload failure clearing the mark. The title is specific and matches the changeset. The objectives note that the production fix was not carried over, and the tests cover behavior already present on main. This is a scope mismatch, but the title still describes the tested behavior, so it passes. The '(rebased from #482)' suffix is noise but does not make the title misleading.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5cace354-09fe-4d67-b42a-a9f8c9d217bf
Commits

Reviewing files that changed from the base of the PR and between 5d7232a and fef03c9.

Files selected for processing: 3

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

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

@kahme247
kahme247 merged commit cc858f8 into main Nov 23, 2026
5 checks passed
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.

1 participant