Repository navigation
Cancel stale mode 2031 retries across resubscribe - #8214
Merged
Merged
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughMode 2031 seed replies now receive an attempt-validation predicate and recheck it before sending. The terminal pane lifecycle stores a fresh symbol token for each pane attempt and removes tokens when panes close. Tests update the push harness to model attempt identity and verify that stale scheduled retries do not send duplicate input or record duplicate modes. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
6 tasks
5 tasks done
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
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.
Description
Follow-up to #8206. A mode-2031 subscription can arrive before its PTY transport connects, so Orca retries the initial color-scheme reply up to eight times. #8206 stops a retry after a plain unsubscribe, but this sequence still duplicated the reply:
Both A and B saw a currently subscribed pane and answered the newer subscription. A program can consume one reply and leave the duplicate to leak into its next input owner.
This PR gives every subscription attempt an opaque ownership token. A delayed retry sends only if its token still owns that pane. Starting a later subscription invalidates all earlier retries, and pane teardown deletes the token.
Evidence of fix
The deterministic regression test was added before production code. On merged
main:After the fix:
pnpm exec vitest run --config config/vitest.config.ts \ src/renderer/src/components/terminal-pane/terminal-mode-2031-replies.test.ts \ src/renderer/src/components/terminal-pane/terminal-appearance.test.ts \ src/renderer/src/components/terminal-pane/remote-runtime-pty-query-reply-immediate.test.tsThe test queues retries for two subscription generations, connects the transport, executes both callbacks, and proves exactly one immediate reply and one recorded mode.
Additional checks passed:
pnpm typecheck:weboxlintpnpm check:max-lines-ratchetpnpm check:reliability-gatesELI5
Imagine two people take numbered tickets to answer the same terminal question. The first person leaves and a second person asks again. Previously, both old and new tickets could answer once the connection opened. Orca now accepts only the newest ticket, so the old delayed answer cannot spill into the terminal as random text.
User-facing trade-offs
Terminal reliability proof
terminal-capability.query-reply-generation— a delayed mode-2031 seed reply must belong to the current subscription generation, not merely a currently true subscription boolean.terminal-capability.mode-2031-reply-timeliness.sendInputImmediatecall.none; deterministic red/green proof exists but the gate is not registered or cross-platform promoted.