feat(comments): re-run cancelled @claude replies; remove broken new-session#73
Merged
Merged
Conversation
…sion Two @claude reply fixes plus a comment-panel layout follow-up. Cancel → Re-run: cancelling an @claude reply now resolves to a neutral, retryable state instead of a dead partial. A `cancelled` stream event no longer finalizes the reply (which would apply half-streamed tracked edits) — it marks the reply `cancelled` and keeps the stashed inputs so a "Re-run" button re-issues the same request in place against the same reply entry. `cancel(replyId)` now supersedes the reply synchronously: it bumps the per-reply generation and marks it cancelled even when no cancel token is tracked yet, closing the spawn-await window where a Cancel click could land between startAIReply and the spawn resolving and be silently swallowed — the reply would then stream to completion despite the stop. The pending runSpawn sees a stale generation on resume and orphan-cancels its own child. Remove "Start new session": the Quill-minted-session path (createdByQuill / allow_create / --session-id) never reliably created a resumable session, so every binding now resumes via --resume and the button is gone. Legacy sidecars stamped createdByQuill load as plain bindings (the field is dropped by the whitelist sanitizer). Comment panel: a dynamic bottom spacer (computeBottomSpacer, derived from document-space card bottoms to avoid a scroll→reflow→scroll loop) lets the lowest card scroll fully into view. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ESi6dnK3Wc1jYRpZN5qfZA
sam-powers
force-pushed
the
fix/claude-cancel-rerun-and-session-cleanup
branch
from
July 10, 2026 12:44
9fe1874 to
06081bd
Compare
Merged
sam-powers
added a commit
that referenced
this pull request
Jul 10, 2026
Patch release bundling the fixes from PRs #70–#74: - @claude CLI resolution: working PATH + prefer configured binary (#70) - desktop: menu stale-closure, window-close capability, deep-link window surfacing (#71) - retry failed @claude replies in place (#72) - re-run cancelled @claude replies; remove broken new-session (#73) - surface @claude in composer placeholders; widen reading measure (#74) Also removes the stray docs/to-improve and docs/plans files that landed via #70 — those are downstream porting notes, not public-repo content. Claude-Session: https://claude.ai/code/session_01ESi6dnK3Wc1jYRpZN5qfZA Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #72 (retry failed @claude replies). Targeted at
mainso CI runs, so the diff currently includes #72's commit — merge #72 first, then this, and the diff collapses to just this group's changes.What & why
Three fixes to the @claude reply flow plus a comment-panel layout follow-up, from
docs/to-improve/.Cancel → Re-run (edge case: "cancelling breaks the reply, need a re-run button")
Cancelling an @claude reply used to leave a dead partial. Now cancel resolves to a neutral, retryable state:
cancelledstream event no longer finalizes the reply (finalizing would apply half-streamed tracked edits and masquerade as a finished answer). It marks the replycancelledand keeps the stashed inputs, and the card shows a Re-run button that re-issues the same request in place against the same reply entry.cancel(replyId)now supersedes the reply synchronously — it bumps the per-reply generation and marks the reply cancelled even when no cancel token is tracked yet. This closes the spawn-await window: a Cancel click landing betweenstartAIReplyandspawn_claude_resumeresolving used to be silently swallowed (no token → early return), so the reply streamed to completion despite the stop. The parkedrunSpawnnow sees a stale generation on resume and orphan-cancels its own child.cancelledis a transient, UI-only reply flag — stripped from the sidecar and the draft snapshot, same aspending/error.Remove "Start new session" (edge case: "create new session doesn't really work")
The Quill-minted-session path (
createdByQuill/allow_create/--session-id) never reliably produced a resumable session. Every binding now resumes via--resume, and the button is gone (frontend + Rust). Legacy sidecars stampedcreatedByQuill: trueload as plain bindings — the field is dropped by the whitelist sanitizer.Comment panel: lowest card scrolls fully into view
A dynamic bottom spacer (
computeBottomSpacer, derived from document-space card bottoms to avoid a scroll→reflow→scroll loop) extends the scroll range so the lowest comment card can be scrolled into view.Tests
useClaudeReplyRetry.test.ts: cancel → neutral (not finished/errored, no edits applied); re-run in place; superseded-cancel drop; new spawn-await-window regression (Cancel mid-spawn marks cancelled synchronously and orphan-cancels the late child).useComments.test.ts:cancelAIReplymarks neutral / cleared by retry / no-op for unknown id.useDocumentReviewCancel.test.ts,commentLayerHelpers.test.ts(computeBottomSpacer),annotationValidation.test.ts(legacycreatedByQuilldropped), sidecar/draft strip fixtures.🤖 Generated with Claude Code