Skip to content

feat(kimi): add managed accounts - #13274

Closed
rp0927 wants to merge 12 commits into
stablyai:mainfrom
rp0927:feat/kimi-managed-accounts
Closed

rp0927 wants to merge 12 commits into
stablyai:mainfrom
rp0927:feat/kimi-managed-accounts

Conversation

@rp0927

@rp0927 rp0927 commented Aug 8, 2026

Copy link
Copy Markdown

Summary

Orca can now create isolated managed Kimi Code accounts through device-code login or import an existing Kimi home by copying only the documented config and credential scope. Each account receives its own owned KIMI_CODE_HOME, while Kimi Code remains responsible for token refresh and credential rotation.

Selected accounts are applied consistently to agent launch, hooks, AI Vault session discovery, and /usages rate-limit reads. Account snapshots expose only user labels and local IDs; managed paths and credential contents remain main-process-owned.

This PR is stacked on #13273, #13272, #13271, #13270, and #13183. Please review it after those PRs land; their changes will disappear from this diff as the stack advances.

Screenshots

Not attached yet because this is a dependency-gated draft. Before marking it ready, I will capture the Kimi account settings section against the rebased branch.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions

Focused validation:

  • Focused Vitest suite covering Kimi account service/IPC/UI, login output filtering, launch environments, hook paths, managed session discovery, settings integration, and account-scoped usage — 173 tests passed.
  • pnpm run build:desktop — passed.
  • git diff --check — passed.

Local environment note: the repository requests Node 24, while this workstation currently exposes Node 25.8.1. The desktop build completed; its development CLI install step reported the expected permission warning for /usr/local/bin/orca-dev without failing the build.

AI Review Report

The review traced device-code provisioning, bounded import, ownership markers, active selection, launch/hook/session paths, per-account rate limits, renderer snapshots, and deletion. It checked rollback after login/import failures and the follow-up fix that keeps managed account paths inside main-process services.

Regression tests cover source-home immutability, bounded config/credential copy, secret-free snapshots, owned-home deletion, replaced ownership markers, invalid active selections, hook-install rollback, missing-login-credential rollback, launch pinning, session discovery, failed per-account usage refreshes, and UI confirmation.

Cross-platform review:

  • This first Kimi managed-account surface is local-host scoped and leaves the existing system default untouched.
  • Managed paths are resolved with platform path helpers in main; renderer and IPC responses carry no filesystem home.
  • Session discovery receives validated owned roots rather than accepting renderer-provided paths.

Security Audit

  • Login output is allowlisted to browser verification instructions and drops lines that may contain bearer credentials.
  • Imported homes copy only Kimi config and credential scope and never modify the source home.
  • Account removal requires a matching ownership marker and removes only the managed copy, never the system ~/.kimi-code home.
  • Verification URLs must be HTTPS before they are opened.
  • API keys, OAuth credentials, managed paths, and raw config are excluded from renderer snapshots, RPC responses, and logs.
  • Dependencies are unchanged.

Notes

@rp0927

rp0927 commented Aug 13, 2026

Copy link
Copy Markdown
Author

Rebased onto current origin/main (392 commits). Conflict resolutions kept main’s usage-provider IPC/lifecycle and PTY cwd prevalidation, and ported account-filter / managed-home behavior onto those paths. Localization keys were merged rather than dropped. Stack branches were force-pushed with --force-with-lease. GitHub will not accept another fork branch as the base, so these PRs still target main and still contain the full stack below them — review bottom-up starting at #13183.

@rp0927
rp0927 marked this pull request as ready for review August 13, 2026 14:19
@rp0927
rp0927 requested a review from brennanb2025 as a code owner August 13, 2026 14:19
@greptile-apps

