Repository navigation
Conversation
8ae34ad to
d73da52
Compare
|
Rebased onto current |
|
Accounts UI screenshots from an isolated Electron profile ( GrokImported Personal account (Active) GeminiImported Personal account (Active) Source files: https://github.com/rp0927/orca/tree/pr-13276-screenshots |
|
Too many files changed for review (167 files, 100 file limit). Bypass the limit by tagging |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough<hidden_new_layer> The change wires account services, runtime dependencies, IPC registration, launch environment handling, model discovery, settings propagation, and supporting tests across the application.range_e60da6876f23 range_a8f18bd12f0f range_4ee61ad9a05a range_ce4f9e911341 range_fb2e3a8579db range_c82dc8cddb98 range_ad605b6d4587 range_9b936cada65d range_699eb124f12d range_f57b7ecb43c1 range_8f62e047fc4f range_9e005f4751aa range_7bd1a4a4f034 range_b1a8e8f2d321 range_207e2e985849 range_76314f803e5a range_46135f0eb9af range_bdef2c200146 range_f02120377d3b range_11bff238ed21 range_a62f5bf95b3c range_354a35c62969 range_0fe1336839e4 range_382fbc1638ab range_85425f109dc5 range_da20d0e00137 range_54e6ff11fd13 range_3b0fed612c6b range_0c271c1ae6cc range_531fd1e3656d range_056619936f93 range_c9559faba0bc range_e60070dee173 range_45e56f18f07a range_c79f416183bf range_3ba69618df6d range_8685365ebd04 range_6265d9f06096 range_27b2681c8180 range_9876038a13db range_4aeabc40abf2 range_2c68235a6247 range_34dde092a9ac range_dfce4c1b4067 range_6a386bed747b range_2ddbf057a794 range_9b1dd138b8f1 range_fe18b23675d2 range_8ef0d45acd0e range_86cb65e72f6d range_0207d1dc0aa9 range_cc4160792a72 range_ff70dba6d686 range_73b0386b6fcf range_87640dbc0617 range_8e46d90135b9 range_49969edfe4ff range_a4a995df45a7 range_d17b63e9f518 range_4753db39f1a9 range_5ee3a41f73c4 range_af9775a42259 range_92dc1d7e64de range_f7d700fe9077 range_ed2139c36957 range_0632473077a3 range_4c25d6d79428 range_7c564c815394 range_8950d664316e range_a559ba59e67c range_bcd6233d5f83 range_ccd973487592 range_2f03466e0305 range_1c9804a9d6e3 range_efac87f83c7e range_16bb7bc0b4bc range_16e8e81bf575 range_461ebe429f68 range_23466fe2e862 range_7ceebd29638b range_621e10dcb5e9 range_476e49919b6d range_07e8f3ddbd35 range_19b5cefb3414 range_f47c39b1b6fe range_4bfad7f9a13b range_b4c1e1b7bf9c range_80b66e7b75e3 range_576dad6357d1 range_3ed2c7e37f93 range_f722dc9216a9 range_bcc2c434be9c range_0790bd3db492 range_581955b8e9b7 range_e521c454dee2 range_8409d74de899 range_9bb56a484405 range_cc4a86f6e8b6 range_d511f5c517d8 range_e8220509068f range_42ab58b592ea range_fce4fca672b0 range_4d5a4b58658c range_c421d1b70b52 range_a79f4711e3d0 range_d52f273a337d range_d534bbaecf90 range_b984948e5727 range_ad1cff66a123 range_10d1e2c732eb range_06a9fc15a5a5 range_8c0fb0202c88 range_c47c9e4ed1b3 range_f9741f745bd0 range_a52552ddcaa6 range_5d901caf7af2 range_09141f67255d range_52057630c5bb range_aa7e06c15434 range_0ea559aa10b9 range_e083d2281ee1 range_b6a2e44ac224 range_c725932be008 range_9b3878c5d187 range_89e8184e4b3e range_8aa0a3be3187 range_1ad4ba6d355e range_e89f3073900e range_f60e9d7af8fb range_aff30971ce74 range_87f2f149a835 range_00715ac964f8 range_264390556a4c range_b6733bb9da36 range_5c69a265d1d5 range_3dcda6649c2e range_77e1124ca136 range_712a8888ed08 range_7e9ba170642e range_c756dbeb50fc range_3088b2191353 range_522cd1f0ad0a range_b0c5fcf04e66 range_6a35f4338306 range_9bf90f8e07f7 range_4fe3783aa254 range_dfe5340e3f96 range_f093b817f6ee range_2c4e5873e396 range_2fc7793e449a range_d8a01396e10b range_6c2ac2be9ef1 range_cccd66822901 range_b98ff9d2fec4 range_3c35c399a745 range_7c7dbaec1330 range_9187b7ff693f range_85bb7c016128 range_102ab47b5ad6 range_0f8b0bf29e3d range_b659cefd8a36 range_5650ab465c17 range_af2cb1f0c47 range_0e7947d2f8fd range_38ddd6cb7f97 range_b9703b90e650 range_41c88b258cc6 range_f17eeb881657 range_0d639717148b range_9ace194591c4🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 11
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts (1)
63-71: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftKeep model validation scoped to the selected account.
Line 63 accepts a persisted model when any settled PTY lists it. Codex PTYs can now have different account-specific model lists. A model available for
pty-acan therefore remain selected forpty-b, even whenpty-bdoes not support it.Pass the launch discovery scope or account identity into this resolver. Validate the model only against that scope. Do not use another account's discovery result to approve the launch model.
src/renderer/src/runtime/runtime-git-client.ts (1)
698-713: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winValidate PTY ownership before forwarding it to the runtime. Unknown handles fall back to
prepareForCodexLaunch(), which can select the active account home. Reject local PTY IDs for remote targets and require scoped remote IDs to match the target environment before forwarding them.
🟡 Minor comments (10)
src/renderer/src/components/native-chat/use-native-chat-session-options.ts-228-237 (1)
228-237: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winApply cached models to the active surface.
A probe can settle between the render that creates
surfaceand this effect. The subscription does not replay. This branch retires persisted state, but it leavessurfaceon seed models until another event occurs.Call
surface.replaceModels(cached)before retiring the persisted model.Proposed fix
if (cached) { + surface.replaceModels(cached) void retirePersistedModelMissingFromDiscovery(agent, cached).catch(() => undefined) }src/renderer/src/components/settings/ManagedCliHomeAccountsControl.tsx-267-281 (1)
267-281: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winDisable the destructive Remove button while another operation runs.
Every other button in this control passes
disabled={action !== null}. The dialog Remove button does not. If aselectorimportoperation is in flight, the user can still start a removal. Both operations then callsetStatewith their own response, and the later response overwrites the earlier one.KimiAccountsSection.tsxguards the equivalent button at Line 356.🛡️ Proposed fix
<Button variant="destructive" + disabled={action !== null} onClick={() => {src/renderer/src/components/settings/KimiAccountsSection.tsx-25-33 (1)
25-33: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winLocalize the fallback error message.
Line 31 returns a raw English string. This string reaches the UI through the
role="alert"paragraph at Line 223. The sibling controlManagedCliHomeAccountsControl.tsxwraps the same fallback intranslate(...). Usetranslate(...)here for consistency.🌐 Proposed fix
- .trim() || 'Kimi account update failed.' + .trim() || + translate( + 'auto.components.settings.KimiAccountsSection.updateFailed', + 'Kimi account update failed.' + )Add the new key to
src/renderer/src/i18n/locales/en.jsonand runpnpm sync:localization-catalog.Based on learnings, user-facing strings inside settings components must be localized with
translate(...)and the key added toen.json.Source: Learnings
src/renderer/src/components/settings/KimiAccountsSection.tsx-145-162 (1)
145-162: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRemove the duplicated description paragraph.
The key
271d3f21b7renders the same sentence twice: once as theSearchableSettingdescriptionand again in the<p>at Lines 157-162. The user sees the identical sentence two times. Drop the inner paragraph.♻️ Proposed fix
keywords={['kimi', 'account', 'credentials', 'config', 'switch']} className="space-y-3 py-2" > - <p className="text-xs text-muted-foreground"> - {translate( - 'auto.components.settings.KimiAccountsSection.271d3f21b7', - 'Import config.toml and credentials from an existing Kimi Code home. Sessions and logs stay in the original home.' - )} - </p> <div className="space-y-2">Note:
KimiAccountsSection.test.tsxat Lines 95-99 asserts this sentence withgetByText, which fails on duplicate matches today only if both nodes are rendered; verify the test still passes after the change.src/cli/specs/core.ts-236-245 (1)
236-245: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDocument system-account runtime flags as system-only. Both usage strings imply that managed UUID accounts can use
--account-runtimeand--wsl-distro. The runtime rejects that combination because managed accounts already identify their runtime.
src/cli/specs/core.ts#L236-L245: split the UUID and system-account usage forms, or state that runtime flags require--account system.src/cli/help.ts#L246-L246: apply the same system-only constraint in root help.src/main/command-code-accounts/auth-file.ts-37-39 (1)
37-39: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winSeparate the empty-file case from the size-limit message.
The condition covers
info.size <= 0, but the error text reports only the 1 MB limit. An emptyauth.jsonproduces a misleading message.🐛 Split the two checks
- if (info.size <= 0 || info.size > MAX_AUTH_FILE_BYTES) { + if (info.size <= 0) { + throw new Error('Command Code auth.json is empty.') + } + if (info.size > MAX_AUTH_FILE_BYTES) { throw new Error('Command Code auth.json exceeds the 1 MB safety limit.') }src/main/command-code-accounts/launch-environment.ts-19-20 (1)
19-20: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winHandle managed credential resolution failures.
getSelectedApiKeyis called without a catch on both local PTY launch paths. If the selected account or auth file is stale, the eligiblecommand-codelaunch fails instead of usingargs.env. Catch the resolver error and treat it as no managed account selected.src/main/rate-limits/service.ts-805-808 (1)
805-808: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winPropagate the fetch abort signal through the Kimi fetcher.
fetchKimiRateLimitsaccepts onlyhome, so the inactive-account call andfetchKimiWithResolvedHomedropsignal. Add the option and combine it with the existing credential-read and request timeouts.src/main/ipc/settings.ts-109-112 (1)
109-112: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winBroadcast managed-account changes to other windows.
The sanitized
settings:changedupdate removes account rosters and active IDs. Dedicated account handlers return state only to the invoking renderer, and account sections load only on mount. Add a managed-account change event or refetch account state when a window gains focus.src/main/provider-managed-homes/ownership.ts (1)
33-41: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winHandle missing managed roots before canonicalizing ownership paths. The ownership validators check the candidate path but canonicalize the managed root or expected home without first checking that those paths exist. A tampered or stale account can therefore produce a raw filesystem error instead of the intended ownership failure, and callers may expose an absolute managed path. Check the root and expected home first, then return the path-safe domain error.
🧹 Nitpick comments (13)
src/renderer/src/components/settings/ManagedCliHomeAccountsControl.test.tsx (1)
30-59: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse separate mocks per provider so provider routing is covered.
Line 34 assigns the same
grokApiobject togeminiAccounts. The gemini test at Line 50 therefore passes even ifgetApiroutes a gemini request towindow.api.grokAccounts. Credential homes are provider-scoped, so this routing deserves coverage. Add a distinctgeminiApimock.💚 Proposed test change
const grokApi = { list: vi.fn(), import: vi.fn(), select: vi.fn(), remove: vi.fn() } +const geminiApi = { + list: vi.fn(), + import: vi.fn(), + select: vi.fn(), + remove: vi.fn() +} + +const accountsState = { + accounts: [ + { + id: 'grok-a', + provider: 'grok', + label: 'Work', + createdAt: 1, + updatedAt: 1, + lastAuthenticatedAt: 1 + } + ], + activeAccountId: 'grok-a' +} beforeEach(() => { vi.clearAllMocks() - grokApi.list.mockResolvedValue({ - accounts: [ - { - id: 'grok-a', - provider: 'grok', - label: 'Work', - createdAt: 1, - updatedAt: 1, - lastAuthenticatedAt: 1 - } - ], - activeAccountId: 'grok-a' - }) + grokApi.list.mockResolvedValue(accountsState) + geminiApi.list.mockResolvedValue(accountsState) Object.defineProperty(window, 'api', { configurable: true, value: { grokAccounts: grokApi, - geminiAccounts: grokApi + geminiAccounts: geminiApi } }) })Then assert
geminiApi.importin the gemini test and addexpect(grokApi.import).not.toHaveBeenCalled().src/renderer/src/components/settings/ManagedCliHomeAccountsControl.tsx (1)
162-162: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAnnounce the error text to assistive technology.
The error paragraph has no live-region role. Screen readers do not announce the import or removal failure.
KimiAccountsSection.tsxusesrole="alert"at Line 223 for the same purpose.♿ Proposed fix
- {error ? <p className="text-xs text-destructive">{error}</p> : null} + {error ? ( + <p role="alert" className="text-xs text-destructive"> + {error} + </p> + ) : null}src/renderer/src/runtime/runtime-git-client.test.ts (1)
746-763: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for a remote-form PTY id on the local path.
The two new tests cover a remote id on the remote path and a local id on the local path. The guard at
runtime-git-client.tsLine 704 also drops a remote-form id when the target is local. Add a case that passes'remote:env-1@@pty-account-b'withactiveRuntimeEnvironmentId: nulland asserts the local IPC payload contains noptyId.src/main/ipc/pty.test.ts (1)
2169-2202: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for the agent-mismatch rejection.
registerPtyHandlersalso throwsagent_session_account_account_agent_mismatch-style errors whenlaunchAgentis notcodexorproviderAccountRef.provideris notcodex(pty.ts lines 6079-6084). No test exercises that branch. Add one case withlaunchAgent: 'claude'and acodexaccount reference.src/main/ipc/pty.ts (1)
4716-4749: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the repeated managed-provider launch-env application.
The same four calls appear here and again at lines 6460-6493, each repeating
launchAgent,connectionId,runtime: codexSelectionTarget.runtime === 'wsl' ? 'wsl' : 'host', andreattached. A single helper that takes the shared context and the selector callbacks would remove eight near-identical blocks and keep the two spawn paths in sync when a fifth provider is added.♻️ Sketch of the shared helper
// new module, e.g. src/main/provider-managed-homes/apply-launch-env.ts export function applyManagedProviderLaunchEnvs( env: Record<string, string> | undefined, ctx: { launchAgent?: TuiAgent connectionId?: string | null runtime: 'host' | 'wsl' reattached: boolean }, selectors: { getSelectedKimiHomePath?: GetSelectedKimiHomePath getSelectedCommandCodeApiKey?: GetSelectedCommandCodeApiKey getSelectedGrokHomePath?: GetSelectedManagedProviderHomePath getSelectedGeminiHomePath?: GetSelectedManagedProviderHomePath } ): Record<string, string> | undefined { let next = applyKimiManagedHomeToLaunchEnv({ env: next ?? env, ...ctx, getSelectedManagedHomePath: selectors.getSelectedKimiHomePath }) // ...command-code, grok, gemini in the same order return next }src/main/provider-managed-homes/service.test.ts (1)
112-127: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for
renameAccountand for ownership-marker rejection.The suite covers import, select, remove, label and credential validation, and symbolic-link rejection. Two behaviors of the new service remain untested.
renameAccountnormalizes the label and stampsupdatedAt.assertOwnedManagedProviderHomerejects a managed home whose marker content does not match the account ID; that check protects selection and removal. Add one rename case and one case that rewrites the marker file and expectsgetSelectedManagedHomePath()to throw.src/main/provider-managed-homes/service.ts (1)
202-228: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winStop the rollback from deleting a home that settings already reference.
this.store.updateSettings(...)at line 215 persists the account, andthis.listAccounts()at line 216 runs inside the sametry. If any call after line 215 throws, thecatchremovesaccountRoot. Settings then keep an account whose managed home no longer exists, and later selection fails with "does not exist on disk".Track whether the account was persisted and skip the directory removal in that case.
♻️ Proposed reordering
+ let persisted = false try { mkdirSync(pendingRoot, { recursive: false, mode: 0o700 }) @@ this.store.updateSettings(accountSettingsUpdate(this.provider, nextAccounts, id)) + persisted = true return this.listAccounts() } catch (error) { rmSync(pendingRoot, { recursive: true, force: true }) - rmSync(accountRoot, { recursive: true, force: true }) + if (!persisted) { + rmSync(accountRoot, { recursive: true, force: true }) + }src/main/rate-limits/service.ts (2)
470-484: 🚀 Performance & Scalability | 🔵 TrivialA Kimi account switch triggers a full provider refresh.
Line 482 calls
this.fetchAll({ force: true }). Every Kimi account switch therefore re-reads Claude, Codex, Gemini, OpenCode Go, MiniMax, and Grok. The Codex and Claude switch handlers use dedicated lanes (fetchCodexOnly,fetchClaudeOnly) precisely to avoid spending other providers' request budget. Consider adding a Kimi-only cycle and queue flag that mirrorsrunFetchCodexOnlyCycle, so a switch refreshes only the Kimi bar.
770-842: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftConsider one generic inactive-account lane.
fetchInactiveKimiAccountsOnOpenis the third copy of the same algorithm, after the Claude version at lines 595-670 and the Codex version at lines 672-768. The membership check, prune method, cache, fetching set, generation counter, debounce timestamp, and evict method are also triplicated. A single parameterized lane, keyed by a provider descriptor that supplies the resolver, the cache, and the fetch call, would keep the abort and generation guards in one place. Each new managed provider then adds a descriptor instead of about 120 lines.Also applies to: 863-865, 899-926
src/main/kimi-accounts/launch-environment.test.ts (1)
18-40: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a case for a non-Kimi
launchAgent.The table covers SSH, WSL, and reattach. It omits the
launchAgent !== 'kimi'guard. That guard preventsKIMI_CODE_HOMEfrom entering launches of other agents, so it deserves coverage.♻️ Proposed additional table case
it.each([ { name: 'SSH', connectionId: 'ssh-1', runtime: 'host' as const, reattached: false }, { name: 'WSL', connectionId: null, runtime: 'wsl' as const, reattached: false }, - { name: 'reattach', connectionId: null, runtime: 'host' as const, reattached: true } + { name: 'reattach', connectionId: null, runtime: 'host' as const, reattached: true }, + { + name: 'other agent', + connectionId: null, + runtime: 'host' as const, + reattached: false, + launchAgent: 'claude' + } ])( 'does not leak a host managed home into $name launches', - ({ connectionId, runtime, reattached }) => { + ({ connectionId, runtime, reattached, launchAgent = 'kimi' }) => { const resolver = vi.fn(() => '/managed/kimi/account-a/home') const env = { PATH: '/bin' } expect( applyKimiManagedHomeToLaunchEnv({ env, - launchAgent: 'kimi', + launchAgent, connectionId,src/main/kimi-accounts/managed-home-ownership.ts (1)
12-15: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winOne duplicated
isInsidehelper guards two separate security boundaries. Both files define the same path-containment function. Neither copy folds case on win32, unlikepathsEqualinsrc/main/kimi-accounts/managed-home-ownership.ts. A single shared implementation fixes the Windows behavior in both places and prevents the copies from drifting.
src/main/kimi-accounts/managed-home-ownership.ts#L12-L15: replace this copy with a shared import, and fold case on win32 so the system-home containment check at line 39 stays restrictive.src/main/kimi-accounts/managed-home-copy.ts#L21-L24: replace this copy with the same shared import so the import-escape check at line 48 uses identical semantics.Export the shared helper from the
src/main/provider-managed-homes/module that this cohort already adds.src/main/ipc/register-core-handlers.ts (1)
124-127: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winUse a named-options object for
registerCoreHandlers. The function now accepts 22 positional parameters, including two adjacent services with the same type. Named properties would prevent provider-service swaps and simplify future changes.src/main/ipc/usage-provider-handlers.ts (1)
18-38: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winType
accountFilterper provider and retain Codex runtime validation.
CodexUsageStorealready normalizes and rejects malformed filters before its query builders. Use a filter type parameter or a Codex-specific handler contract so Claude and OpenCode do not exposeaccountFilter.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e21df7c4-8a88-458e-a7a0-172155197e0e
📥 Commits
Reviewing files that changed from the base of the PR and between 9a81874 and d73da5211cbde771c0cbb148681df8bce5cee314.
📒 Files selected for processing (153)
src/cli/handlers/account.test.tssrc/cli/handlers/account.tssrc/cli/handlers/terminal.test.tssrc/cli/handlers/terminal.tssrc/cli/help.tssrc/cli/specs/core.tssrc/main/agent-hooks/server.test.tssrc/main/agent-hooks/server.tssrc/main/ai-vault/cached-session-list.test.tssrc/main/ai-vault/cached-session-list.tssrc/main/ai-vault/session-scanner-agent-sources.tssrc/main/ai-vault/session-scanner-kimi-managed.test.tssrc/main/ai-vault/session-scanner-types.tssrc/main/codex-accounts/runtime-home-service.test.tssrc/main/codex-accounts/runtime-home-service.tssrc/main/codex-usage/codex-usage-provider.tssrc/main/codex-usage/scanner-paths.test.tssrc/main/codex-usage/scanner.tssrc/main/codex-usage/store-snapshot.benchmark.test.tssrc/main/codex-usage/store.test.tssrc/main/codex-usage/store.tssrc/main/codex-usage/types.tssrc/main/codex/codex-session-account-attribution.test.tssrc/main/codex/codex-session-account-attribution.tssrc/main/codex/codex-session-account-registry.test.tssrc/main/codex/codex-session-account-registry.tssrc/main/command-code-accounts/auth-file.tssrc/main/command-code-accounts/launch-environment.test.tssrc/main/command-code-accounts/launch-environment.tssrc/main/command-code-accounts/ownership.tssrc/main/command-code-accounts/service.test.tssrc/main/command-code-accounts/service.tssrc/main/index.tssrc/main/ipc/command-code-accounts.test.tssrc/main/ipc/command-code-accounts.tssrc/main/ipc/filesystem.test.tssrc/main/ipc/filesystem.tssrc/main/ipc/gemini-accounts.tssrc/main/ipc/grok-accounts.tssrc/main/ipc/kimi-accounts.test.tssrc/main/ipc/kimi-accounts.tssrc/main/ipc/provider-managed-home-handlers.test.tssrc/main/ipc/provider-managed-home-handlers.tssrc/main/ipc/pty.test.tssrc/main/ipc/pty.tssrc/main/ipc/rate-limits.test.tssrc/main/ipc/rate-limits.tssrc/main/ipc/register-core-handlers.test.tssrc/main/ipc/register-core-handlers.tssrc/main/ipc/settings.test.tssrc/main/ipc/settings.tssrc/main/ipc/usage-provider-handlers.test.tssrc/main/ipc/usage-provider-handlers.tssrc/main/kimi-accounts/launch-environment.test.tssrc/main/kimi-accounts/launch-environment.tssrc/main/kimi-accounts/login-runner.test.tssrc/main/kimi-accounts/login-runner.tssrc/main/kimi-accounts/managed-home-copy.tssrc/main/kimi-accounts/managed-home-ownership.tssrc/main/kimi-accounts/managed-login-provisioning.tssrc/main/kimi-accounts/service.test.tssrc/main/kimi-accounts/service.tssrc/main/kimi/hook-service.test.tssrc/main/kimi/hook-service.tssrc/main/provider-managed-homes/credential-scope.tssrc/main/provider-managed-homes/launch-environment.test.tssrc/main/provider-managed-homes/launch-environment.tssrc/main/provider-managed-homes/ownership.test.tssrc/main/provider-managed-homes/ownership.tssrc/main/provider-managed-homes/service.test.tssrc/main/provider-managed-homes/service.tssrc/main/rate-limits/service.test.tssrc/main/rate-limits/service.tssrc/main/runtime/orca-runtime-agent-session-operation.test.tssrc/main/runtime/orca-runtime-git.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/agent-session.test.tssrc/main/runtime/rpc/methods/agent-session.tssrc/main/runtime/rpc/methods/ai-vault.test.tssrc/main/runtime/rpc/methods/git-params.tssrc/main/runtime/rpc/methods/git.test.tssrc/main/runtime/rpc/methods/git.tssrc/main/text-generation/commit-message-agent-environment.test.tssrc/main/text-generation/commit-message-agent-environment.tssrc/main/usage/usage-event-aggregation.tssrc/main/usage/usage-provider-contract.tssrc/main/usage/usage-rollup-merge.tssrc/main/usage/usage-rollup-records.tssrc/main/window/attach-main-window-services.tssrc/preload/api-types.tssrc/preload/index.tssrc/preload/usage-provider-api.tssrc/renderer/src/components/native-chat/native-chat-session-option-discovery.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.tssrc/renderer/src/components/native-chat/use-native-chat-session-options.tssrc/renderer/src/components/settings/AccountsPane.test.tsxsrc/renderer/src/components/settings/AccountsPane.tsxsrc/renderer/src/components/settings/CommandCodeAccountsSection.test.tsxsrc/renderer/src/components/settings/CommandCodeAccountsSection.tsxsrc/renderer/src/components/settings/GrokAccountsSection.tsxsrc/renderer/src/components/settings/KimiAccountsSection.test.tsxsrc/renderer/src/components/settings/KimiAccountsSection.tsxsrc/renderer/src/components/settings/ManagedCliHomeAccountsControl.test.tsxsrc/renderer/src/components/settings/ManagedCliHomeAccountsControl.tsxsrc/renderer/src/components/settings/accounts-search.tssrc/renderer/src/components/stats/CodexUsagePane.tsxsrc/renderer/src/components/stats/codex-usage-account-filter.test.tssrc/renderer/src/components/stats/codex-usage-account-filter.tssrc/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsxsrc/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsxsrc/renderer/src/components/tab-bar/QuickLaunchButton.test.tssrc/renderer/src/components/tab-bar/QuickLaunchButton.tsxsrc/renderer/src/components/tab-bar/codex-launch-account-options.test.tssrc/renderer/src/components/tab-bar/codex-launch-account-options.tssrc/renderer/src/components/terminal-pane/pty-connection-types.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/components/terminal-pane/pty-transport-types.tssrc/renderer/src/components/terminal-pane/pty-transport.test.tssrc/renderer/src/components/terminal-pane/pty-transport.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/launch-agent-in-new-tab.test.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/lib/runtime-agent-background-create.tssrc/renderer/src/runtime/remote-agent-session-launch.test.tssrc/renderer/src/runtime/remote-agent-session-launch.tssrc/renderer/src/runtime/runtime-git-client.test.tssrc/renderer/src/runtime/runtime-git-client.tssrc/renderer/src/runtime/web-runtime-session.tssrc/renderer/src/store/slices/rate-limits.tssrc/renderer/src/store/slices/terminals.tssrc/renderer/src/store/slices/usage-provider-slices.tssrc/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.tssrc/renderer/src/web/web-preload-api.tssrc/shared/agent-session-host-authority.tssrc/shared/agent-session-option-catalog-claude-codex.tssrc/shared/agent-session-option-catalog.test.tssrc/shared/agent-session-option-catalog.tssrc/shared/codex-model-list-probe.test.tssrc/shared/codex-model-list-probe.tssrc/shared/codex-usage-account-filter-contract.test.tssrc/shared/codex-usage-account-filter-contract.tssrc/shared/codex-usage-types.tssrc/shared/commit-message-agent-spec.tssrc/shared/constants.tssrc/shared/protocol-version.tssrc/shared/provider-account-ref.test.tssrc/shared/provider-account-ref.tssrc/shared/rate-limit-types.tssrc/shared/types.ts
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b4af6de0-75d1-4156-9581-3818e2e17bb9
📥 Commits
Reviewing files that changed from the base of the PR and between d73da5211cbde771c0cbb148681df8bce5cee314 and 255db1de159a168b73a550a0b68cdf3b2e964b0f.
📒 Files selected for processing (24)
src/cli/help.tssrc/cli/specs/core.tssrc/main/command-code-accounts/service.test.tssrc/main/command-code-accounts/service.tssrc/main/index.tssrc/main/kimi-accounts/login-runner.test.tssrc/main/kimi-accounts/login-runner.tssrc/main/kimi-accounts/managed-login-provisioning.tssrc/main/kimi-accounts/service.test.tssrc/main/kimi-accounts/service.tssrc/main/provider-managed-homes/credential-scope.tssrc/main/provider-managed-homes/service.test.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/provider-account-workspace-scope.test.tssrc/main/runtime/provider-account-workspace-scope.tssrc/main/runtime/rpc/methods/agent-session.tssrc/main/usage/usage-event-aggregation.test.tssrc/main/usage/usage-event-aggregation.tssrc/renderer/src/components/settings/KimiAccountsSection.test.tsxsrc/renderer/src/components/tab-bar/codex-launch-account-options.test.tssrc/renderer/src/components/tab-bar/codex-launch-account-options.tssrc/renderer/src/store/slices/usage-provider-account-filter.test.tssrc/renderer/src/store/slices/usage-provider-slices.tssrc/shared/types.ts
💤 Files with no reviewable changes (1)
- src/renderer/src/components/settings/KimiAccountsSection.test.tsx
🚧 Files skipped from review as they are similar to previous changes (16)
- src/cli/help.ts
- src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
- src/main/kimi-accounts/service.test.ts
- src/cli/specs/core.ts
- src/main/provider-managed-homes/credential-scope.ts
- src/renderer/src/components/tab-bar/codex-launch-account-options.ts
- src/shared/types.ts
- src/main/runtime/orca-runtime.ts
- src/main/provider-managed-homes/service.test.ts
- src/main/runtime/rpc/methods/agent-session.ts
- src/main/command-code-accounts/service.ts
- src/main/kimi-accounts/managed-login-provisioning.ts
- src/main/usage/usage-event-aggregation.ts
- src/renderer/src/store/slices/usage-provider-slices.ts
- src/main/kimi-accounts/service.ts
- src/main/index.ts
|
Cross-linking #13839 for coordination. That PR fixes Grok Usage auth resolution for Orca's configured Windows host/WSL runtime. It does not change managed-home launch selection or claim per-managed-account usage attribution. #13276 and #13839 touch some of the same Grok account/IPC/service wiring but have separate responsibilities. Please keep the runtime-aware system-default Usage path intact if this managed-home stack lands first. |
4356a77 to
3979378
Compare
|
Rebased onto current @euclodius thanks for the #13839 pointer. This stack still does not claim per-managed-account Grok usage attribution. Conflict resolutions in this rebase kept main's Codex effort-ceiling catalog and newer settings copy, and added the stacked account-home/IPC pieces on top. Localization keys were merged rather than dropped. |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
src/main/codex-accounts/runtime-home-service.ts (1)
297-307: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftSeed the shared mirror from the system default for explicit host system-default launches.
When
accountId === nulland the real-home lane is unavailable,syncForCurrentSelection({ runtime: 'host' })returns through the globally selected self-contained managed account path. The shared mirror therefore keeps stale managed or missing auth while this branch returns its path.
🧹 Nitpick comments (3)
src/main/ipc/kimi-accounts.ts (1)
5-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated
isBoundedTextvalidator in two new account IPC modules. Both files define the same bounded-text rule for IPC input, so the two copies can drift and a fix applied to one file leaves the other unprotected. Extract one implementation into a concretely named module, for examplesrc/main/ipc/account-input-validation.ts.
src/main/ipc/kimi-accounts.ts#L5-L13: remove the local definition and import the shared validator.src/main/ipc/provider-managed-home-handlers.ts#L4-L12: remove the local definition and import the same shared validator.src/main/provider-managed-homes/service.test.ts (1)
86-93: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMake the credential non-disclosure assertion effective for Gemini.
Line 90 asserts that the serialized state does not contain
secret. Only the Grok fixture writes a value containingsecret(Line 39). For Gemini the fixture tokens areaccessandrefresh, so the assertion cannot fail and gives no coverage. Assert the provider's own secret markers.♻️ Proposed test change
- expect(JSON.stringify(state)).not.toContain('secret') + const secretMarkers = provider === 'grok' ? ['grok-secret'] : ['access', 'refresh'] + for (const marker of secretMarkers) { + expect(JSON.stringify(state)).not.toContain(marker) + }src/main/rate-limits/service.ts (1)
770-842: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftExtract the inactive-account fetch, prune, and evict machinery into one provider-parameterized helper.
fetchInactiveKimiAccountsOnOpenis the third near-identical copy of this loop, afterfetchInactiveClaudeAccountsOnOpen(Lines 595-670) andfetchInactiveCodexAccountsOnOpen(Lines 672-768).pruneInactiveKimiState(Lines 899-913) andevictInactiveKimiCache(Lines 922-926) repeat the same pattern again. The differences per provider are small: the cache, the fetching set, the generation counter, the debounce timestamp, the optional stagger delay, and the fetch call.Group the per-provider state into one record and drive the shared loop from it. This removes three copies of the abort, generation, membership, and cleanup checks, where a fix currently must be applied three times.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c30e7cd0-2ad4-4b40-992d-665294a6aed1
📥 Commits
Reviewing files that changed from the base of the PR and between 400321e and 3979378856f80c34730c421b84e3005e3ceccf69.
📒 Files selected for processing (157)
src/cli/handlers/account.test.tssrc/cli/handlers/account.tssrc/cli/handlers/terminal.test.tssrc/cli/handlers/terminal.tssrc/cli/help.tssrc/cli/specs/core.tssrc/main/agent-hooks/server.test.tssrc/main/agent-hooks/server.tssrc/main/ai-vault/cached-session-list.test.tssrc/main/ai-vault/cached-session-list.tssrc/main/ai-vault/session-scanner-agent-sources.tssrc/main/ai-vault/session-scanner-kimi-managed.test.tssrc/main/ai-vault/session-scanner-types.tssrc/main/codex-accounts/runtime-home-service.test.tssrc/main/codex-accounts/runtime-home-service.tssrc/main/codex-usage/codex-usage-provider.tssrc/main/codex-usage/scanner-paths.test.tssrc/main/codex-usage/scanner.tssrc/main/codex-usage/store-snapshot.benchmark.test.tssrc/main/codex-usage/store.test.tssrc/main/codex-usage/store.tssrc/main/codex-usage/types.tssrc/main/codex/codex-session-account-attribution.test.tssrc/main/codex/codex-session-account-attribution.tssrc/main/codex/codex-session-account-registry.test.tssrc/main/codex/codex-session-account-registry.tssrc/main/command-code-accounts/auth-file.tssrc/main/command-code-accounts/launch-environment.test.tssrc/main/command-code-accounts/launch-environment.tssrc/main/command-code-accounts/ownership.tssrc/main/command-code-accounts/service.test.tssrc/main/command-code-accounts/service.tssrc/main/index.tssrc/main/ipc/command-code-accounts.test.tssrc/main/ipc/command-code-accounts.tssrc/main/ipc/filesystem.test.tssrc/main/ipc/filesystem.tssrc/main/ipc/gemini-accounts.tssrc/main/ipc/grok-accounts.tssrc/main/ipc/kimi-accounts.test.tssrc/main/ipc/kimi-accounts.tssrc/main/ipc/provider-managed-home-handlers.test.tssrc/main/ipc/provider-managed-home-handlers.tssrc/main/ipc/pty.test.tssrc/main/ipc/pty.tssrc/main/ipc/rate-limits.test.tssrc/main/ipc/rate-limits.tssrc/main/ipc/register-core-handlers.test.tssrc/main/ipc/register-core-handlers.tssrc/main/ipc/settings.test.tssrc/main/ipc/settings.tssrc/main/ipc/usage-provider-handlers.test.tssrc/main/ipc/usage-provider-handlers.tssrc/main/kimi-accounts/launch-environment.test.tssrc/main/kimi-accounts/launch-environment.tssrc/main/kimi-accounts/login-runner.test.tssrc/main/kimi-accounts/login-runner.tssrc/main/kimi-accounts/managed-home-copy.tssrc/main/kimi-accounts/managed-home-ownership.tssrc/main/kimi-accounts/managed-login-provisioning.tssrc/main/kimi-accounts/service.test.tssrc/main/kimi-accounts/service.tssrc/main/kimi/hook-service.test.tssrc/main/kimi/hook-service.tssrc/main/provider-managed-homes/credential-scope.tssrc/main/provider-managed-homes/launch-environment.test.tssrc/main/provider-managed-homes/launch-environment.tssrc/main/provider-managed-homes/ownership.test.tssrc/main/provider-managed-homes/ownership.tssrc/main/provider-managed-homes/service.test.tssrc/main/provider-managed-homes/service.tssrc/main/rate-limits/service.test.tssrc/main/rate-limits/service.tssrc/main/runtime/orca-runtime-agent-session-operation.test.tssrc/main/runtime/orca-runtime-git.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/provider-account-workspace-scope.test.tssrc/main/runtime/provider-account-workspace-scope.tssrc/main/runtime/rpc/methods/agent-session.test.tssrc/main/runtime/rpc/methods/agent-session.tssrc/main/runtime/rpc/methods/ai-vault.test.tssrc/main/runtime/rpc/methods/git-params.tssrc/main/runtime/rpc/methods/git.test.tssrc/main/runtime/rpc/methods/git.tssrc/main/text-generation/commit-message-agent-environment.test.tssrc/main/text-generation/commit-message-agent-environment.tssrc/main/usage/usage-event-aggregation.test.tssrc/main/usage/usage-event-aggregation.tssrc/main/usage/usage-provider-contract.tssrc/main/usage/usage-rollup-merge.tssrc/main/usage/usage-rollup-records.tssrc/main/window/attach-main-window-services.tssrc/preload/api-types.tssrc/preload/index.tssrc/preload/usage-provider-api.tssrc/renderer/src/components/native-chat/native-chat-session-option-discovery.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.tssrc/renderer/src/components/native-chat/use-native-chat-session-options.tssrc/renderer/src/components/settings/AccountsPane.test.tsxsrc/renderer/src/components/settings/AccountsPane.tsxsrc/renderer/src/components/settings/CommandCodeAccountsSection.test.tsxsrc/renderer/src/components/settings/CommandCodeAccountsSection.tsxsrc/renderer/src/components/settings/GrokAccountsSection.tsxsrc/renderer/src/components/settings/KimiAccountsSection.test.tsxsrc/renderer/src/components/settings/KimiAccountsSection.tsxsrc/renderer/src/components/settings/ManagedCliHomeAccountsControl.test.tsxsrc/renderer/src/components/settings/ManagedCliHomeAccountsControl.tsxsrc/renderer/src/components/settings/accounts-search.tssrc/renderer/src/components/stats/CodexUsagePane.tsxsrc/renderer/src/components/stats/codex-usage-account-filter.test.tssrc/renderer/src/components/stats/codex-usage-account-filter.tssrc/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsxsrc/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsxsrc/renderer/src/components/tab-bar/QuickLaunchButton.test.tssrc/renderer/src/components/tab-bar/QuickLaunchButton.tsxsrc/renderer/src/components/tab-bar/codex-launch-account-options.test.tssrc/renderer/src/components/tab-bar/codex-launch-account-options.tssrc/renderer/src/components/terminal-pane/pty-connection-types.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/components/terminal-pane/pty-transport-types.tssrc/renderer/src/components/terminal-pane/pty-transport.test.tssrc/renderer/src/components/terminal-pane/pty-transport.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/launch-agent-in-new-tab.test.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/lib/runtime-agent-background-create.tssrc/renderer/src/runtime/remote-agent-session-launch.test.tssrc/renderer/src/runtime/remote-agent-session-launch.tssrc/renderer/src/runtime/runtime-git-client.test.tssrc/renderer/src/runtime/runtime-git-client.tssrc/renderer/src/runtime/web-runtime-session.tssrc/renderer/src/store/slices/rate-limits.tssrc/renderer/src/store/slices/terminals.tssrc/renderer/src/store/slices/usage-provider-account-filter.test.tssrc/renderer/src/store/slices/usage-provider-slices.tssrc/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.tssrc/renderer/src/web/web-preload-api.tssrc/shared/agent-session-host-authority.tssrc/shared/agent-session-option-catalog-claude-codex.tssrc/shared/agent-session-option-catalog.test.tssrc/shared/agent-session-option-catalog.tssrc/shared/codex-model-list-probe.test.tssrc/shared/codex-model-list-probe.tssrc/shared/codex-usage-account-filter-contract.test.tssrc/shared/codex-usage-account-filter-contract.tssrc/shared/codex-usage-types.tssrc/shared/commit-message-agent-spec.tssrc/shared/constants.tssrc/shared/protocol-version.tssrc/shared/provider-account-ref.test.tssrc/shared/provider-account-ref.tssrc/shared/rate-limit-types.tssrc/shared/types.ts
🚧 Files skipped from review as they are similar to previous changes (149)
- src/cli/handlers/account.test.ts
- src/cli/specs/core.ts
- src/shared/codex-usage-account-filter-contract.test.ts
- src/main/codex-usage/codex-usage-provider.ts
- src/main/ai-vault/session-scanner-types.ts
- src/main/usage/usage-provider-contract.ts
- src/shared/rate-limit-types.ts
- src/renderer/src/components/terminal-pane/pty-connection-types.ts
- src/renderer/src/components/stats/codex-usage-account-filter.test.ts
- src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
- src/main/ipc/gemini-accounts.ts
- src/main/ai-vault/session-scanner-kimi-managed.test.ts
- src/main/codex/codex-session-account-registry.test.ts
- src/renderer/src/runtime/runtime-git-client.test.ts
- src/shared/provider-account-ref.test.ts
- src/main/agent-hooks/server.test.ts
- src/main/runtime/rpc/methods/ai-vault.test.ts
- src/main/ipc/usage-provider-handlers.test.ts
- src/main/runtime/rpc/methods/git-params.ts
- src/main/usage/usage-event-aggregation.test.ts
- src/renderer/src/components/terminal-pane/pty-transport-types.ts
- src/main/ai-vault/cached-session-list.ts
- src/main/agent-hooks/server.ts
- src/main/kimi/hook-service.test.ts
- src/main/codex-usage/types.ts
- src/main/usage/usage-rollup-merge.ts
- src/renderer/src/components/settings/GrokAccountsSection.tsx
- src/main/command-code-accounts/auth-file.ts
- src/shared/commit-message-agent-spec.ts
- src/main/ipc/settings.ts
- src/main/runtime/rpc/methods/git.ts
- src/renderer/src/components/settings/AccountsPane.test.tsx
- src/main/runtime/rpc/methods/git.test.ts
- src/main/usage/usage-event-aggregation.ts
- src/main/ipc/command-code-accounts.test.ts
- src/main/provider-managed-homes/ownership.test.ts
- src/shared/codex-model-list-probe.test.ts
- src/shared/codex-usage-account-filter-contract.ts
- src/renderer/src/store/slices/terminals.ts
- src/main/text-generation/commit-message-agent-environment.test.ts
- src/renderer/src/lib/runtime-agent-background-create.ts
- src/renderer/src/store/slices/rate-limits.ts
- src/shared/provider-account-ref.ts
- src/main/provider-managed-homes/launch-environment.test.ts
- src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
- src/cli/help.ts
- src/shared/agent-session-option-catalog.ts
- src/main/runtime/provider-account-workspace-scope.test.ts
- src/main/runtime/orca-runtime-git.ts
- src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
- src/renderer/src/components/terminal-pane/pty-transport.test.ts
- src/main/codex-usage/store-snapshot.benchmark.test.ts
- src/shared/protocol-version.ts
- src/main/ai-vault/cached-session-list.test.ts
- src/main/codex/codex-session-account-attribution.test.ts
- src/renderer/src/components/stats/codex-usage-account-filter.ts
- src/main/text-generation/commit-message-agent-environment.ts
- src/renderer/src/components/settings/CommandCodeAccountsSection.test.tsx
- src/main/runtime/provider-account-workspace-scope.ts
- src/renderer/src/components/settings/ManagedCliHomeAccountsControl.tsx
- src/shared/agent-session-host-authority.ts
- src/main/kimi-accounts/login-runner.test.ts
- src/main/command-code-accounts/service.ts
- src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
- src/main/ipc/usage-provider-handlers.ts
- src/renderer/src/runtime/remote-agent-session-launch.test.ts
- src/renderer/src/components/tab-bar/codex-launch-account-options.ts
- src/main/codex-usage/scanner.ts
- src/main/ipc/grok-accounts.ts
- src/renderer/src/components/settings/KimiAccountsSection.tsx
- src/main/kimi-accounts/launch-environment.test.ts
- src/main/rate-limits/service.test.ts
- src/main/kimi-accounts/managed-home-copy.ts
- src/main/ipc/command-code-accounts.ts
- src/main/command-code-accounts/ownership.ts
- src/main/command-code-accounts/launch-environment.ts
- src/renderer/src/lib/launch-agent-in-new-tab.ts
- src/renderer/src/components/settings/accounts-search.ts
- src/renderer/src/components/settings/ManagedCliHomeAccountsControl.test.tsx
- src/main/codex-usage/scanner-paths.test.ts
- src/renderer/src/i18n/locales/en.json
- src/main/command-code-accounts/launch-environment.test.ts
- src/shared/agent-session-option-catalog-claude-codex.ts
- src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
- src/renderer/src/components/terminal-pane/pty-transport.ts
- src/cli/handlers/terminal.test.ts
- src/main/ipc/register-core-handlers.test.ts
- src/renderer/src/runtime/web-runtime-session.ts
- src/main/window/attach-main-window-services.ts
- src/renderer/src/runtime/remote-agent-session-launch.ts
- src/shared/codex-usage-types.ts
- src/main/kimi-accounts/launch-environment.ts
- src/shared/constants.ts
- src/main/usage/usage-rollup-records.ts
- src/main/codex-usage/store.test.ts
- src/renderer/src/web/web-preload-api.ts
- src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
- src/renderer/src/runtime/runtime-git-client.ts
- src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
- src/renderer/src/components/settings/CommandCodeAccountsSection.tsx
- src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
- src/main/ipc/settings.test.ts
- src/main/ipc/filesystem.ts
- src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
- src/renderer/src/components/settings/KimiAccountsSection.test.tsx
- src/main/command-code-accounts/service.test.ts
- src/renderer/src/lib/launch-agent-web-host-tab.ts
- src/main/provider-managed-homes/launch-environment.ts
- src/main/ipc/filesystem.test.ts
- src/main/ipc/pty.test.ts
- src/main/runtime/orca-runtime-agent-session-operation.test.ts
- src/main/provider-managed-homes/ownership.ts
- src/main/codex-accounts/runtime-home-service.test.ts
- src/shared/codex-model-list-probe.ts
- src/main/runtime/orca-runtime.ts
- src/main/provider-managed-homes/credential-scope.ts
- src/main/kimi-accounts/managed-home-ownership.ts
- src/main/runtime/rpc/methods/agent-session.test.ts
- src/renderer/src/components/stats/CodexUsagePane.tsx
- src/main/ipc/provider-managed-home-handlers.test.ts
- src/cli/handlers/terminal.ts
- src/main/kimi-accounts/service.test.ts
- src/main/codex/codex-session-account-registry.ts
- src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
- src/main/ipc/rate-limits.test.ts
- src/renderer/src/store/slices/usage-provider-account-filter.test.ts
- src/main/provider-managed-homes/service.ts
- src/renderer/src/lib/launch-agent-in-new-tab.test.ts
- src/renderer/src/components/settings/AccountsPane.tsx
- src/shared/types.ts
- src/main/ipc/kimi-accounts.test.ts
- src/preload/usage-provider-api.ts
- src/preload/index.ts
- src/main/ipc/register-core-handlers.ts
- src/preload/api-types.ts
- src/shared/agent-session-option-catalog.test.ts
- src/renderer/src/components/terminal-pane/pty-connection.ts
- src/main/codex-usage/store.ts
- src/main/kimi/hook-service.ts
- src/main/runtime/rpc/methods/agent-session.ts
- src/main/ai-vault/session-scanner-agent-sources.ts
- src/renderer/src/components/native-chat/use-native-chat-session-options.ts
- src/renderer/src/store/slices/usage-provider-slices.ts
- src/main/ipc/pty.ts
- src/main/kimi-accounts/service.ts
- src/main/kimi-accounts/managed-login-provisioning.ts
- src/main/index.ts
- src/main/ipc/rate-limits.ts
- src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
3979378 to
68edfab
Compare
|
Rebased again onto current Also added the #13272 CodeRabbit coverage for empty/ |
68edfab to
5923fc5
Compare
|
Follow-up: restacked again onto |
e7697b8 to
13fd22c
Compare
|
Latest CodeRabbit full reviews (the 03:56 notification batch) are addressed on tip Applied on this push:
Already on Left as-is, with thread replies:
Stack still targets |
99fca34 to
82763dc
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Restacked onto current Conflict resolutions kept main’s per-module type imports. Managed-account types stay in Also addressed the latest CodeRabbit login-runner follow-up on tip All eight PRs are mergeable against current main. CI remains gated until a |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/main/rate-limits/kimi-fetcher.test.ts (1)
196-204: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winProve caller cancellation reaches the request signal.
The assertion at Line 199 also passes when the implementation uses only the timeout signal. Abort
controllerafternet.fetchreceivesinit.signal. Then assert thatinit.signal.abortedbecomestrue.Suggested test update
+ const controller = new AbortController() netFetchMock.mockImplementationOnce((_url, init?: RequestInit) => { expect(init?.signal).toBeInstanceOf(AbortSignal) + expect(init?.signal?.aborted).toBe(false) + controller.abort() + expect(init?.signal?.aborted).toBe(true) return jsonResponse(USAGE_RESPONSE) }) - - const controller = new AbortController()
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 72c3c26a-0c04-4a0c-8db3-dca50f7e2758
📥 Commits
Reviewing files that changed from the base of the PR and between cb42b60 and 82763dc2f44e6e58a4e9c3df6822359fa2d2ba16.
📒 Files selected for processing (166)
src/cli/handlers/account.test.tssrc/cli/handlers/account.tssrc/cli/handlers/terminal.test.tssrc/cli/handlers/terminal.tssrc/cli/help.tssrc/cli/specs/core.tssrc/main/agent-hooks/server.test.tssrc/main/agent-hooks/server.tssrc/main/ai-vault/cached-session-list.test.tssrc/main/ai-vault/cached-session-list.tssrc/main/ai-vault/session-scanner-agent-sources.tssrc/main/ai-vault/session-scanner-kimi-managed.test.tssrc/main/ai-vault/session-scanner-types.tssrc/main/codex-accounts/runtime-home-service.test.tssrc/main/codex-accounts/runtime-home-service.tssrc/main/codex-usage/codex-usage-provider.tssrc/main/codex-usage/scanner-paths.test.tssrc/main/codex-usage/scanner.tssrc/main/codex-usage/store-snapshot.benchmark.test.tssrc/main/codex-usage/store.test.tssrc/main/codex-usage/store.tssrc/main/codex-usage/types.tssrc/main/codex/codex-session-account-attribution.test.tssrc/main/codex/codex-session-account-attribution.tssrc/main/codex/codex-session-account-registry.test.tssrc/main/codex/codex-session-account-registry.tssrc/main/command-code-accounts/auth-file.tssrc/main/command-code-accounts/launch-environment.test.tssrc/main/command-code-accounts/launch-environment.tssrc/main/command-code-accounts/ownership.tssrc/main/command-code-accounts/service.test.tssrc/main/command-code-accounts/service.tssrc/main/index.tssrc/main/ipc/bounded-account-text.tssrc/main/ipc/command-code-accounts.test.tssrc/main/ipc/command-code-accounts.tssrc/main/ipc/filesystem.test.tssrc/main/ipc/filesystem.tssrc/main/ipc/gemini-accounts.tssrc/main/ipc/grok-accounts.tssrc/main/ipc/kimi-accounts.test.tssrc/main/ipc/kimi-accounts.tssrc/main/ipc/provider-managed-home-handlers.test.tssrc/main/ipc/provider-managed-home-handlers.tssrc/main/ipc/pty.test.tssrc/main/ipc/pty.tssrc/main/ipc/rate-limits.test.tssrc/main/ipc/rate-limits.tssrc/main/ipc/register-core-handlers.test.tssrc/main/ipc/register-core-handlers.tssrc/main/ipc/settings.test.tssrc/main/ipc/settings.tssrc/main/ipc/usage-provider-handlers.test.tssrc/main/ipc/usage-provider-handlers.tssrc/main/kimi-accounts/launch-environment.test.tssrc/main/kimi-accounts/launch-environment.tssrc/main/kimi-accounts/login-runner.test.tssrc/main/kimi-accounts/login-runner.tssrc/main/kimi-accounts/managed-home-copy.tssrc/main/kimi-accounts/managed-home-ownership.tssrc/main/kimi-accounts/managed-login-provisioning.tssrc/main/kimi-accounts/service.test.tssrc/main/kimi-accounts/service.tssrc/main/kimi/hook-service.test.tssrc/main/kimi/hook-service.tssrc/main/provider-managed-homes/credential-scope.tssrc/main/provider-managed-homes/launch-environment.test.tssrc/main/provider-managed-homes/launch-environment.tssrc/main/provider-managed-homes/ownership.test.tssrc/main/provider-managed-homes/ownership.tssrc/main/provider-managed-homes/service.test.tssrc/main/provider-managed-homes/service.tssrc/main/rate-limits/kimi-fetcher.test.tssrc/main/rate-limits/kimi-fetcher.tssrc/main/rate-limits/service.test.tssrc/main/rate-limits/service.tssrc/main/runtime/orca-runtime-agent-session-operation.test.tssrc/main/runtime/orca-runtime-git.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/provider-account-workspace-scope.test.tssrc/main/runtime/provider-account-workspace-scope.tssrc/main/runtime/rpc/methods/agent-session.test.tssrc/main/runtime/rpc/methods/agent-session.tssrc/main/runtime/rpc/methods/ai-vault.test.tssrc/main/runtime/rpc/methods/git-params.tssrc/main/runtime/rpc/methods/git.test.tssrc/main/runtime/rpc/methods/git.tssrc/main/text-generation/commit-message-agent-environment.test.tssrc/main/text-generation/commit-message-agent-environment.tssrc/main/usage/usage-event-aggregation.test.tssrc/main/usage/usage-event-aggregation.tssrc/main/usage/usage-provider-contract.tssrc/main/usage/usage-rollup-merge.tssrc/main/usage/usage-rollup-records.tssrc/main/window/attach-main-window-services.tssrc/preload/api-types.tssrc/preload/api/agent-account-api.tssrc/preload/api/agent-usage-api.tssrc/preload/api/git-inspection-api.tssrc/preload/api/pty-api.tssrc/preload/index.tssrc/preload/usage-provider-api.tssrc/renderer/src/components/native-chat/native-chat-session-option-discovery.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.tssrc/renderer/src/components/native-chat/use-native-chat-session-options.tssrc/renderer/src/components/settings/AccountsPane.test.tsxsrc/renderer/src/components/settings/AccountsPane.tsxsrc/renderer/src/components/settings/CommandCodeAccountsSection.test.tsxsrc/renderer/src/components/settings/CommandCodeAccountsSection.tsxsrc/renderer/src/components/settings/GrokAccountsSection.tsxsrc/renderer/src/components/settings/KimiAccountsSection.test.tsxsrc/renderer/src/components/settings/KimiAccountsSection.tsxsrc/renderer/src/components/settings/ManagedCliHomeAccountsControl.test.tsxsrc/renderer/src/components/settings/ManagedCliHomeAccountsControl.tsxsrc/renderer/src/components/settings/accounts-search.tssrc/renderer/src/components/stats/CodexUsagePane.tsxsrc/renderer/src/components/stats/codex-usage-account-filter.test.tssrc/renderer/src/components/stats/codex-usage-account-filter.tssrc/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsxsrc/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsxsrc/renderer/src/components/tab-bar/QuickLaunchButton.test.tssrc/renderer/src/components/tab-bar/QuickLaunchButton.tsxsrc/renderer/src/components/tab-bar/codex-launch-account-options.test.tssrc/renderer/src/components/tab-bar/codex-launch-account-options.tssrc/renderer/src/components/terminal-pane/pty-connection-types.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/components/terminal-pane/pty-transport-types.tssrc/renderer/src/components/terminal-pane/pty-transport.test.tssrc/renderer/src/components/terminal-pane/pty-transport.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/launch-agent-in-new-tab.test.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/lib/runtime-agent-background-create.tssrc/renderer/src/runtime/remote-agent-session-launch.test.tssrc/renderer/src/runtime/remote-agent-session-launch.tssrc/renderer/src/runtime/runtime-git-client.test.tssrc/renderer/src/runtime/runtime-git-client.tssrc/renderer/src/runtime/web-runtime-session.tssrc/renderer/src/store/slices/rate-limits.tssrc/renderer/src/store/slices/terminals.tssrc/renderer/src/store/slices/usage-provider-account-filter.test.tssrc/renderer/src/store/slices/usage-provider-slices.tssrc/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.tssrc/renderer/src/web/web-preload-api.tssrc/shared/agent-session-host-authority.tssrc/shared/agent-session-option-catalog-claude-codex.tssrc/shared/agent-session-option-catalog.test.tssrc/shared/agent-session-option-catalog.tssrc/shared/codex-model-list-probe.test.tssrc/shared/codex-model-list-probe.tssrc/shared/codex-usage-account-filter-contract.test.tssrc/shared/codex-usage-account-filter-contract.tssrc/shared/codex-usage-types.tssrc/shared/commit-message-agent-spec.tssrc/shared/constants.tssrc/shared/global-settings-types.tssrc/shared/managed-account-types.tssrc/shared/protocol-version.tssrc/shared/provider-account-ref.test.tssrc/shared/provider-account-ref.tssrc/shared/rate-limit-types.tssrc/shared/worktree/launch-types.ts
🚧 Files skipped from review as they are similar to previous changes (147)
- src/main/ai-vault/session-scanner-types.ts
- src/renderer/src/components/terminal-pane/pty-transport.test.ts
- src/renderer/src/components/terminal-pane/pty-transport.ts
- src/main/codex/codex-session-account-attribution.test.ts
- src/main/usage/usage-rollup-merge.ts
- src/main/agent-hooks/server.test.ts
- src/renderer/src/components/terminal-pane/pty-transport-types.ts
- src/renderer/src/runtime/remote-agent-session-launch.test.ts
- src/main/ipc/provider-managed-home-handlers.test.ts
- src/main/kimi/hook-service.test.ts
- src/main/ipc/gemini-accounts.ts
- src/renderer/src/runtime/runtime-git-client.test.ts
- src/preload/usage-provider-api.ts
- src/main/ipc/grok-accounts.ts
- src/renderer/src/components/settings/GrokAccountsSection.tsx
- src/main/ipc/usage-provider-handlers.ts
- src/main/command-code-accounts/launch-environment.ts
- src/main/ipc/usage-provider-handlers.test.ts
- src/main/kimi-accounts/launch-environment.test.ts
- src/main/kimi-accounts/launch-environment.ts
- src/shared/rate-limit-types.ts
- src/shared/constants.ts
- src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
- src/main/runtime/orca-runtime-git.ts
- src/main/runtime/rpc/methods/git-params.ts
- src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
- src/main/ai-vault/cached-session-list.ts
- src/main/ai-vault/session-scanner-kimi-managed.test.ts
- src/main/ipc/provider-managed-home-handlers.ts
- src/shared/provider-account-ref.test.ts
- src/main/ipc/kimi-accounts.test.ts
- src/renderer/src/store/slices/rate-limits.ts
- src/renderer/src/components/settings/AccountsPane.test.tsx
- src/main/ipc/rate-limits.ts
- src/main/ai-vault/cached-session-list.test.ts
- src/renderer/src/lib/launch-agent-in-new-tab.ts
- src/main/text-generation/commit-message-agent-environment.test.ts
- src/main/codex-usage/store-snapshot.benchmark.test.ts
- src/cli/specs/core.ts
- src/main/usage/usage-event-aggregation.test.ts
- src/main/codex-usage/scanner-paths.test.ts
- src/main/usage/usage-provider-contract.ts
- src/shared/codex-usage-account-filter-contract.test.ts
- src/main/provider-managed-homes/ownership.test.ts
- src/main/ipc/settings.test.ts
- src/renderer/src/i18n/locales/en.json
- src/main/ipc/kimi-accounts.ts
- src/renderer/src/lib/launch-agent-in-new-tab.test.ts
- src/renderer/src/components/settings/ManagedCliHomeAccountsControl.tsx
- src/main/kimi-accounts/service.test.ts
- src/cli/help.ts
- src/shared/codex-usage-account-filter-contract.ts
- src/main/ipc/command-code-accounts.ts
- src/main/provider-managed-homes/launch-environment.test.ts
- src/main/command-code-accounts/auth-file.ts
- src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
- src/renderer/src/components/settings/CommandCodeAccountsSection.test.tsx
- src/main/codex/codex-session-account-registry.test.ts
- src/renderer/src/components/settings/ManagedCliHomeAccountsControl.test.tsx
- src/main/ipc/rate-limits.test.ts
- src/main/runtime/rpc/methods/agent-session.test.ts
- src/renderer/src/store/slices/usage-provider-account-filter.test.ts
- src/main/codex-usage/scanner.ts
- src/main/runtime/orca-runtime-agent-session-operation.test.ts
- src/renderer/src/runtime/runtime-git-client.ts
- src/main/runtime/provider-account-workspace-scope.test.ts
- src/main/codex/codex-session-account-attribution.ts
- src/main/window/attach-main-window-services.ts
- src/main/ai-vault/session-scanner-agent-sources.ts
- src/renderer/src/components/settings/KimiAccountsSection.test.tsx
- src/main/codex-usage/codex-usage-provider.ts
- src/shared/agent-session-option-catalog.ts
- src/renderer/src/components/terminal-pane/pty-connection.ts
- src/main/codex-accounts/runtime-home-service.test.ts
- src/renderer/src/lib/launch-agent-web-host-tab.ts
- src/main/codex-usage/store.test.ts
- src/renderer/src/runtime/remote-agent-session-launch.ts
- src/main/kimi/hook-service.ts
- src/main/codex-usage/types.ts
- src/main/runtime/rpc/methods/git.ts
- src/main/kimi-accounts/service.ts
- src/main/usage/usage-event-aggregation.ts
- src/main/ipc/filesystem.ts
- src/shared/agent-session-option-catalog-claude-codex.ts
- src/cli/handlers/terminal.test.ts
- src/main/text-generation/commit-message-agent-environment.ts
- src/renderer/src/components/settings/accounts-search.ts
- src/cli/handlers/account.test.ts
- src/main/runtime/rpc/methods/git.test.ts
- src/main/provider-managed-homes/ownership.ts
- src/renderer/src/runtime/web-runtime-session.ts
- src/shared/protocol-version.ts
- src/shared/codex-model-list-probe.test.ts
- src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
- src/main/runtime/rpc/methods/ai-vault.test.ts
- src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
- src/renderer/src/components/settings/AccountsPane.tsx
- src/renderer/src/lib/runtime-agent-background-create.ts
- src/main/rate-limits/service.test.ts
- src/shared/commit-message-agent-spec.ts
- src/main/runtime/provider-account-workspace-scope.ts
- src/renderer/src/components/stats/CodexUsagePane.tsx
- src/shared/agent-session-option-catalog.test.ts
- src/main/ipc/filesystem.test.ts
- src/renderer/src/components/tab-bar/codex-launch-account-options.ts
- src/renderer/src/components/native-chat/use-native-chat-session-options.ts
- src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
- src/main/provider-managed-homes/service.ts
- src/main/runtime/orca-runtime.ts
- src/shared/provider-account-ref.ts
- src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
- src/main/ipc/command-code-accounts.test.ts
- src/main/codex/codex-session-account-registry.ts
- src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
- src/main/kimi-accounts/managed-home-copy.ts
- src/shared/codex-usage-types.ts
- src/main/command-code-accounts/service.test.ts
- src/main/command-code-accounts/ownership.ts
- src/renderer/src/web/web-preload-api.ts
- src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
- src/shared/codex-model-list-probe.ts
- src/main/provider-managed-homes/credential-scope.ts
- src/main/usage/usage-rollup-records.ts
- src/renderer/src/components/terminal-pane/pty-connection-types.ts
- src/main/ipc/register-core-handlers.test.ts
- src/main/ipc/register-core-handlers.ts
- src/main/codex-accounts/runtime-home-service.ts
- src/cli/handlers/terminal.ts
- src/renderer/src/components/settings/CommandCodeAccountsSection.tsx
- src/preload/index.ts
- src/main/agent-hooks/server.ts
- src/main/command-code-accounts/service.ts
- src/renderer/src/components/settings/KimiAccountsSection.tsx
- src/main/ipc/settings.ts
- src/main/provider-managed-homes/service.test.ts
- src/renderer/src/store/slices/terminals.ts
- src/main/provider-managed-homes/launch-environment.ts
- src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
- src/main/ipc/pty.test.ts
- src/main/codex-usage/store.ts
- src/main/ipc/pty.ts
- src/shared/agent-session-host-authority.ts
- src/main/rate-limits/service.ts
- src/main/index.ts
- src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
- src/renderer/src/store/slices/usage-provider-slices.ts
- src/main/command-code-accounts/launch-environment.test.ts
82763dc to
2a1bb58
Compare
|
Restacked onto current Latest leftover CodeRabbit findings from the post-restack full reviews are addressed on tip
|
2a1bb58 to
0a1661c
Compare
launch-agent-in-new-tab.test.ts grew past the 800-line budget once the account-scoped cases landed; move those cases to their own file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvdKNvkWoiVSxqbw7DKmgm
main dropped the shared/types barrel, so the CLI terminal handler and the launch account options resolved neither import. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvdKNvkWoiVSxqbw7DKmgm
`unknown` for accountFilter broke parameter contravariance against each provider store, and the slice file passed its max-lines budget once the account-scoped state landed; split the factory out. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvdKNvkWoiVSxqbw7DKmgm
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvdKNvkWoiVSxqbw7DKmgm
Keep explicit Codex hook prep best-effort, hide leftover managed-home path fragments, omit WSL homes from Kimi summaries, reject symlink credential directories, fail closed on mixed usage attribution, and ignore superseded usage-filter fetches.
Use the worker mock in the Kimi AI Vault scan test, fall back to current Codex selection when a stale PTY record throws, and route explicit host system-default launches through the shared mirror when the real-home lane is unavailable.
CodeRabbit asked for null and whitespace-only workspaceLabel cases so the email fallback and UUID stay covered.
Reject create-session account refs that do not match the agent, skip managed hook writes on the real ~/.codex lane, apply already-cached native-chat models after subscribe, surface registry persist failures, keep afterTabId launches account-scoped, and bound Kimi delete/login leak paths.
Propagate the Usage abort signal through Kimi fetches, keep deleted account filters selectable, and close the leftover empty-file, localization, and workspace-scope test gaps from the latest full reviews.
Keep stdout/stderr login decoders separate so a UTF-8 split cannot mix streams, remap leftover shared/types imports to domain modules, and add the non-ASCII split-path coverage CodeRabbit asked for.
Reject PTY-scoped remote model discovery instead of returning the unscoped catalog, validate Kimi credential contents before promotion, wait for login exit before rollback, and keep the settings list from racing a later account operation.
Keep Command Code, Grok, and Gemini settings from applying an initial list result after a newer import, select, or remove has already landed.
Strip ANSI sequences and control characters from workspace labels so a crafted name cannot inject extra lines or escape sequences into `orca account list`.
Move the stack's pane-scoped model discovery cases onto the split filesystem and runtime-home suites so they survive main's max-lines test-file split.
Also assert the scoped PTY resolver call in the Codex fallback test so the case cannot pass when PTY resolution is skipped entirely.
- thread the provider account filter type through the usage IPC and renderer contracts instead of `unknown`, which broke parameter contravariance - split the usage provider slice factory and the account-scoped launch tests out of files that had grown past their max-lines budget - move terminal control stripping into the shared ANSI module so the CLI no longer needs an inline control regex - drop the redundant `TuiAgent | string` unions in the launch env guards
The account-attribution commit changed the Codex usage schema version, added agentType to provider-session fanout, and threaded an abort signal into the Kimi usage fetch, but left three suites asserting the previous shape.
… lane rules prepareForCodexAccountLaunch skipped the custom-CODEX_HOME exclusion that prepareForCodexLaunch applies, so an explicit system-default launch could run against a home Orca never hooks. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvdKNvkWoiVSxqbw7DKmgm
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvdKNvkWoiVSxqbw7DKmgm
afb91aa to
8b463eb
Compare
|
Restacked onto current One conflict: New heads — each re-verified standalone (
The tip also passes the full Still blocked on the same external condition: Actions have never run on these fork PRs — |






Summary
Add isolated managed-account homes for Grok Build and Gemini CLI using each CLI's documented home override:
GROK_HOMEGEMINI_CLI_HOMEUsers can import an existing signed-in CLI home, assign a local label, select it for new local sessions, return to the system default, and remove only Orca's managed copy.
This PR is stacked on #13275, #13274, #13273, #13272, #13271, #13270, and #13183. Please review it after those PRs land; their changes will disappear from this diff as the stack advances.
AI Review Report
The review compared each adapter with the provider's documented home override and credential layout, then traced import, ownership, selection, new local launch, settings IPC, renderer summaries, and deletion. It also checked that unsupported login orchestration, identity inference, usage attribution, and Claude behavior are not claimed.
Cross-platform review:
Scope and behavior
auth.jsondata.settings.json. MCP, tool, session, and temporary configuration are excluded.Claude coordination
This change does not duplicate the open Claude account-pinning work in #6963, which already covers worktree-scoped
CLAUDE_CONFIG_DIR, Keychain, daemon, and reattach behavior related to #6921 and #9496. A shared Claude account reference should follow the final upstream contract after that PR is resolved.Security Audit
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildAdded or updated high-quality tests that would catch regressions
Current focused rerun: 8 files, 65 tests passed.
Earlier expanded focused suite: 11 files, 85 tests passed.
pnpm typecheckpnpm lintpnpm run build:desktopNative macOS build via
env -u npm_execpath node config/scripts/build-native-for-platform.mjspnpm testfully green on this workstationThe full suite passed 48,518 tests. Two Git-environment failures passed after removing inherited Orca Git config variables. The remaining six local failures are the existing baseline in
check-root-directory-entries.test.mjsandssh-posix-command-wrapper.test.ts.Screenshots
Posted in #13276 (comment) from an isolated Electron profile (production userData unused):
Rebased onto current
mainon 2026-08-13. Account-filter / managed-home behavior now rides the usage-provider IPC that landed on main. Localization keys from this stack were merged with newer settings copy.Follow-ups intentionally excluded
Notes
@rp0927