Skip to content

fix(pending): list no first message for a pane that ended during the last read - #4107

Merged
devswha merged 1 commit into
mainfrom
fix/first-message-pane-ended-late
Nov 18, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/first-message-pane-ended-late

Conversation

@devswha

@devswha devswha commented Nov 18, 2026

Copy link
Copy Markdown
Owner

What

Follow-up to #4106, from the Opus review of its head that was still running when it merged. Two LOW findings, both reproduced by the reviewer; nothing was typed in either.

  1. A pane that ended during the last read still got its first message listed. queueFirstMessage checked for an ended pane before reading the launched process's start (processStartedAtAsync), which is awaited when herdr does not show that process in front yet. A pane that ended during that read had its message listed after all, held as pane_not_found. holdPendingPane had already run with nothing to discard, so the record stayed until the server restarted, and the create answer said held: "pane_not_found". The check now comes after the last await, so the request is refused as fix(pending): hold a message whose page left mid-send or before it was listed #4106 said it would be.
  2. fix(pending): hold a message whose page left mid-send or before it was listed #4106 did not say that an attach restart is held too. Its dispatchPending change holds a queued message on its way whenever hold() marked it, which holdPendingPane also does on an attach restart. The end state is the same as before (held, nothing typed), one step sooner. No code change: the changelog entry now names it.

.claude/skills/verify-pending-lease/covered.blobs is recorded again for the changed pending.ts. The model is unchanged: it does not cover a pane that ends (listed under "Not covered" in the skill), and the change touches nothing else.

Validation

  • bun run check fast: green (unit: 18,613 pass, 0 fail).
  • The new test in server/core/pending-left-lease.test.ts holds the read of the launched process's start, ends the pane, and expects the request to be refused with nothing listed. It fails on main and passes here.
  • Not run: contract tests, browser regressions (no UI change), check full.

🤖 Generated with Claude Code

…last read

queueFirstMessage checked for an ended pane before reading the launched process's start, which
is awaited when herdr does not show that process in front yet. A pane that ended during that
read had its first message listed after all, held as pane_not_found, and nothing discards a
first message once its pane is gone: the record stayed until the server restarted. The check
now comes after the last await. Found by the review of #4106's head; nothing was typed.

The changelog entry of #4106 also names the attach restart, which holds a queued message on its
way as a page leaving does.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of queued messages when a pane ends or its terminal restarts, and when the agent defers sending. Messages are held in these cases.
    • Fixed a timing issue where a first message could be queued and displayed as pending even though the pane ended before startup completed. The recorded pane error is now reported instead.

queueFirstMessage now checks for a pane fault after the launched-process start-time lookup and before enqueueing the first message. A test covers the pane ending while that lookup is pending. The pending-lease changelog wording and recorded blob hash also change.

Changes: First-message queueing

Layer / File(s) Summary
Check pane state after process lookup
server/core/pending.ts, server/core/pending-left-lease.test.ts, changelog.d/pending-left-lease.md, .claude/skills/verify-pending-lease/covered.blobs
queueFirstMessage checks for a pane fault after the process-start lookup. The new test verifies that the request rejects with pane_not_found and no first message is listed if the pane ends during the lookup. The changelog adds pane terminal restarts and agent deferral to its queued-message conditions. The recorded blob hash changes.

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

Change: Bug fix

Possibly related PRs

  • devswha/ovis#4106: Adds first-message tracking and pane-ended handling in the same pending.ts flow.
Merge Risk: Minimal · up to e55e0

This change closes a narrow race where a first message could be held for a pane that had already ended. It now refuses the request instead. The change is small and tested, and no merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: queueFirstMessage now refuses a first message for a pane that ended during the last read. It matches the pending.ts change and the new test. The title is specific and …
Description check Passed The description covers the problem, the code change, the changelog and blob updates, and validation results. It follows the template's Change and Validation sections. It does not link an issue, but th…
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: queueFirstMessage now refuses a first message for a pane that ended during the last read. It matches the pending.ts change and the new test. The title is specific and related to the changeset, so the check passes.

Full details: Description check

Explanation

The description covers the problem, the code change, the changelog and blob updates, and validation results. It follows the template's Change and Validation sections. It does not link an issue, but the template only asks for one for features, and this is a fix following up on #4106. The description is mostly complete.

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

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7c8999f and e55e044.

Files selected for processing: 4

  • .claude/skills/verify-pending-lease/covered.blobs
  • changelog.d/pending-left-lease.md
  • server/core/pending-left-lease.test.ts
  • server/core/pending.ts

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

@devswha
devswha merged commit d3f05d8 into main Nov 18, 2026
24 checks passed
@devswha
devswha deleted the fix/first-message-pane-ended-late branch November 18, 2026 05:17
@devswha

devswha commented Nov 18, 2026

Copy link
Copy Markdown
Owner Author

Merged by the session that opened it, on the maintainer's word, the same way as #4106: squash-merged at the checked head e55e044a3, without --admin, past the local merge guard for this one merge.

At that head: the four required checks green on GitHub, CodeRabbit reviewed it with no actionable comments and no threads. No second reviewer ran on this head: the change is the one the Opus review of #4106 asked for, with its test.

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