Repository navigation
Conversation
This was referenced Oct 6, 2026
Contributor
|
Closing as not planned. This only saves work during occasional deletion of an inactive account, with no quantified material production gain. The PR is also draft and explicitly awaits integration with its durability prerequisite. The identity guard is sensible, but we are not adding a standalone cache-policy optimization for an unmeasured rare operation. |
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.
ELI5
Deleting another saved Codex account should not temporarily clear the account you are currently using from the usage display. This skips the unnecessary runtime work and quota probe when the selected host account remains unchanged and its home is trusted.
What Changed
Compare the runtime selections before and after removal, including invalid selections that need pruning. Reuse the existing read-only managed-home ownership check. When removing a host account, every selection is unchanged, and the selected host home is trusted, skip runtime reconciliation and the forced quota refresh. Account removal, managed-home cleanup, and eviction of the removed account's cached usage still run.
Active removal, every WSL account removal, system-default host selection, stale WSL selections, and untrusted or unreadable homes keep the normal reconciliation and refresh path. A trusted host home does not establish ownership of a WSL home.
Why
refreshForCodexAccountChange()clears the current usage view before a forced probe. Running it for an inactive account causes avoidable flicker and provider work. A selection comparison alone is insufficient because an unchanged account ID can still point at an invalid home; the existing ownership check keeps that self-healing path available.Linked Issue
Fixes #24942
This is the separate performance change requested in #11655 (comment).
Visual Proof
N/A — no controls, layout, or styling are added. Automated before/after evidence uses the real runtime-home service: the unchanged trusted-account case invoked a sync before this patch and now invokes neither sync nor quota refresh, while cleanup and cache eviction still occur. Native app footage of the quota display was not recorded.
Testing
Local macOS verification against main at
9a1bef48e4d7:Tests cover inactive host removal with a trusted active home, active removal, a missing ownership marker, system-default selection, a stale WSL selection, and WSL removal with a trusted host home. All test processes use
ORCA_BACKGROUND_LAUNCH=1. The package scripts' local binaries were invoked directly because the workstation's pnpm 12 launcher fails withUnknown system error -8.Native Windows/WSL, a paired SSH runtime, and packaging were not run locally.
AI Disclosure
Implemented with OpenAI Codex (GPT-6), with local automated verification.
Review
Draft: the durability work must land first. #25308 replaces #11655 with removal committed through the existing durable writer before runtime synchronization and credential cleanup. This branch still contains only the separate four-file performance change; it has not been adapted to the replacement yet.
The old integration branch, based on #11655 at
3fa11d53fa96, is retained for history. It uses the superseded Store-preview design and must not be applied to #25308. Its earlier test results do not validate integration with the replacement.After #25308 merges, adapt the performance guard to the actual merged source and revalidate commit-before-delete, pending cleanup/retry, unchanged host usage, active removal, WSL removal and ownership uncertainty before marking this PR ready. The optimization must never skip the durable removal or cleanup record. Durability remains outside this PR's diff.
Agent skill upstream boundary
Notes
No new dependencies, wire fields, processes, or deletion rules. The read-only ownership check runs on the execution host that owns the account store. An inconclusive verdict uses the normal path; it never proves a home absent. The optimization can be reverted independently of account-removal durability.
Checklist