Repository navigation
Conversation
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe change retires non-main-owned runtime workspace-session partitions after unpairing. Renderer writes and shutdown staging now use admission checks. Main-owned namespace detection covers repositories, folder workspaces, and catalog-resolved session tabs. Recovery skips removed hosts. Tests and audit tooling validate admission, removal, rollback, source variants, and repeated pair/unpair cycles. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to A rare transport-cleanup failure during removal can leave a removed server’s session partition writable. Address the cleanup ordering or accept this bounded stale-state risk. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 19 files. (2 skipped: 2 unsupported.) Full details: Description checkExplanation The description explains the problem, behavior change, rationale, scope, and testing. However, it does not satisfy several required template items: the linked issue is marked Related to instead of using Fixes #, Visual Proof does not use the required N/A wording, platform and SSH testing details are incomplete, and the Agent skill upstream boundary, Notes, and Checklist sections are missing. Resolution Add all required template sections. Provide a Fixes # issue reference, write N/A with a brief reason under Visual Proof, document macOS/Linux/Windows and SSH testing or mark them not applicable, include the Agent skill upstream boundary section, complete Notes, and complete the Checklist items. ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Run partition deletion when transport… · runtime-environment-connectivity-handlers.ts:115-131
src/main/ipc/runtime-environment-connectivity-handlers.ts:115-131
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winRun partition deletion when transport invalidation throws synchronously.
invalidateRuntimeEnvironmentTransportperforms synchronous cleanup before it returns its promise. If that cleanup throws, evaluation ofPromise.resolve(invalidateTransport(removed.id))stops before browser retirement setup and partition deletion.When
preserveMainNamespaceis false, place the teardown operations in atryblock and placestore.removeRuntimeWorkspaceSessionPartition(hostId)in itsfinallyblock. Otherwise, the existing host partition remains instore.getWorkspaceSessionHostIds(), andcanCreateRendererSessionPartitioncontinues to admit late renderer writes even thoughremoveEnvironmentremoved the environment. This preserves the current order in which transport invalidation and browser retirement start before a partition-deletion failure is reported.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: a7d82083-f168-415b-a8c3-4fd3870d5edd
📒 Files selected for processing (27)
docs/audits/paired-host-session-partition-retirement/README.mddocs/audits/paired-host-session-partition-retirement/before.config.mjsdocs/audits/paired-host-session-partition-retirement/electron-results.jsondocs/audits/paired-host-session-partition-retirement/fix.patchdocs/audits/paired-host-session-partition-retirement/main-fix.patchdocs/audits/paired-host-session-partition-retirement/node-results.jsondocs/audits/paired-host-session-partition-retirement/phase.config.mjsdocs/audits/paired-host-session-partition-retirement/publication.patchdocs/audits/paired-host-session-partition-retirement/reproduce.mjsdocs/audits/paired-host-session-partition-retirement/scenario.test.mjsdocs/audits/paired-host-session-partition-retirement/source-versions.jsondocs/audits/paired-host-session-partition-retirement/sources.cjsdocs/audits/paired-host-session-partition-retirement/validation.jsonsrc/main/ipc/renderer-shutdown-checkpoint.test.tssrc/main/ipc/renderer-shutdown-checkpoint.tssrc/main/ipc/renderer-workspace-session-admission.tssrc/main/ipc/runtime-environment-connectivity-handlers.tssrc/main/ipc/runtime-environment-removal-storage.test.tssrc/main/ipc/runtime-environment-session-retirement.test.tssrc/main/ipc/runtime-environments-capability-cache.test.tssrc/main/ipc/runtime-environments-pairing.test.tssrc/main/ipc/runtime-environments-subscription-teardown.test.tssrc/main/ipc/session.tssrc/main/persistence/loading-store/session-host-partitions.tssrc/main/runtime/runtime-legacy-worker-terminal-recovery-persistence.tssrc/main/runtime/runtime-workspace-session-namespace-custody.test.tssrc/main/runtime/runtime-workspace-session-namespace-custody.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Retire non-main-owned session partitions in a… · runtime-environment-connectivity-handlers.ts:115-131
src/main/ipc/runtime-environment-connectivity-handlers.ts:115-131
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winRetire non-main-owned session partitions in a
finallypath.removeEnvironmentcommits beforeinvalidateRuntimeEnvironmentTransportruns. That function callscloseRemoteRuntimeRequestConnection, which invokesstatus?.owner.dispose()andcached?.connection.close()without catches. A synchronous exception can therefore occur beforePromise.resolvereceives the result and skipremoveRuntimeWorkspaceSessionPartition(hostId). The retained host remains admitted bycanCreateRendererSessionPartition, sosession:setandsession:patchcan still write to it. Ensure partition retirement runs infinallywhenpreserveMainNamespaceis false.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: ee928f8d-4b8b-4ae2-8149-e442d6e7f73e
📒 Files selected for processing (8)
docs/audits/paired-host-session-partition-retirement/README.mddocs/audits/paired-host-session-partition-retirement/electron-results.jsondocs/audits/paired-host-session-partition-retirement/node-results.jsondocs/audits/paired-host-session-partition-retirement/reproduce.mjsdocs/audits/paired-host-session-partition-retirement/source-versions.jsondocs/audits/paired-host-session-partition-retirement/sources.cjsdocs/audits/paired-host-session-partition-retirement/validation.jsonsrc/main/ipc/runtime-environment-session-retirement.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/audits/paired-host-session-partition-retirement/README.md
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — two artifact-hygiene nitpicks.
Reviewed changes
I reviewed the full diff and verified the two new regression suites pass locally; the substantive production change is small and the rest of the diff is the docs/audits/ proof bundle.
- GUI unpair now retires the runtime partition —
runtimeEnvironments:removesnapshots main-side custody withhasMainOwnedRuntimeSessionNamespacebeforeremoveEnvironment, then calls the newstore.removeRuntimeWorkspaceSessionPartition(hostId)unless a repo/folder still owns that runtime namespace. The handler is synchronous, so no renderer write can interleave between the custody read and the delete. - Exact Store deletion API —
removeRuntimeWorkspaceSessionPartitionrefuses non-runtime:and absent partitions, deletes only that key, invalidates metadata-prune inputs, and uses the normal scheduled save (src/main/persistence/loading-store/session-host-partitions.ts:84). - Renderer admission guard —
canCreateRendererSessionPartitionadmits a missing runtime partition only when the host is already persisted, main owns its namespace, or the exact environment ID is on disk; wired intosession:set,session:patch,session:set-sync, andapp:stage-before-unload-sync(src/main/ipc/renderer-workspace-session-admission.ts). - Namespace custody helper —
hasMainOwnedRuntimeSessionNamespacere-resolves catalog repo/folder ownership plus the controller's unique persisted-alias fallback (src/main/runtime/runtime-workspace-session-namespace-custody.ts). - Recovery rollback guard — the async legacy-recovery catch skips rollback when the target partition is gone (
src/main/runtime/runtime-legacy-worker-terminal-recovery-persistence.ts:78).
ℹ️ Nitpicks
docs/audits/is a brand-new directory with no.gitignoreallow-list entry, so all 13 files matchdocs/**and reach the index only via force-add (git check-ignore --no-index -vreports.gitignore:96:docs/**). Adding!docs/audits/and!docs/audits/**keeps the audit reproducible from a cleangit add.node-results.jsonandelectron-results.jsonare ~614 KB each and differ by 5 bytes;source-versions.jsonis another 941 KB. Folding the two runtime reports into one (they already carry the same 78 cases) or linking the evaluated-graph dump externally would keep ~2 MB of generated JSON out of the tree.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Run failed. View the logs →
|
There was a problem hiding this comment.
ℹ️ No code issues in the new commits; one merge-readiness note below.
Reviewed changes
Re-reviewed the delta since the prior pullfrog review (ace839c): the branch was merged with its prerequisite np-oom-scan-local-empty-tab-retirement and retargeted onto it, and the permanent retirement fixture was realigned to that base's two-argument session registration.
- Retargeted the PR onto its prerequisite —
#21175now merges intonp-oom-scan-local-empty-tab-retirement(#21113) instead ofmain;c86d273is the merge of that branch. No production code changed in the delta. - Realigned the retirement fixture —
runtime-environment-session-retirement.test.tscallsregisterSessionHandlers(store, undefined as never)under a documentedSAFETY:cast, matching the base'sregisterSessionHandlers(store, runtime)signature; the one-argument form from4ad5d393was reverted by the merge. - Updated the audit bookkeeping —
source-versions.jsonnow accepts both fixture identities (runnerSourcesarray plusfixtureVariants) and the reports recordconfigurationAndFixtureHashes. The recordedaf07f07c…hash matches the working tree, so the artifact is self-consistent again. - Verified the delta — the two new suites pass locally (28 tests); the admission guard, custody helper, and Store deletion API are unchanged from the previously reviewed revision.
️ Head CI is red on a stale-branch error that is outside this diff
Both the typecheck and static analysis jobs fail on src/renderer/src/components/native-chat/NativeChatMessageList.windowing.test.tsx(12,15): error TS6196: 'NativeChatMessage' is declared but never used. That file is not part of this PR, and current main has already removed the import (68ea3b92e3); this head and its base still carry it via 15cac68802. Merging (or rebasing onto) current main clears the gate.
Technical details
# Stale-branch typecheck/oxlint failure on head
## Affected sites
- `src/renderer/src/components/native-chat/NativeChatMessageList.windowing.test.tsx:12` — unused `NativeChatMessage` type import in the head tree (CI `typecheck` job 105152368688 and `static analysis` job 105152368415, run 35205875361).
- Fix already present on `main` in `68ea3b92e3` (native-chat collapsed-run fix), which removed the import.
## Required outcome
- Head CI `typecheck` and `static analysis` pass, or the failure is confirmed as inherited from the base `np-oom-scan-local-empty-tab-retirement` and resolved there.
## Suggested approach (optional)
- Merge current `main` into the branch (or rebase the prerequisite), so the branch carries the fixed file rather than `15cac68802`'s version.
## Open questions for the human (optional)
- Is #21113 expected to absorb the `main` rebase, or should this branch merge `main` first?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the delta since the prior pullfrog review (c86d273): the async admission hardening, the scrollback-snapshot release, their regression tests, and the two follow-up commits that clear CI and refresh the audit proof.
- Async session admission now fails closed —
session:set/session:patchroute through the newisRendererSessionAdmitted, which logs and returnsfalsewhen the pairing authority cannot be read, so the write is skipped and the invoke resolves; genuine Store write errors still reject (src/main/ipc/session.ts:23). - Unshared scrollback snapshots are released on partition removal —
releaseRemovedHostScrollbackSnapshotssubtracts refs still held by any remaining partition, flushes the profile before deleting, and retains files on frozen writes, a started quit flush, or a save failure (src/main/persistence/loading-store/session-host-partitions.ts:249). - Regression coverage added — 31 focused admission/snapshot-retirement cases; I confirmed they fail against the pre-fix sources, so they are real coverage rather than theatre.
- Pinned the audit runner's
diffdependency —[email protected]is now an explicit devDependency fordocs/audits/.../sources.cjs. - Cleared the inherited CI failure — removed the unused
NativeChatMessagetype import;typecheckandstatic analysisare green at this head. - Refreshed the audit proof — the publication baseline is realigned to prerequisite
718ead7, and thesourceHashesrecorded invalidation.jsonmatch the working tree.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Admission for a renderer session write consults pairing authority, which can throw `folder_workspace_connection_ambiguous` for an unrelated workspace. Every admission call site treated that throw as "not admitted" and silently dropped the write, so one ambiguous folder workspace could discard a user's session save on `session:set`, `session:patch`, `session:set-sync`, and the before-unload staging checkpoint. Those paths now admit the write and log; a resurrected partition is recoverable on the next unpair, a lost save is not. GUI unpair did not catch that throw at all, so an ambiguous verdict surfaced as an opaque removal error. It is now caught and read as custody held, which completes the unpair and preserves the partition — deletion still requires a positive "nothing owns this" verdict. The checked-in audit artifact was computed on a tree stacked on #21113 and cannot be re-baselined by editing its pinned commit; its prose is corrected to match the shipped code and its recorded proofs are marked stale.
231edf2 to
cbbf0f8
Compare
There was a problem hiding this comment.
ℹ️ No code issues in the new commits — the fail-open flip is sound and covered. One artifact-consistency note inline.
Reviewed changes
Re-reviewed the delta since the prior pullfrog review (231edf2, which was force-rebased away; the delta is equivalent to git diff ccaad149..cbbf0f8): admission failure handling flipped from fail-closed to fail-open, the unpair custody read was wrapped, and the audit proof was marked stale.
- Renderer admission now fails open —
isRendererSessionAdmitted(src/main/ipc/session.ts:65) and the shutdown checkpoint'sisShutdownSessionAdmitted(src/main/ipc/renderer-shutdown-checkpoint.ts:74) log and returntruewhen the pairing authority or namespace custody read throws, so afolder_workspace_connection_ambiguousraised by an unrelated workspace no longer drops a user's session write; genuine Store errors still reject/propagate, and flush failures still surface asok:false. - Unpair preserves the partition on an unreadable custody verdict —
runtimeEnvironments:remove(src/main/ipc/runtime-environment-connectivity-handlers.ts:113) catches the custody-lookup throw and defaultspreserveMainNamespace = true, so unpair completes and deletion still requires a positive "nothing owns this" verdict. - Tests realigned to the new contract — the async-admission, shutdown-staging, and unpair-failure cases now assert the write proceeds and the partition is preserved; the retirement suite passes locally (25 cases).
- Audit proof marked stale — the README banner now states the checked-in hashes/patches/reports were computed on a #21113 stack and
sources.cjswill refuse to load until regenerated againstmain.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| > those files do not exist, and the renderer-admission failure behaviour described below has since | ||
| > been changed to fail open. `sources.cjs` will therefore refuse to load until all four variant | ||
| > graphs, the three patches, and both runtime reports are regenerated against `main`. The prose in | ||
| > this file has been corrected to describe the shipped code; the recorded numbers have not. |
There was a problem hiding this comment.
This banner only corrects the README. validation.json and scenario.test.mjs still encode the pre-fail-open contract, and the PR description still claims a refreshed audit — so a reader who doesn't open this file is misled.
Technical details
# Stale proof bundle still asserts the pre-fail-open contract
## Affected sites
- `docs/audits/paired-host-session-partition-retirement/validation.json:33` — `reviewFixes[0]` says "Async admission failures resolve without writing", which is now the opposite of the shipped fail-open behavior.
- `docs/audits/paired-host-session-partition-retirement/validation.json:39-44` — `sourceHashes` pin the pre-`cbbf0f8` tree: `session.ts` `e12a10a3…` (current `be8bd26e…`) and `runtime-environment-session-retirement.test.ts` `2e669982…` (current `97beea49…`).
- `docs/audits/paired-host-session-partition-retirement/scenario.test.mjs:417` — `expect(receipt).toBe(!fixed)` asserts the fixed variant returns a `false` sync receipt, but the shipped `session:set-sync` now returns `true`.
- PR description "Testing" — still states the refreshed portable audit passes 78 cases on Node 24 and Electron 43 and that the publication baseline matches `718ead7`.
## Required outcome
- The artifact and the PR description agree with the shipped fail-open behavior and the current source hashes, or the bundle is dropped until it can be regenerated.
## Suggested approach (optional)
- Regenerate all four variant graphs and both reports against a named `main` commit, then refresh `sourceHashes` and `reviewFixes`; otherwise annotate `validation.json` and `scenario.test.mjs` the same way this README is annotated and update the PR description.
ELI5
Removing a paired host through Orca's settings could leave its saved session state behind. This change removes that state when no repository or folder workspace still owns it.
What Changed
After explicit GUI removal, delete only the unowned host's session partition and prevent stale renderer saves from recreating it. Preserve partitions still owned by repositories or folder workspaces and use the existing session persistence path.
Why
Keeping records for permanently removed owners lets saved state accumulate. Checking every remaining owner avoids deleting state another host or workspace still uses.
Tradeoff and scope
Requires #21113. Normal GUI remove/re-add already creates a new environment identity, so the old partition was already unreachable through that normal flow. Updating an existing pairing preserves its identity. Direct stale-ID access or manually restoring an old UUID may behave differently. CLI removal and historical orphan cleanup are separate work.
Linked Issue
Related to #19831 as memory hardening; no incident-scale RSS measurement is claimed.
Visual Proof
No before/after UI capture is attached; this changes saved-session cleanup behavior. Automated ownership and pairing evidence is linked under Testing.
Testing
94 tests pass across ten suites, including 31 focused admission and snapshot-retirement tests covering write failures, shared references, frozen writes, and unavailable pairing authority. Node and renderer typechecks pass. The unused test import that previously blocked typecheck and lint is removed.
The refreshed portable audit passes 78 comparative cases on Node 24 and 78 on Electron 43. The exact publication baseline matches prerequisite commit
718ead7ea9f6296d69ceb7d1460a3579116fe85f; current patches, source hashes, and reports are checked in underdocs/audits/paired-host-session-partition-retirement/. The permanent baseline control produces 15 expected failures and seven passing controls. Fresh CI remains the final merge gate.Production source change: 204 lines changed (195 added, nine deleted), excluding tests, audit documents, and development dependencies.
Review
Async renderer writes now fail closed when pairing authority cannot be read: the write is skipped and the renderer invoke resolves normally; real Store write errors still propagate. Removing a host now flushes the profile before deleting unshared profile-local terminal scrollback snapshots, preserves snapshots still referenced by another partition, and retains files when persistence is frozen or fails. The explicit
diffdevDependency makes the audit runner’s patching dependency reproducible.This does not infer remote process death from loss of contact. The remaining user-facing tradeoff is that an explicit unpair removes that host’s saved session partition and unshared local scrollback; re-pairing creates a new environment identity, so the old state is intentionally not restored. CLI removal and historical orphan cleanup are outside this GUI removal path. Shared legacy snapshot files are retained because other profiles can still use them.