greptile-apps Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Too many files changed for review (127 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 75cad781-519a-4d3f-9de0-296a8e5f2580

📥 Commits

Reviewing files that changed from the base of the PR and between 5b7f442 and 1af743c2195bad89a3ebd904d8da89fa623dd7bd.

📒 Files selected for processing (126)
  • src/cli/handlers/account.test.ts
  • src/cli/handlers/account.ts
  • src/cli/handlers/terminal.test.ts
  • src/cli/handlers/terminal.ts
  • src/cli/help.ts
  • src/cli/specs/core.ts
  • src/main/agent-hooks/server.ts
  • src/main/ai-vault/cached-session-list.test.ts
  • src/main/ai-vault/cached-session-list.ts
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/main/ai-vault/session-scanner-kimi-managed.test.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/codex-usage/codex-usage-provider.ts
  • src/main/codex-usage/scanner-paths.test.ts
  • src/main/codex-usage/scanner.ts
  • src/main/codex-usage/store-snapshot.benchmark.test.ts
  • src/main/codex-usage/store.ts
  • src/main/codex-usage/types.ts
  • src/main/codex/codex-session-account-attribution.test.ts
  • src/main/codex/codex-session-account-attribution.ts
  • src/main/codex/codex-session-account-registry.test.ts
  • src/main/codex/codex-session-account-registry.ts
  • src/main/index.ts
  • src/main/ipc/filesystem.ts
  • src/main/ipc/kimi-accounts.test.ts
  • src/main/ipc/kimi-accounts.ts
  • src/main/ipc/pty.ts
  • src/main/ipc/rate-limits.test.ts
  • src/main/ipc/rate-limits.ts
  • src/main/ipc/register-core-handlers.test.ts
  • src/main/ipc/register-core-handlers.ts
  • src/main/ipc/settings.test.ts
  • src/main/ipc/settings.ts
  • src/main/ipc/usage-provider-handlers.test.ts
  • src/main/ipc/usage-provider-handlers.ts
  • src/main/kimi-accounts/launch-environment.test.ts
  • src/main/kimi-accounts/launch-environment.ts
  • src/main/kimi-accounts/login-runner.test.ts
  • src/main/kimi-accounts/login-runner.ts
  • src/main/kimi-accounts/managed-home-copy.ts
  • src/main/kimi-accounts/managed-home-ownership.ts
  • src/main/kimi-accounts/managed-login-provisioning.ts
  • src/main/kimi-accounts/service.test.ts
  • src/main/kimi-accounts/service.ts
  • src/main/kimi/hook-service.test.ts
  • src/main/kimi/hook-service.ts
  • src/main/rate-limits/service.ts
  • src/main/runtime/orca-runtime-agent-session-operation.test.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/agent-session.test.ts
  • src/main/runtime/rpc/methods/agent-session.ts
  • src/main/runtime/rpc/methods/ai-vault.test.ts
  • src/main/runtime/rpc/methods/git-params.ts
  • src/main/runtime/rpc/methods/git.test.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/main/usage/usage-event-aggregation.ts
  • src/main/usage/usage-provider-contract.ts
  • src/main/usage/usage-rollup-merge.ts
  • src/main/usage/usage-rollup-records.ts
  • src/main/window/attach-main-window-services.ts
  • src/preload/api-types.ts
  • src/preload/api/agent-account-api.ts
  • src/preload/api/agent-usage-api.ts
  • src/preload/api/git-inspection-api.ts
  • src/preload/api/pty-api.ts
  • src/preload/index.ts
  • src/preload/usage-provider-api.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/KimiAccountsSection.test.tsx
  • src/renderer/src/components/settings/KimiAccountsSection.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/stats/CodexUsagePane.tsx
  • src/renderer/src/components/stats/codex-usage-account-filter.test.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/renderer/src/lib/runtime-agent-background-create.ts
  • src/renderer/src/runtime/remote-agent-session-launch.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/renderer/src/store/slices/usage-provider-slices.ts
  • src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/agent-session-host-authority.ts
  • src/shared/agent-session-option-catalog-claude-codex.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/codex-model-list-probe.test.ts
  • src/shared/codex-model-list-probe.ts
  • src/shared/codex-usage-account-filter-contract.test.ts
  • src/shared/codex-usage-account-filter-contract.ts
  • src/shared/codex-usage-types.ts
  • src/shared/commit-message-agent-spec.ts
  • src/shared/constants.ts
  • src/shared/global-settings-types.ts
  • src/shared/managed-account-types.ts
  • src/shared/protocol-version.ts
  • src/shared/provider-account-ref.test.ts
  • src/shared/provider-account-ref.ts
  • src/shared/rate-limit-types.ts
  • src/shared/worktree/launch-types.ts
🚧 Files skipped from review as they are similar to previous changes (122)
  • src/shared/constants.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/main/kimi/hook-service.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/main/codex-usage/types.ts
  • src/main/usage/usage-rollup-merge.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.test.ts
  • src/preload/api/pty-api.ts
  • src/cli/handlers/account.test.ts
  • src/main/ipc/rate-limits.ts
  • src/main/agent-hooks/server.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/store/slices/rate-limits.ts
  • src/main/runtime/rpc/methods/git.test.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/shared/protocol-version.ts
  • src/preload/api-types.ts
  • src/main/ipc/usage-provider-handlers.test.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/usage/usage-event-aggregation.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/shared/codex-model-list-probe.ts
  • src/main/ipc/usage-provider-handlers.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/main/ai-vault/cached-session-list.ts
  • src/main/codex/codex-session-account-registry.test.ts
  • src/main/ai-vault/session-scanner-kimi-managed.test.ts
  • src/main/ipc/settings.test.ts
  • src/main/ipc/rate-limits.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/main/codex-usage/scanner.ts
  • src/main/ipc/register-core-handlers.test.ts
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/cli/specs/core.ts
  • src/shared/codex-usage-account-filter-contract.ts
  • src/preload/usage-provider-api.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/shared/provider-account-ref.test.ts
  • src/shared/codex-model-list-probe.test.ts
  • src/shared/agent-session-host-authority.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/renderer/src/lib/runtime-agent-background-create.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/main/window/attach-main-window-services.ts
  • src/preload/api/git-inspection-api.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/cli/help.ts
  • src/shared/codex-usage-types.ts
  • src/shared/codex-usage-account-filter-contract.test.ts
  • src/main/kimi-accounts/managed-login-provisioning.ts
  • src/main/runtime/orca-runtime-agent-session-operation.test.ts
  • src/main/runtime/rpc/methods/agent-session.test.ts
  • src/shared/agent-session-option-catalog.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/shared/provider-account-ref.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/main/ipc/kimi-accounts.test.ts
  • src/main/kimi-accounts/launch-environment.ts
  • src/main/codex-usage/scanner-paths.test.ts
  • src/main/runtime/rpc/methods/ai-vault.test.ts
  • src/main/kimi-accounts/login-runner.test.ts
  • src/main/usage/usage-rollup-records.ts
  • src/renderer/src/store/slices/usage-provider-slices.ts
  • src/shared/agent-session-option-catalog-claude-codex.ts
  • src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
  • src/main/runtime/rpc/methods/agent-session.ts
  • src/preload/index.ts
  • src/renderer/src/components/stats/CodexUsagePane.tsx
  • src/main/codex/codex-session-account-attribution.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.ts
  • src/shared/rate-limit-types.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/cli/handlers/terminal.test.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
  • src/renderer/src/store/slices/terminals.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/main/codex-usage/codex-usage-provider.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.test.ts
  • src/main/runtime/rpc/methods/git-params.ts
  • src/preload/api/agent-account-api.ts
  • src/main/ipc/filesystem.ts
  • src/main/kimi/hook-service.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/shared/commit-message-agent-spec.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.ts
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/main/ipc/kimi-accounts.ts
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/renderer/src/components/settings/KimiAccountsSection.test.tsx
  • src/shared/worktree/launch-types.ts
  • src/main/runtime/orca-runtime.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/main/ipc/register-core-handlers.ts
  • src/main/kimi-accounts/managed-home-copy.ts
  • src/main/kimi-accounts/launch-environment.test.ts
  • src/renderer/src/components/settings/KimiAccountsSection.tsx
  • src/main/ai-vault/cached-session-list.test.ts
  • src/main/codex/codex-session-account-registry.ts
  • src/main/usage/usage-provider-contract.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/kimi-accounts/service.ts
  • src/main/codex-usage/store-snapshot.benchmark.test.ts
  • src/shared/global-settings-types.ts
  • src/main/codex/codex-session-account-attribution.ts
  • src/main/kimi-accounts/service.test.ts
  • src/preload/api/agent-usage-api.ts
  • src/main/ipc/settings.ts
  • src/main/rate-limits/service.ts
  • src/main/kimi-accounts/managed-home-ownership.ts
  • src/main/ipc/pty.ts
  • src/main/codex-usage/store.ts
  • src/main/index.ts

📝 Walkthrough

Walkthrough

The pull request adds managed Kimi account management, Codex account-scoped launches, durable Codex session attribution, account-filtered usage reporting, PTY-scoped model discovery, and related IPC, preload, runtime, renderer, CLI, settings, and localization changes. It also adds validation, persistence, secure credential handling, runtime capability checks, and tests for the new flows.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the implementation, security, testing, and dependencies, but omits the required issue link and visual proof. Add a linked issue using the required “Fixes #” format and attach before-and-after UI evidence before marking the PR ready.
Docstring Coverage ⚠️ Warning Docstring coverage is 7.94% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: adding managed Kimi accounts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmethystLiang
AmethystLiang requested a review from OrcaWin August 13, 2026 16:51
@rp0927
rp0927 force-pushed the feat/kimi-managed-accounts branch 2 times, most recently from 9ed2f5d to 203b7f6 Compare August 14, 2026 03:45

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

🧹 Nitpick comments (6)
src/shared/codex-model-list-probe.test.ts (1)

4-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a valid model-list parsing test.

This test covers only the size guard. Add a fixture that verifies model mapping, effort-level deduplication, default effort extraction, and duplicate slug handling.

src/main/kimi-accounts/managed-home-copy.ts (1)

21-24: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Share one containment helper.

isInside here is identical to isInside in src/main/kimi-accounts/managed-home-ownership.ts (Lines 12-15). Path-containment logic guards a security boundary. Two copies can drift. Move it to one module in this directory and import it in both files.

src/main/kimi-accounts/login-runner.ts (2)

52-69: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Consider a SIGKILL escalation after SIGTERM.

terminateLogin sends SIGTERM once on POSIX. If the Kimi CLI ignores the signal, the process keeps the managed home open after the 5-minute timeout, and the pending directory removal in provisionKimiManagedLogin can race with it. Add a short timer that sends SIGKILL when the child does not exit.


115-116: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Decode each child stream with its own streaming decoder.

stdout and stderr can split UTF-8 characters across data events. Use separate StringDecoder instances, pass the matching decoder to write(chunk), and flush them with end() before final parsing. A shared decoder can mix bytes from the independent streams.

src/main/kimi-accounts/login-runner.test.ts (1)

4-42: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider covering the runKimiLogin control paths.

The parser tests are complete. The spawn paths remain untested: user cancellation, the 5-minute timeout, and the ENOENT message for a missing CLI. Inject a fake child process to cover them.

src/main/codex-accounts/runtime-home-service.test.ts (1)

410-438: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a case for the non-Codex provider guard.

The fail-closed test covers removed accounts and wrong-lane references. It does not cover ref.provider !== 'codex', which throws agent_session_account_agent_mismatch in prepareForCodexAccountLaunch. That guard protects the launch path from a foreign provider reference. Add one assertion for it.

Proposed test addition
     ).toThrow('agent_session_account_runtime_mismatch')
+    expect(() =>
+      service.prepareForCodexAccountLaunch({
+        provider: 'claude',
+        accountId: 'account-a',
+        runtime: 'host'
+      } as never)
+    ).toThrow('agent_session_account_agent_mismatch')
   })
🔇 Additional comments (145)
src/shared/agent-session-host-authority.ts (1)

8-8: LGTM!

Also applies to: 27-30, 118-118, 141-141

src/shared/provider-account-ref.ts (1)

1-44: LGTM!

src/shared/provider-account-ref.test.ts (1)

1-25: LGTM!

src/shared/protocol-version.ts (1)

87-89: LGTM!

Also applies to: 127-127

src/shared/agent-session-option-catalog.test.ts (1)

111-194: LGTM!

src/shared/commit-message-agent-spec.ts (1)

9-13: LGTM!

Also applies to: 84-84, 172-190, 385-385

src/shared/constants.ts (1)

305-306: LGTM!

src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts (1)

4-4: LGTM!

Also applies to: 75-106

src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts (1)

73-103: LGTM!

Also applies to: 352-433

src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts (1)

21-50: LGTM!

Also applies to: 77-123

src/renderer/src/components/native-chat/use-native-chat-session-options.ts (1)

99-99: LGTM!

Also applies to: 115-115, 129-129, 152-152, 180-180, 205-205, 225-246

src/shared/types.ts (1)

57-57: LGTM!

Also applies to: 2273-2273, 2633-2651, 3049-3051

src/shared/rate-limit-types.ts (1)

140-141: LGTM!

src/main/usage/usage-provider-contract.ts (1)

12-17: LGTM!

src/main/usage/usage-rollup-records.ts (1)

1-10: LGTM!

Also applies to: 64-64, 85-85, 109-119

src/shared/codex-usage-types.ts (1)

4-13: LGTM!

Also applies to: 65-65, 81-81

src/shared/codex-usage-account-filter-contract.ts (1)

1-20: LGTM!

src/shared/codex-usage-account-filter-contract.test.ts (1)

1-20: LGTM!

src/shared/codex-model-list-probe.ts (1)

1-84: LGTM!

src/shared/agent-session-option-catalog-claude-codex.ts (2)

13-13: LGTM!

Also applies to: 196-264, 288-292


194-194: 🎯 Functional Correctness

Likely an incorrect or invalid review comment.

src/shared/agent-session-option-catalog.ts (1)

5-6: LGTM!

Also applies to: 30-30

src/main/kimi-accounts/service.ts (1)

20-64: LGTM!

Also applies to: 132-216, 273-281

src/main/kimi-accounts/managed-home-copy.ts (1)

26-91: LGTM!

src/main/kimi-accounts/managed-home-ownership.ts (1)

6-15: LGTM!

Also applies to: 33-50

src/main/kimi-accounts/managed-login-provisioning.ts (1)

16-30: LGTM!

Also applies to: 40-101

