Repository navigation
perf: streamline R session refresh, replay, and console output - #1908
Merged
Merged
Conversation
eitsupi
reviewed
Oct 25, 2026
eitsupi
left a comment
Member
There was a problem hiding this comment.
ChatGPT review finding:
In WorkspaceRefreshScheduler.ensure(), dirty is cleared before read() completes. If the read fails or returns undefined, subsequent ensure() calls will not retry unless another invalidate() occurs.
This affects ensureSessionWorkspace() in particular: a transient native sess request failure could leave workspace metadata stale even when the user accesses it again.
Could we preserve the pending refresh after a failed read and retry on the next explicit ensure() call, without introducing an automatic retry loop?
eitsupi
approved these changes
Oct 25, 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.
Long-lived R sessions repeatedly rebuild unchanged workspace replies, scan retained output for small history requests, and resend growing console prefixes. This reduces that work while preserving session ownership, execution identity, replay, and final output timing.
Validation
Validated on macOS with a clean
pnpm install --frozen-lockfilein an isolated checkout, TypeScript 7.0.2, VS Code types 1.101.0, Mocha 12.0.3, and VS Code 1.142.0:sesstinytest suite, TypeScript compilation, TypeScript/R lint, formatting, build, and diff checks.The clean build succeeds with two existing EJS 7 export warnings in unchanged
mainhelp/httpgd imports. Cross-platform CI will validate the published head.Local synthetic benchmarks
The branch includes scripts to reproduce these measurements:
Changed metadata still needs a full workspace reply, cold legacy indexes need reconstruction, and these timings do not measure end-to-end renderer latency. Live notebooks retain displayed history; the new byte limits govern working sets and transport pages.