src/main/kimi-accounts/login-runner.ts (1)

6-50: LGTM!

Also applies to: 71-114, 140-166

src/main/kimi-accounts/launch-environment.test.ts (1)

4-55: LGTM!

src/main/kimi-accounts/launch-environment.ts (1)

3-21: LGTM!

src/main/kimi-accounts/service.test.ts (1)

19-103: LGTM!

Also applies to: 128-273

src/main/runtime/orca-runtime.ts (2)

67-67: LGTM!

Also applies to: 1379-1379, 1690-1690, 3374-3374, 3410-3413, 25545-25545, 25592-25596, 25684-25688, 25767-25767, 26004-26004


26004-26004: 🗄️ Data Integrity & Integration

⚠️ Unverified finding
Sandbox verification was unavailable.

Verify that no other caller can reach createTerminal with a providerAccountRef on the renderer-backed path.

createTerminal's background-spawn branch forwards launchOpts.providerAccountRef to ptyController.spawn without re-running the agent/runtime/WSL-distro checks that ensureAgentSession and createAgentSession perform. The renderer-backed IPC path (terminal:requestTabCreate) never forwards providerAccountRef at all, so a caller that sets providerAccountRef together with rendererBacked: true or a focused presentation would silently lose the account selection.

Today the only two callers that set providerAccountRef (ensureAgentSession, createAgentSession) always force presentation: 'background', so this is not reachable from this file. Other files in the same "Runtime and PTY account launches" layer (for example src/main/ipc/pty.ts or src/main/runtime/rpc/methods/agent-session.ts) are not included in this review batch. Confirm none of them call createTerminal directly with a caller-supplied providerAccountRef and a renderer-backed/focused presentation, which would bypass the validation in this file.

src/main/ipc/kimi-accounts.test.ts (1)

1-138: LGTM!

src/main/ipc/kimi-accounts.ts (1)

1-101: LGTM!

src/main/kimi/hook-service.test.ts (1)

93-104: LGTM!

src/main/ai-vault/cached-session-list.ts (1)

26-28: LGTM!

Also applies to: 79-95

src/main/ai-vault/session-scanner-agent-sources.ts (1)

225-231: LGTM!

src/main/ai-vault/session-scanner-kimi-managed.test.ts (1)

1-40: LGTM!

src/main/ai-vault/session-scanner-types.ts (1)

36-37: LGTM!

src/main/rate-limits/service.ts (4)

41-45: LGTM!

Also applies to: 221-258, 326-331, 375-405


470-485: LGTM!


770-843: LGTM!

Also applies to: 863-866, 899-927


1735-1735: LGTM!

Also applies to: 1940-1955, 1975-1975

src/main/rate-limits/service.test.ts (1)

1465-1531: LGTM!

src/main/window/attach-main-window-services.ts (1)

87-137: LGTM!

src/main/kimi/hook-service.ts (1)

38-43: LGTM!

Also applies to: 171-204, 243-259

src/main/ipc/register-core-handlers.test.ts (1)

35-35: LGTM!

Also applies to: 101-101, 316-319, 424-424, 464-514, 561-561, 646-658

src/main/ipc/register-core-handlers.ts (1)

61-61: LGTM!

Also applies to: 80-80, 106-106, 120-120, 151-151, 225-225

src/main/ipc/settings.test.ts (1)

128-160: LGTM!

Also applies to: 234-234, 274-274

src/main/ipc/settings.ts (1)

54-67: LGTM!

Also applies to: 100-106, 118-118, 128-128, 289-289, 302-306

src/main/ipc/rate-limits.test.ts (1)

50-51: LGTM!

Also applies to: 82-82

src/main/ipc/rate-limits.ts (1)

31-33: LGTM!

src/preload/api-types.ts (1)

44-44: LGTM!

Also applies to: 152-152, 481-485, 833-838, 1492-1492, 2440-2447, 3063-3063, 3466-3466

src/preload/usage-provider-api.ts (1)

6-6: LGTM!

src/main/codex-accounts/runtime-home-service.ts (1)

296-340: LGTM!

Also applies to: 342-417

src/main/codex-accounts/runtime-home-service.test.ts (1)

344-408: LGTM!

Also applies to: 440-503

src/main/codex/codex-session-account-attribution.test.ts (1)

1-56: LGTM!

src/main/codex/codex-session-account-attribution.ts (1)

1-24: LGTM!

src/main/codex/codex-session-account-registry.ts (1)

1-126: LGTM!

Also applies to: 144-153

src/main/codex/codex-session-account-registry.test.ts (1)

1-67: LGTM!

src/main/index.ts (2)

1490-1492: 🩺 Stability & Availability

⚠️ Unverified finding
Sandbox verification was unavailable.

Verify the callers handle a thrown prepareForCodexPtyLaunch.

resolveCodexHomeForPaneModelDiscovery throws for a stale, untrusted, or lane-mismatched pane record. It does not return undefined in those cases. This resolver is wired into core handlers and the commit-message runtime, so a throw propagates into model discovery instead of falling back to legacy discovery.

Confirm each consumer catches the error and degrades to a safe discovery path.

Run the following script to trace the consumers:

Also applies to: 2746-2747


48-49: LGTM!

Also applies to: 201-201, 226-226, 360-360, 1035-1084, 1350-1352, 1484-1489, 1501-1502, 1534-1534, 2344-2348, 2470-2470, 2482-2487, 2564-2566, 2625-2626, 3122-3122

src/main/agent-hooks/server.ts (1)

129-130: LGTM!

Also applies to: 948-951

src/main/ipc/usage-provider-handlers.test.ts (1)

53-70: LGTM!

src/main/agent-hooks/server.test.ts (1)

1882-1887: LGTM!

Also applies to: 1889-1911

src/main/ai-vault/cached-session-list.test.ts (1)

18-18: LGTM!

Also applies to: 81-94

src/main/codex-usage/codex-usage-provider.ts (1)

5-8: LGTM!

src/main/codex-usage/scanner.ts (1)

10-10: LGTM!

Also applies to: 531-534, 761-768

src/main/codex-usage/scanner-paths.test.ts (1)

41-44: LGTM!

Also applies to: 115-119, 135-156, 158-178, 180-206

src/main/codex-usage/types.ts (1)

50-50: LGTM!

Also applies to: 73-73

src/main/codex-usage/store.ts (1)

322-408: LGTM!

Also applies to: 467-519, 593-645, 812-882

src/main/codex-usage/store.test.ts (1)

33-156: LGTM!

Also applies to: 285-356, 920-920, 956-956

src/renderer/src/components/stats/codex-usage-account-filter.ts (1)

1-39: LGTM!

src/main/codex-usage/store-snapshot.benchmark.test.ts (1)

19-21: LGTM!

src/main/usage/usage-event-aggregation.ts (1)

29-57: LGTM!

src/main/usage/usage-rollup-merge.ts (1)

41-46: LGTM!

src/main/ipc/usage-provider-handlers.ts (1)

18-38: LGTM!

Also applies to: 55-71

src/renderer/src/store/slices/usage-provider-slices.ts (1)

8-9: LGTM!

Also applies to: 60-60, 88-89, 172-204, 233-239, 282-332

src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts (1)

65-83: LGTM!

src/renderer/src/components/stats/CodexUsagePane.tsx (2)

3-21: LGTM!

Also applies to: 84-91, 182-222


53-73: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use generated localization keys.

Replace the new named account* keys with keys generated from <filePath>:<text>. Add the matching locale entries. This keeps localization extraction and key reuse consistent.

Based on learnings: generate locale keys as the first 10 characters of the SHA-1 hash of <filePath>:<text>.

Also applies to: 173-180

⛔ Skipped due to learnings
Learnt from: ioitiki
Repo: stablyai/orca PR: 9076
File: src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx:127-170
Timestamp: 2026-07-16T22:08:51.855Z
Learning: In the stablyai/orca renderer settings localization code, semantic locale keys are valid and should be preferred when they match established neighboring namespaces. For example, `src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx` uses semantic keys such as `AppearanceWindowSidebarSection.usagePercentageDisplayUsed` and `AppearancePane.statusBarDescription`, while `src/renderer/src/components/settings/appearance-sidebar-search.ts` uses semantic `appearance.search.leftSidebarAppearance.*` and `workspaceCardLayout.*` keys. Hash-based keys are generated for unnamed strings, not a universal requirement. Validate localization changes with `pnpm sync:localization-catalog`, `pnpm verify:localization-catalog`, and `pnpm verify:localization-coverage`.
Learnt from: tomdebres
Repo: stablyai/orca PR: 9614
File: src/renderer/src/i18n/locales/ja.json:4687-4689
Timestamp: 2026-07-21T06:40:47.031Z
Learning: In stablyai/orca locale JSON catalogs under `src/renderer/src/i18n/locales/`, `pnpm run sync:localization-catalog` may generate and preserve descriptive localization keys alongside SHA1-style keys. When reviewing keys such as `auto.components.sidebar.HostSectionHeaderMenu.skewUpdateServer` or `auto.components.sidebar.WorktreeList.hostServerOutdated`, do not require SHA1-only keys if catalog verification passes and existing nearby entries use the same descriptive-key convention. Inspect the full JSON nesting rather than inferring a missing path segment from an abbreviated diff hunk.
Learnt from: adaex
Repo: stablyai/orca PR: 13056
File: src/renderer/src/components/settings/TerminalRenderingSection.tsx:94-158
Timestamp: 2026-08-07T18:06:07.648Z
Learning: In the stablyai/orca renderer localization workflow, derive generated locale keys with `sha1("<filePath>:<text>")[:10]`, as implemented by `localize-renderer-strings.mjs`. Reuse the same generated key for identical source text in the same context, such as a settings title, label, and `ariaLabel`.
Learnt from: Viperwow
Repo: stablyai/orca PR: 5617
File: src/renderer/src/components/settings/WebhookServerSetting.tsx:47-48
Timestamp: 2026-07-03T10:49:39.852Z
Learning: In the stablyai/orca renderer codebase, when localizing user-facing strings in settings components (e.g., `src/renderer/src/components/settings/*.tsx`), use `translate('auto.components.<Dir>.<ComponentFile>.<10-char-hash>', 'Default English text')` with pre-generated hash-based keys added to `en.json` under the `auto.components.<Dir>.<ComponentFile>` namespace, then run `pnpm bootstrap:locale-catalog` to propagate translations to es/ja/ko/zh. Note that `keywords` arrays used for settings search (as in `SearchableSetting`) intentionally remain untranslated/English for consistency with other panes.
Learnt from: Devin345458
Repo: stablyai/orca PR: 5522
File: src/renderer/src/i18n/locales/es.json:594-597
Timestamp: 2026-06-16T21:44:11.376Z
Learning: In the stablyai/orca repository, new i18n strings intentionally use an English-fallback localization convention: strings are auto-keyed from SHA1 of file path plus source text, `pnpm run sync:localization-catalog` propagates the English source into all locale files, and human translation for non-English locale files such as `src/renderer/src/i18n/locales/es.json`, `ja.json`, `ko.json`, and `zh.json` is handled in a separate localization pass. Do not flag newly added English fallback strings in locale JSON files as mixed-language regressions when catalog parity is maintained.
Learnt from: Devin345458
Repo: stablyai/orca PR: 5522
File: src/renderer/src/i18n/locales/ja.json:596-597
Timestamp: 2026-06-16T21:44:14.183Z
Learning: In the `stablyai/orca` repository, locale files use an English-fallback localization convention for new strings: new strings are auto-keyed using SHA1 of file path plus source text, `pnpm run sync:localization-catalog` propagates the English source text into all locale files, and human translations for es/ja/ko/zh are handled in a separate localization pass rather than inline in feature PRs. Review localization diffs for catalog parity rather than requiring immediate translation of newly added strings.
Learnt from: Devin345458
Repo: stablyai/orca PR: 5522
File: src/renderer/src/i18n/locales/es.json:7955-7986
Timestamp: 2026-06-16T21:44:12.142Z
Learning: In the `stablyai/orca` repository, new user-facing localization strings are intentionally added to non-English locale files as English fallbacks during feature PRs. Strings are auto-keyed using a SHA1 of file-path plus source text, and `pnpm run sync:localization-catalog` propagates the English source into all five locale files until a dedicated translation pass localizes them. Do not request inline translations in feature PRs when catalog parity is maintained across locales.
Learnt from: dcieslak19973
Repo: stablyai/orca PR: 12111
File: src/renderer/src/i18n/locales/en.json:8403-8404
Timestamp: 2026-08-02T15:30:42.805Z
Learning: In stablyai/orca, when new i18n keys exist only in `src/renderer/src/i18n/locales/en.json` and are absent from `es.json`, `ja.json`, `ko.json`, or `zh.json`, do not flag this as a localization gap requiring the key to be copied into the non-English catalogs. The repo's `locale-english-regression.test.ts` documents the rationale: a missing key falls through to the English default inline in `translate()`, which is visibly distinct to tooling and translators from a genuinely untranslated key. Copying an English value into a non-English catalog (e.g., via `pnpm sync:localization-catalog`, which by design updates `en.json` only) would instead create an entry that looks translated but is not, indistinguishable from the regression that test file guards against. Missing keys in non-English locales are expected and acceptable; do not request adding English-fallback values to `es/ja/ko/zh.json` to achieve key parity.
Learnt from: brennanb2025
Repo: stablyai/orca PR: 8488
File: src/renderer/src/i18n/locales/zh.json:5540-5540
Timestamp: 2026-07-13T05:59:52.957Z
Learning: In stablyai/orca, locale files under `src/renderer/src/i18n/locales/` (e.g., `zh.json`) follow a preservation/provenance contract: existing machine-translated values that predate a given PR should not be changed unless there is review evidence (e.g., a reviewed correction with documented rationale). A translation appearing in a diff does not necessarily mean it was intentionally changed — it may simply be present because surrounding parity leaves were removed. Global retranslation of existing machine values is an explicit non-goal, so flagging wording/quality issues in pre-existing machine translations without review evidence is not actionable and should be withdrawn if the author explains this.
Learnt from: dcieslak19973
Repo: stablyai/orca PR: 12111
File: src/renderer/src/components/settings/integrations-search.ts:79-83
Timestamp: 2026-08-02T15:30:23.668Z
Learning: In stablyai/orca localization catalogs, new English-source keys should remain absent from non-English locale files until they receive real translations. `translate()` then uses its inline English fallback. Do not request copied English placeholder values in `es`, `ja`, `ko`, or `zh`: a present catalog value overrides the fallback and can conceal untranslated strings. `pnpm sync:localization-catalog` intentionally adds new keys only to `src/renderer/src/i18n/locales/en.json`, and `locale-english-regression.test.ts` guards against stale English values in non-English catalogs.
Learnt from: Viperwow
Repo: stablyai/orca PR: 5617
File: src/renderer/src/components/automations/AutomationWebhookSection.tsx:38-44
Timestamp: 2026-07-03T10:49:43.396Z
Learning: In the stablyai/orca repo, English UI strings added to `src/renderer/src/i18n/locales/en.json` follow a catalog-scheme convention: keys are short hashes (e.g., `f817663ae9`) nested under a path mirroring the component's location, such as `auto.components.automations.AutomationWebhookSection`. After adding new English strings, run `pnpm bootstrap:locale-catalog` to propagate/generate corresponding entries for other locales (es/ja/ko/zh).

Source: Learnings

src/renderer/src/components/stats/codex-usage-account-filter.test.ts (1)

1-41: LGTM!

src/cli/handlers/terminal.ts (1)

1-1: LGTM!

Also applies to: 14-17, 38-38, 51-53, 55-137, 230-258

src/cli/handlers/terminal.test.ts (1)

7-7: LGTM!

Also applies to: 65-260

src/cli/specs/core.ts (1)

236-249: LGTM!

src/cli/help.ts (1)

246-246: LGTM!

Also applies to: 297-298, 526-527, 541-541

src/main/runtime/rpc/methods/agent-session.test.ts (1)

3-3: LGTM!

Also applies to: 44-97, 431-431

src/main/runtime/rpc/methods/agent-session.ts (2)

14-18: LGTM!

Also applies to: 155-194, 223-244


119-132: 🎯 Functional Correctness

No schema change is needed.

The runtime resolves an omitted WSL distro from the actual workspace target. null is also a supported WSL default target. The CLI requirement applies only to its flag interface.

			> Likely an incorrect or invalid review comment.
src/main/runtime/orca-runtime-agent-session-operation.test.ts (1)

70-135: LGTM!

Also applies to: 264-275

src/main/text-generation/commit-message-agent-environment.ts (1)

8-11: LGTM!

Also applies to: 93-94, 107-142

src/main/runtime/rpc/methods/ai-vault.test.ts (1)

374-380: LGTM!

src/renderer/src/lib/launch-agent-web-host-tab.ts (1)

14-14: LGTM!

Also applies to: 49-49, 64-65, 96-97

src/main/runtime/orca-runtime-git.ts (1)

834-835: LGTM!

Also applies to: 860-861

src/renderer/src/runtime/web-runtime-session.ts (1)

22-26: LGTM!

Also applies to: 178-178, 308-310, 334-336, 352-359

src/renderer/src/lib/runtime-agent-background-create.ts (1)

6-7: LGTM!

Also applies to: 25-25, 52-52, 62-67

src/renderer/src/runtime/remote-agent-session-launch.test.ts (1)

59-90: LGTM!

Also applies to: 183-194

src/renderer/src/runtime/remote-agent-session-launch.ts (1)

10-16: LGTM!

Also applies to: 29-54

src/renderer/src/components/tab-bar/codex-launch-account-options.ts (1)

1-79: LGTM!

src/renderer/src/components/terminal-pane/pty-connection-types.ts (1)

18-18: LGTM!

Also applies to: 36-36

src/renderer/src/components/terminal-pane/pty-connection.ts (1)

3851-3853: LGTM!

src/renderer/src/components/terminal-pane/pty-transport-types.ts (1)

16-16: LGTM!

Also applies to: 238-238

src/renderer/src/components/terminal-pane/pty-transport.test.ts (1)

117-132: LGTM!

src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts (1)

4021-4069: LGTM!

Also applies to: 4071-4115

src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts (1)

23-23: LGTM!

Also applies to: 149-149, 2045-2045, 2066-2066, 2083-2090

src/renderer/src/runtime/runtime-git-client.test.ts (1)

728-743: LGTM!

Also applies to: 746-763

src/renderer/src/runtime/runtime-git-client.ts (1)

27-27: LGTM!

Also applies to: 694-718

src/preload/index.ts (1)

25-25: LGTM!

Also applies to: 957-957, 2152-2164, 3474-3474, 4485-4486

src/renderer/src/components/terminal-pane/pty-transport.ts (1)

568-568: LGTM!

Also applies to: 841-841

src/renderer/src/web/web-preload-api.ts (1)

873-873: LGTM!

Also applies to: 3123-3136, 3175-3176

src/renderer/src/i18n/locales/en.json (4)

3267-3279: LGTM!


3819-3824: LGTM!


7998-8000: LGTM!


10713-10738: LGTM!

src/renderer/src/lib/launch-agent-in-new-tab.test.ts (2)

452-472: LGTM!


543-563: LGTM!

src/renderer/src/lib/launch-agent-in-new-tab.ts (1)

29-29: LGTM!

Also applies to: 54-54, 86-87, 167-168, 197-197

src/renderer/src/store/slices/rate-limits.ts (1)

15-15: LGTM!

Also applies to: 34-35, 151-157

src/renderer/src/store/slices/terminals.ts (1)

20-20: LGTM!

Also applies to: 577-577, 760-760, 781-781

src/main/ipc/pty.test.ts (1)

2154-2215: LGTM!

src/main/ipc/pty.ts (1)

204-205: LGTM!

Also applies to: 1247-1255, 2376-2376, 4634-4641, 4659-4696, 5264-5264, 5901-5901, 5963-5979, 6364-6400, 6794-6794, 7881-7881

src/main/ipc/filesystem.test.ts (1)

2467-2489: LGTM!

src/main/ipc/filesystem.ts (1)

1565-1565: LGTM!

Also applies to: 1602-1606

src/main/runtime/rpc/methods/git-params.ts (1)

187-188: LGTM!

src/main/runtime/rpc/methods/git.test.ts (1)

295-296: LGTM!

Also applies to: 327-332

src/main/runtime/rpc/methods/git.ts (1)

286-287: LGTM!

src/main/text-generation/commit-message-agent-environment.test.ts (1)

4-4: LGTM!

Also applies to: 127-161

src/cli/handlers/account.test.ts (1)

49-49: LGTM!

Also applies to: 95-104

src/cli/handlers/account.ts (1)

41-41: LGTM!

Also applies to: 50-50, 60-61

src/renderer/src/components/settings/AccountsPane.tsx (1)

51-57: LGTM!

Also applies to: 1952-1957

src/renderer/src/components/settings/KimiAccountsSection.test.tsx (1)

1-137: LGTM!

src/renderer/src/components/settings/KimiAccountsSection.tsx (5)

58-104: LGTM!


106-128: LGTM!


145-162: 📐 Maintainability & Code Quality

⚠️ Unverified finding
Sandbox verification was unavailable.

Verify that the description does not render twice.

The same translated string (key 271d3f21b7) is passed as the SearchableSetting description prop and rendered again in the paragraph at Lines 157-162. If SearchableSetting renders description visibly, users see the sentence twice.


163-226: LGTM!


228-375: LGTM!

src/renderer/src/components/settings/accounts-search.ts (1)

99-117: LGTM!

Also applies to: 239-239

src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx (1)

1-222: LGTM!

src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx (3)

35-43: LGTM!


54-118: 🚀 Performance & Scalability

⚠️ Unverified finding
Sandbox verification was unavailable.

Verify that target is a stable reference.

The effect lists target in its dependency array. useAgentDetectionTargetForWorktree returns an object. If that hook builds a new object on each render, this effect re-runs on every render and refetches the account snapshot repeatedly while the menu stays open. The test mock returns a stable reference, so tests cannot detect this.

If the hook is not memoized, depend on the discriminating primitives instead, for example target?.kind and the connection or environment id.


120-206: LGTM!

src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts (1)

74-80: LGTM!

src/renderer/src/components/tab-bar/QuickLaunchButton.tsx (1)

13-19: LGTM!

Also applies to: 128-128, 138-139, 205-214

src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts (2)

43-55: 🎯 Functional Correctness

⚠️ Unverified finding
Sandbox verification was unavailable.

Verify that the launch lane comparison ignores distro casing.

This test asserts that buildCodexLaunchAccountOptions returns the caller-supplied wslDistro: 'ubuntu' while the managed account stores 'Ubuntu'. prepareForCodexAccountLaunch in src/main/codex-accounts/runtime-home-service.ts compares getCodexSelectionLaneKey values and throws agent_session_account_runtime_mismatch when they differ. Confirm that the lane key normalizes distro casing. If it does not, this option produces a launch failure for mixed-case distro names.


4-41: LGTM!


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7c5ea276-45cb-4b46-b1fd-5b8c7a2a5030

📥 Commits

Reviewing files that changed from the base of the PR and between 400321e and 9ed2f5d2920e682e2b907d7d47251463c92a17df.

📒 Files selected for processing (128)
  • src/cli/handlers/account.test.ts
  • src/cli/handlers/account.ts
  • src/cli/handlers/terminal.test.ts
  • src/cli/handlers/terminal.ts
  • src/cli/help.ts
  • src/cli/specs/core.ts
  • src/main/agent-hooks/server.test.ts
  • src/main/agent-hooks/server.ts
  • src/main/ai-vault/cached-session-list.test.ts
  • src/main/ai-vault/cached-session-list.ts
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/main/ai-vault/session-scanner-kimi-managed.test.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/codex-usage/codex-usage-provider.ts
  • src/main/codex-usage/scanner-paths.test.ts
  • src/main/codex-usage/scanner.ts
  • src/main/codex-usage/store-snapshot.benchmark.test.ts
  • src/main/codex-usage/store.test.ts
  • src/main/codex-usage/store.ts
  • src/main/codex-usage/types.ts
  • src/main/codex/codex-session-account-attribution.test.ts
  • src/main/codex/codex-session-account-attribution.ts
  • src/main/codex/codex-session-account-registry.test.ts
  • src/main/codex/codex-session-account-registry.ts
  • src/main/index.ts
  • src/main/ipc/filesystem.test.ts
  • src/main/ipc/filesystem.ts
  • src/main/ipc/kimi-accounts.test.ts
  • src/main/ipc/kimi-accounts.ts
  • src/main/ipc/pty.test.ts
  • src/main/ipc/pty.ts
  • src/main/ipc/rate-limits.test.ts
  • src/main/ipc/rate-limits.ts
  • src/main/ipc/register-core-handlers.test.ts
  • src/main/ipc/register-core-handlers.ts
  • src/main/ipc/settings.test.ts
  • src/main/ipc/settings.ts
  • src/main/ipc/usage-provider-handlers.test.ts
  • src/main/ipc/usage-provider-handlers.ts
  • src/main/kimi-accounts/launch-environment.test.ts
  • src/main/kimi-accounts/launch-environment.ts
  • src/main/kimi-accounts/login-runner.test.ts
  • src/main/kimi-accounts/login-runner.ts
  • src/main/kimi-accounts/managed-home-copy.ts
  • src/main/kimi-accounts/managed-home-ownership.ts
  • src/main/kimi-accounts/managed-login-provisioning.ts
  • src/main/kimi-accounts/service.test.ts
  • src/main/kimi-accounts/service.ts
  • src/main/kimi/hook-service.test.ts
  • src/main/kimi/hook-service.ts
  • src/main/rate-limits/service.test.ts
  • src/main/rate-limits/service.ts
  • src/main/runtime/orca-runtime-agent-session-operation.test.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/agent-session.test.ts
  • src/main/runtime/rpc/methods/agent-session.ts
  • src/main/runtime/rpc/methods/ai-vault.test.ts
  • src/main/runtime/rpc/methods/git-params.ts
  • src/main/runtime/rpc/methods/git.test.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/main/usage/usage-event-aggregation.ts
  • src/main/usage/usage-provider-contract.ts
  • src/main/usage/usage-rollup-merge.ts
  • src/main/usage/usage-rollup-records.ts
  • src/main/window/attach-main-window-services.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/preload/usage-provider-api.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/KimiAccountsSection.test.tsx
  • src/renderer/src/components/settings/KimiAccountsSection.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/stats/CodexUsagePane.tsx
  • src/renderer/src/components/stats/codex-usage-account-filter.test.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/components/terminal-pane/pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/renderer/src/lib/runtime-agent-background-create.ts
  • src/renderer/src/runtime/remote-agent-session-launch.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/renderer/src/store/slices/usage-provider-slices.ts
  • src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/agent-session-host-authority.ts
  • src/shared/agent-session-option-catalog-claude-codex.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/codex-model-list-probe.test.ts
  • src/shared/codex-model-list-probe.ts
  • src/shared/codex-usage-account-filter-contract.test.ts
  • src/shared/codex-usage-account-filter-contract.ts
  • src/shared/codex-usage-types.ts
  • src/shared/commit-message-agent-spec.ts
  • src/shared/constants.ts
  • src/shared/protocol-version.ts
  • src/shared/provider-account-ref.test.ts
  • src/shared/provider-account-ref.ts
  • src/shared/rate-limit-types.ts
  • src/shared/types.ts

Comment thread src/main/ipc/pty.ts Resolved
Comment thread src/main/kimi-accounts/service.test.ts Resolved
Comment thread src/main/kimi-accounts/service.ts Resolved
Comment thread src/main/kimi-accounts/service.ts Resolved
Comment thread src/main/runtime/orca-runtime.ts Resolved
@rp0927
rp0927 force-pushed the feat/kimi-managed-accounts branch 3 times, most recently from 68246d8 to 33e0ce8 Compare August 14, 2026 10:56
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

♻️ Duplicate comments (2)
src/main/codex-accounts/runtime-home-service.ts (1)

283-295: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

The host system-default branch still returns without legacy shared-home reconciliation.

prepareForCodexLaunch calls this.reconcileLegacySharedHomeForRetainedPanes() before it returns null for the host system default (Line 252-257). Line 294 returns null without that call. A retained pre-rollout pane that still reads the shared mirror does not get refreshed auth on this lane.

A previous review raised this and it was marked addressed. The current code does not contain the call. Confirm the omission is intentional for the account-scoped path, or add the reconciliation.

Proposed change if reconciliation is required
       return home
     }
+    this.reconcileLegacySharedHomeForRetainedPanes()
     return null
   }
src/main/kimi-accounts/managed-home-ownership.ts (1)

24-32: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

realpathSync(expectedPath) can still throw a raw absolute path.

Line 24 checks only candidatePath. If the candidate exists but expectedPath does not, Line 29 throws an ENOENT error whose message contains the absolute managed path. realpathSync(args.managedAccountsRoot) at Line 27 has the same exposure. Callers outside the import and login flows do not sanitize these paths.

A previous review raised this and the author reported a fix. The guard is not present in this snapshot. Reject the missing paths with the existing generic messages.

🛡️ Proposed fix
-  if (!existsSync(args.candidatePath)) {
+  if (
+    !existsSync(args.candidatePath) ||
+    !existsSync(expectedPath) ||
+    !existsSync(args.managedAccountsRoot)
+  ) {
     throw new Error('Managed Kimi home does not exist on disk.')
   }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e313075-c320-4b6e-819d-c3a748954140

📥 Commits

Reviewing files that changed from the base of the PR and between cb42b60 and 33e0ce87ad8b0889df8389714cfc7184e5a86aad.

📒 Files selected for processing (134)
  • src/cli/handlers/account.test.ts
  • src/cli/handlers/account.ts
  • src/cli/handlers/terminal.test.ts
  • src/cli/handlers/terminal.ts
  • src/cli/help.ts
  • src/cli/specs/core.ts
  • src/main/agent-hooks/server.test.ts
  • src/main/agent-hooks/server.ts
  • src/main/ai-vault/cached-session-list.test.ts
  • src/main/ai-vault/cached-session-list.ts
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/main/ai-vault/session-scanner-kimi-managed.test.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/codex-usage/codex-usage-provider.ts
  • src/main/codex-usage/scanner-paths.test.ts
  • src/main/codex-usage/scanner.ts
  • src/main/codex-usage/store-snapshot.benchmark.test.ts
  • src/main/codex-usage/store.test.ts
  • src/main/codex-usage/store.ts
  • src/main/codex-usage/types.ts
  • src/main/codex/codex-session-account-attribution.test.ts
  • src/main/codex/codex-session-account-attribution.ts
  • src/main/codex/codex-session-account-registry.test.ts
  • src/main/codex/codex-session-account-registry.ts
  • src/main/index.ts
  • src/main/ipc/filesystem.test.ts
  • src/main/ipc/filesystem.ts
  • src/main/ipc/kimi-accounts.test.ts
  • src/main/ipc/kimi-accounts.ts
  • src/main/ipc/pty.test.ts
  • src/main/ipc/pty.ts
  • src/main/ipc/rate-limits.test.ts
  • src/main/ipc/rate-limits.ts
  • src/main/ipc/register-core-handlers.test.ts
  • src/main/ipc/register-core-handlers.ts
  • src/main/ipc/settings.test.ts
  • src/main/ipc/settings.ts
  • src/main/ipc/usage-provider-handlers.test.ts
  • src/main/ipc/usage-provider-handlers.ts
  • src/main/kimi-accounts/launch-environment.test.ts
  • src/main/kimi-accounts/launch-environment.ts
  • src/main/kimi-accounts/login-runner.test.ts
  • src/main/kimi-accounts/login-runner.ts
  • src/main/kimi-accounts/managed-home-copy.ts
  • src/main/kimi-accounts/managed-home-ownership.ts
  • src/main/kimi-accounts/managed-login-provisioning.ts
  • src/main/kimi-accounts/service.test.ts
  • src/main/kimi-accounts/service.ts
  • src/main/kimi/hook-service.test.ts
  • src/main/kimi/hook-service.ts
  • src/main/rate-limits/service.test.ts
  • src/main/rate-limits/service.ts
  • src/main/runtime/orca-runtime-agent-session-operation.test.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/agent-session.test.ts
  • src/main/runtime/rpc/methods/agent-session.ts
  • src/main/runtime/rpc/methods/ai-vault.test.ts
  • src/main/runtime/rpc/methods/git-params.ts
  • src/main/runtime/rpc/methods/git.test.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/main/usage/usage-event-aggregation.ts
  • src/main/usage/usage-provider-contract.ts
  • src/main/usage/usage-rollup-merge.ts
  • src/main/usage/usage-rollup-records.ts
  • src/main/window/attach-main-window-services.ts
  • src/preload/api-types.ts
  • src/preload/api/agent-account-api.ts
  • src/preload/api/agent-usage-api.ts
  • src/preload/api/git-inspection-api.ts
  • src/preload/api/pty-api.ts
  • src/preload/index.ts
  • src/preload/usage-provider-api.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/KimiAccountsSection.test.tsx
  • src/renderer/src/components/settings/KimiAccountsSection.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/stats/CodexUsagePane.tsx
  • src/renderer/src/components/stats/codex-usage-account-filter.test.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/components/terminal-pane/pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/renderer/src/lib/runtime-agent-background-create.ts
  • src/renderer/src/runtime/remote-agent-session-launch.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/renderer/src/store/slices/usage-provider-slices.ts
  • src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/agent-session-host-authority.ts
  • src/shared/agent-session-option-catalog-claude-codex.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/codex-model-list-probe.test.ts
  • src/shared/codex-model-list-probe.ts
  • src/shared/codex-usage-account-filter-contract.test.ts
  • src/shared/codex-usage-account-filter-contract.ts
  • src/shared/codex-usage-types.ts
  • src/shared/commit-message-agent-spec.ts
  • src/shared/constants.ts
  • src/shared/global-settings-types.ts
  • src/shared/managed-account-types.ts
  • src/shared/protocol-version.ts
  • src/shared/provider-account-ref.test.ts
  • src/shared/provider-account-ref.ts
  • src/shared/rate-limit-types.ts
  • src/shared/worktree/launch-types.ts
🚧 Files skipped from review as they are similar to previous changes (119)
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/renderer/src/components/terminal-pane/pty-transport.test.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/codex-usage/scanner.ts
  • src/main/ai-vault/session-scanner-kimi-managed.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.test.ts
  • src/main/ipc/rate-limits.test.ts
  • src/main/usage/usage-event-aggregation.ts
  • src/main/kimi-accounts/managed-home-copy.ts
  • src/main/agent-hooks/server.ts
  • src/renderer/src/components/settings/accounts-search.ts
  • src/shared/provider-account-ref.test.ts
  • src/main/kimi-accounts/launch-environment.ts
  • src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
  • src/main/codex-usage/store-snapshot.benchmark.test.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/main/codex-usage/types.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/cli/specs/core.ts
  • src/main/rate-limits/service.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/main/usage/usage-provider-contract.ts
  • src/shared/agent-session-host-authority.ts
  • src/main/codex/codex-session-account-registry.test.ts
  • src/shared/codex-usage-types.ts
  • src/main/codex-usage/scanner-paths.test.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/main/ipc/filesystem.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/main/runtime/rpc/methods/git.test.ts
  • src/shared/provider-account-ref.ts
  • src/shared/codex-usage-account-filter-contract.ts
  • src/main/agent-hooks/server.test.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/main/codex/codex-session-account-attribution.test.ts
  • src/main/codex-usage/codex-usage-provider.ts
  • src/main/kimi-accounts/launch-environment.test.ts
  • src/shared/rate-limit-types.ts
  • src/shared/codex-model-list-probe.test.ts
  • src/cli/handlers/account.test.ts
  • src/shared/codex-usage-account-filter-contract.test.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/runtime/rpc/methods/git-params.ts
  • src/main/runtime/rpc/methods/ai-vault.test.ts
  • src/main/ipc/kimi-accounts.test.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/cli/help.ts
  • src/main/kimi-accounts/login-runner.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.test.ts
  • src/shared/constants.ts
  • src/main/usage/usage-rollup-records.ts
  • src/renderer/src/components/settings/KimiAccountsSection.test.tsx
  • src/renderer/src/components/stats/CodexUsagePane.tsx
  • src/main/codex/codex-session-account-registry.ts
  • src/renderer/src/lib/runtime-agent-background-create.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
  • src/main/codex-usage/store.test.ts
  • src/shared/codex-model-list-probe.ts
  • src/preload/usage-provider-api.ts
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/main/ai-vault/cached-session-list.test.ts
  • src/main/ai-vault/cached-session-list.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
  • src/preload/index.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/main/ipc/usage-provider-handlers.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/main/ipc/register-core-handlers.test.ts
  • src/main/runtime/rpc/methods/agent-session.ts
  • src/main/kimi/hook-service.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/main/ipc/kimi-accounts.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/main/window/attach-main-window-services.ts
  • src/cli/handlers/terminal.ts
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
  • src/main/runtime/orca-runtime-agent-session-operation.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/shared/commit-message-agent-spec.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/main/ipc/settings.test.ts
  • src/main/runtime/rpc/methods/agent-session.test.ts
  • src/cli/handlers/terminal.test.ts
  • src/main/kimi-accounts/service.ts
  • src/main/ipc/usage-provider-handlers.ts
  • src/main/usage/usage-rollup-merge.ts
  • src/main/kimi/hook-service.test.ts
  • src/main/ipc/rate-limits.ts
  • src/main/ipc/register-core-handlers.ts
  • src/main/ipc/pty.test.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/shared/agent-session-option-catalog-claude-codex.ts
  • src/main/ipc/filesystem.ts
  • src/main/ipc/settings.ts
  • src/main/codex/codex-session-account-attribution.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/main/kimi-accounts/service.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/renderer/src/i18n/locales/en.json
  • src/main/codex-usage/store.ts
  • src/main/rate-limits/service.ts
  • src/renderer/src/store/slices/usage-provider-slices.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/protocol-version.ts
  • src/main/ipc/pty.ts
  • src/renderer/src/runtime/web-runtime-session.ts

Comment thread src/main/index.ts Resolved
Comment on lines +52 to +69
function terminateLogin(child: ChildProcess): void {
if (process.platform === 'win32' && child.pid) {
spawn('taskkill.exe', ['/pid', String(child.pid), '/t', '/f'], {
stdio: 'ignore',
windowsHide: true
}).once('error', () => child.kill())
return
}
if (child.pid) {
try {
process.kill(-child.pid, 'SIGTERM')
return
} catch {
// Fall back to the direct child when a process group is unavailable.
}
}
child.kill()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Wait for Kimi to exit before rejecting the login operation.

terminateLogin only requests termination. taskkill.exe runs asynchronously, and SIGTERM does not wait for process exit. The timeout and cancellation paths reject immediately after that request.

The caller can then remove or reuse KIMI_CODE_HOME while Kimi still writes credentials. Preserve the termination error, wait for close, and reject from that handler. Add a bounded forced-termination deadline so this wait cannot hang.

Also applies to: 95-98, 127-135

🧰 Tools
🪛 ast-grep (0.45.1)

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawn, type ChildProcess } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

Comment on lines +88 to +100
} catch (error) {
rmSync(pendingRoot, { recursive: true, force: true })
if (existsSync(accountRoot)) {
rmSync(accountRoot, { recursive: true, force: true })
}
const message = error instanceof Error ? error.message : 'Kimi sign-in failed.'
throw new Error(
message
.replaceAll(pendingRoot, '[managed home]')
.replaceAll(accountRoot, '[managed home]')
.replaceAll(args.managedAccountsRoot, '[managed accounts]')
)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Protect the rollback so a cleanup failure cannot replace the redacted error.

Line 89 and Line 91 run rmSync outside any guard. On Windows a login child that still holds a handle under pendingRoot makes rmSync throw EBUSY/EPERM. That error propagates instead of the redacted message, and its text contains the absolute pending path. The original failure reason is then lost.

Wrap the two removals so cleanup failures are logged and the redacted error still wins.

🛡️ Proposed fix
   } catch (error) {
-    rmSync(pendingRoot, { recursive: true, force: true })
-    if (existsSync(accountRoot)) {
-      rmSync(accountRoot, { recursive: true, force: true })
-    }
+    for (const staleRoot of [pendingRoot, accountRoot]) {
+      try {
+        rmSync(staleRoot, { recursive: true, force: true })
+      } catch (cleanupError) {
+        console.warn('[kimi-accounts] Failed to remove a partial managed home:', cleanupError)
+      }
+    }
     const message = error instanceof Error ? error.message : 'Kimi sign-in failed.'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} catch (error) {
rmSync(pendingRoot, { recursive: true, force: true })
if (existsSync(accountRoot)) {
rmSync(accountRoot, { recursive: true, force: true })
}
const message = error instanceof Error ? error.message : 'Kimi sign-in failed.'
throw new Error(
message
.replaceAll(pendingRoot, '[managed home]')
.replaceAll(accountRoot, '[managed home]')
.replaceAll(args.managedAccountsRoot, '[managed accounts]')
)
}
} catch (error) {
for (const staleRoot of [pendingRoot, accountRoot]) {
try {
rmSync(staleRoot, { recursive: true, force: true })
} catch (cleanupError) {
console.warn('[kimi-accounts] Failed to remove a partial managed home:', cleanupError)
}
}
const message = error instanceof Error ? error.message : 'Kimi sign-in failed.'
throw new Error(
message
.replaceAll(pendingRoot, '[managed home]')
.replaceAll(accountRoot, '[managed home]')
.replaceAll(args.managedAccountsRoot, '[managed accounts]')
)
}

(window): window is NonNullable<ProviderRateLimits['session']> => Boolean(window)
)
if (windows.length > 0) {
return windows.map((window) => `${Math.round(window.usedPercent)}% used`).join(' · ')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Localize the complete usage template.

"% used" is visible text. Localize the full template so translations can change word order and number formatting.

Based on learnings, settings strings use translate() with catalog keys.

Source: Learnings

Comment on lines +72 to +80
const load = useCallback(async (): Promise<void> => {
try {
setState(await window.api.kimiAccounts.list())
setError(null)
} catch (loadError) {
setError(errorMessage(loadError))
} finally {
setLoading(false)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Prevent an initial load from overwriting an account operation.

load() can resolve after run() has stored a newer account state. The stale list result then replaces the login, import, selection, or removal result in the UI. Disable account actions until the initial load completes, or discard obsolete load results.

Comment thread src/shared/managed-account-types.ts Resolved
@rp0927
rp0927 force-pushed the feat/kimi-managed-accounts branch 2 times, most recently from 5c26c71 to b93eebe Compare August 15, 2026 06:37
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f2289987-1bc9-4124-9b55-6fc7721ad7d9

📥 Commits

Reviewing files that changed from the base of the PR and between 5464525 and b93eebe59e14fcd960630031eca18ee33fc69b2a.

📒 Files selected for processing (134)
  • src/cli/handlers/account.test.ts
  • src/cli/handlers/account.ts
  • src/cli/handlers/terminal.test.ts
  • src/cli/handlers/terminal.ts
  • src/cli/help.ts
  • src/cli/specs/core.ts
  • src/main/agent-hooks/server.test.ts
  • src/main/agent-hooks/server.ts
  • src/main/ai-vault/cached-session-list.test.ts
  • src/main/ai-vault/cached-session-list.ts
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/main/ai-vault/session-scanner-kimi-managed.test.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/codex-usage/codex-usage-provider.ts
  • src/main/codex-usage/scanner-paths.test.ts
  • src/main/codex-usage/scanner.ts
  • src/main/codex-usage/store-snapshot.benchmark.test.ts
  • src/main/codex-usage/store.test.ts
  • src/main/codex-usage/store.ts
  • src/main/codex-usage/types.ts
  • src/main/codex/codex-session-account-attribution.test.ts
  • src/main/codex/codex-session-account-attribution.ts
  • src/main/codex/codex-session-account-registry.test.ts
  • src/main/codex/codex-session-account-registry.ts
  • src/main/index.ts
  • src/main/ipc/filesystem.test.ts
  • src/main/ipc/filesystem.ts
  • src/main/ipc/kimi-accounts.test.ts
  • src/main/ipc/kimi-accounts.ts
  • src/main/ipc/pty.test.ts
  • src/main/ipc/pty.ts
  • src/main/ipc/rate-limits.test.ts
  • src/main/ipc/rate-limits.ts
  • src/main/ipc/register-core-handlers.test.ts
  • src/main/ipc/register-core-handlers.ts
  • src/main/ipc/settings.test.ts
  • src/main/ipc/settings.ts
  • src/main/ipc/usage-provider-handlers.test.ts
  • src/main/ipc/usage-provider-handlers.ts
  • src/main/kimi-accounts/launch-environment.test.ts
  • src/main/kimi-accounts/launch-environment.ts
  • src/main/kimi-accounts/login-runner.test.ts
  • src/main/kimi-accounts/login-runner.ts
  • src/main/kimi-accounts/managed-home-copy.ts
  • src/main/kimi-accounts/managed-home-ownership.ts
  • src/main/kimi-accounts/managed-login-provisioning.ts
  • src/main/kimi-accounts/service.test.ts
  • src/main/kimi-accounts/service.ts
  • src/main/kimi/hook-service.test.ts
  • src/main/kimi/hook-service.ts
  • src/main/rate-limits/service.test.ts
  • src/main/rate-limits/service.ts
  • src/main/runtime/orca-runtime-agent-session-operation.test.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/agent-session.test.ts
  • src/main/runtime/rpc/methods/agent-session.ts
  • src/main/runtime/rpc/methods/ai-vault.test.ts
  • src/main/runtime/rpc/methods/git-params.ts
  • src/main/runtime/rpc/methods/git.test.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/main/usage/usage-event-aggregation.ts
  • src/main/usage/usage-provider-contract.ts
  • src/main/usage/usage-rollup-merge.ts
  • src/main/usage/usage-rollup-records.ts
  • src/main/window/attach-main-window-services.ts
  • src/preload/api-types.ts
  • src/preload/api/agent-account-api.ts
  • src/preload/api/agent-usage-api.ts
  • src/preload/api/git-inspection-api.ts
  • src/preload/api/pty-api.ts
  • src/preload/index.ts
  • src/preload/usage-provider-api.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/KimiAccountsSection.test.tsx
  • src/renderer/src/components/settings/KimiAccountsSection.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/stats/CodexUsagePane.tsx
  • src/renderer/src/components/stats/codex-usage-account-filter.test.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/components/terminal-pane/pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/renderer/src/lib/runtime-agent-background-create.ts
  • src/renderer/src/runtime/remote-agent-session-launch.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/renderer/src/store/slices/usage-provider-slices.ts
  • src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/agent-session-host-authority.ts
  • src/shared/agent-session-option-catalog-claude-codex.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/codex-model-list-probe.test.ts
  • src/shared/codex-model-list-probe.ts
  • src/shared/codex-usage-account-filter-contract.test.ts
  • src/shared/codex-usage-account-filter-contract.ts
  • src/shared/codex-usage-types.ts
  • src/shared/commit-message-agent-spec.ts
  • src/shared/constants.ts
  • src/shared/global-settings-types.ts
  • src/shared/managed-account-types.ts
  • src/shared/protocol-version.ts
  • src/shared/provider-account-ref.test.ts
  • src/shared/provider-account-ref.ts
  • src/shared/rate-limit-types.ts
  • src/shared/worktree/launch-types.ts
🚧 Files skipped from review as they are similar to previous changes (131)
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/cli/handlers/account.test.ts
  • src/main/ipc/filesystem.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/main/ipc/rate-limits.test.ts
  • src/main/usage/usage-rollup-merge.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/shared/provider-account-ref.test.ts
  • src/main/ipc/rate-limits.ts
  • src/main/kimi-accounts/login-runner.test.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/preload/api-types.ts
  • src/main/runtime/rpc/methods/git.test.ts
  • src/main/kimi-accounts/managed-home-ownership.ts
  • src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
  • src/shared/codex-usage-account-filter-contract.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/shared/codex-model-list-probe.test.ts
  • src/main/usage/usage-event-aggregation.ts
  • src/shared/constants.ts
  • src/main/ai-vault/cached-session-list.ts
  • src/renderer/src/components/settings/accounts-search.ts
  • src/cli/handlers/terminal.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport.test.ts
  • src/main/codex/codex-session-account-attribution.test.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.test.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/main/codex-usage/store-snapshot.benchmark.test.ts
  • src/main/codex-usage/types.ts
  • src/shared/protocol-version.ts
  • src/main/ipc/filesystem.ts
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/main/kimi-accounts/launch-environment.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/main/rate-limits/service.test.ts
  • src/main/agent-hooks/server.test.ts
  • src/main/kimi/hook-service.ts
  • src/main/ai-vault/cached-session-list.test.ts
  • src/main/kimi-accounts/managed-home-copy.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
  • src/shared/agent-session-host-authority.ts
  • src/renderer/src/runtime/remote-agent-session-launch.test.ts
  • src/main/window/attach-main-window-services.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/shared/provider-account-ref.ts
  • src/main/ipc/register-core-handlers.ts
  • src/main/ipc/kimi-accounts.ts
  • src/main/codex-usage/scanner-paths.test.ts
  • src/preload/index.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/cli/help.ts
  • src/shared/commit-message-agent-spec.ts
  • src/cli/specs/core.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/preload/api/agent-usage-api.ts
  • src/shared/global-settings-types.ts
  • src/main/ipc/kimi-accounts.test.ts
  • src/main/ipc/settings.ts
  • src/preload/api/pty-api.ts
  • src/main/codex/codex-session-account-registry.test.ts
  • src/preload/api/git-inspection-api.ts
  • src/main/ipc/settings.test.ts
  • src/shared/rate-limit-types.ts
  • src/main/ipc/usage-provider-handlers.test.ts
  • src/main/runtime/rpc/methods/ai-vault.test.ts
  • src/shared/agent-session-option-catalog.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
  • src/main/runtime/rpc/methods/agent-session.ts
  • src/main/kimi-accounts/managed-login-provisioning.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/main/ipc/pty.test.ts
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/renderer/src/components/settings/KimiAccountsSection.tsx
  • src/main/kimi/hook-service.test.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/main/runtime/orca-runtime-agent-session-operation.test.ts
  • src/shared/codex-usage-types.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/main/ai-vault/session-scanner-kimi-managed.test.ts
  • src/renderer/src/i18n/locales/en.json
  • src/shared/codex-usage-account-filter-contract.test.ts
  • src/shared/worktree/launch-types.ts
  • src/main/ipc/usage-provider-handlers.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/main/codex-usage/scanner.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/main/ipc/register-core-handlers.test.ts
  • src/main/codex/codex-session-account-registry.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
  • src/renderer/src/lib/runtime-agent-background-create.ts
  • src/main/kimi-accounts/launch-environment.ts
  • src/shared/managed-account-types.ts
  • src/preload/api/agent-account-api.ts
  • src/main/usage/usage-provider-contract.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/main/runtime/rpc/methods/agent-session.test.ts
  • src/main/codex-usage/codex-usage-provider.ts
  • src/main/codex/codex-session-account-attribution.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.ts
  • src/preload/usage-provider-api.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/main/codex-usage/store.test.ts
  • src/main/kimi-accounts/service.ts
  • src/cli/handlers/terminal.ts
  • src/shared/agent-session-option-catalog-claude-codex.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.ts
  • src/main/agent-hooks/server.ts
  • src/shared/codex-model-list-probe.ts
  • src/main/usage/usage-rollup-records.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/components/stats/CodexUsagePane.tsx
  • src/main/runtime/orca-runtime.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/store/slices/usage-provider-slices.ts
  • src/renderer/src/components/settings/KimiAccountsSection.test.tsx
  • src/main/runtime/rpc/methods/git-params.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/ipc/pty.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/main/rate-limits/service.ts
  • src/main/codex-usage/store.ts
  • src/main/index.ts

Comment thread src/cli/handlers/account.ts Resolved
@rp0927
rp0927 force-pushed the feat/kimi-managed-accounts branch from b93eebe to 1af743c Compare August 15, 2026 08:47
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

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.

@rp0927
rp0927 force-pushed the feat/kimi-managed-accounts branch 2 times, most recently from 373b0ff to 2a9e8ba Compare August 15, 2026 13:23
@rp0927

rp0927 commented Aug 15, 2026

Copy link
Copy Markdown
Author

Restacked onto current origin/main (c0a775454); force-pushed with --force-with-lease. New head: 2a9e8baf6.

The stack was also restructured so each PR is green on its own head — previously every follow-up fix landed on the tip (#13276), which meant ancestor heads failed typecheck/oxlint standalone and reviewers (including CodeRabbit) were reading a snapshot without the fixes. Details in #13276 (comment).

This head was verified standalone: typecheck:node, typecheck:web, typecheck:cli, oxlint all pass.

Added here: 2a9e8baf6 follows the scanAiVaultSessions → listAiVaultSessions rename on main.

@rp0927
rp0927 force-pushed the feat/kimi-managed-accounts branch from 2a9e8ba to 7c74f56 Compare August 15, 2026 13:35
@rp0927

rp0927 commented Aug 15, 2026

Copy link
Copy Markdown
Author

Formatting follow-up; new head 7c74f56e4. oxfmt reflow of the managed-account-types import in src/main/kimi-accounts/service.ts folded into the feature commit rather than added on top, so this head is oxfmt --check clean on its own. No behavior change; typecheck (node/web/cli) and oxlint still pass standalone.

rp0927 and others added 12 commits August 16, 2026 07:51
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) <[email protected]>
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) <[email protected]>
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) <[email protected]>
Claude-Session: https://claude.ai/code/session_01KvdKNvkWoiVSxqbw7DKmgm
@rp0927
rp0927 force-pushed the feat/kimi-managed-accounts branch from 7c74f56 to 59c93ac Compare August 15, 2026 22:59
@nwparker nwparker removed the P2 label Aug 19, 2026
@rp0927 rp0927 closed this Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants