Skip to content

refactor: remove legacy Gemini CLI support - #12789

Open
AmethystLiang wants to merge 11 commits into
mainfrom
refactor-remove-legacy-gemini-cli-current-main
Open

AmethystLiang wants to merge 11 commits into
mainfrom
refactor-remove-legacy-gemini-cli-current-main

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #5924 (which stays open). Credit to @siddqamar for the original work and audit — this is a clean re-implementation against current main rather than a rebase of those commits, because main has moved a long way since.

What this removes

Legacy Gemini CLI support, re-audited against current main rather than taken from the old branch:

  • Launchable agent — gemini is gone from TuiAgent, the agent catalog, quick-launch/quick-command options, launch args/permissions, and mobile's agent list.
  • Usage / rate limits — the Gemini OAuth extractor, usage fetcher, and bucket formatting. ProviderRateLimits['buckets'] (Gemini-only) is removed from the type.
  • AI vault — the Gemini session-scanner parsers and source discovery.
  • Managed hooks — src/main/gemini/hook-service.ts and its installer wiring.
  • Title/status heuristics — isGeminiTerminalTitle and the ✦ ⏲ ◇ ✋ glyph classifiers.
  • Settings UI — the Accounts "Use Gemini CLI credentials" section and its search entries.

What this deliberately keeps

Antigravity is not Gemini CLI. Its sessions live under ~/.gemini/antigravity-cli/, its hooks at ~/.gemini/config/hooks.json, its skills at ~/.gemini/antigravity/skills, and its models are literally named "Gemini 3.5 Flash". All of that stays. Every ~/.gemini path site was checked individually.

Not breaking existing configs

New src/main/retired-agent-settings-cleanup.ts scrubs retired ids at the profile-load boundary in persistence.ts (before the defaults merge, with loadNeedsSave = true), so a profile that referenced Gemini degrades instead of crashing or preselecting a missing agent. It covers:

defaultTuiAgent (→ null, so the composer falls back rather than preselecting), disabledTuiAgents, agentCmdOverrides, agentDefaultArgs, agentDefaultEnv, commitMessageAi, sourceControlAi (agentId, selectedModelByAgent, selectedModelByAgentByHost, discoveredModelsByAgent, actions, launchActionDefaults, actionOverrides, modelOverridesByOperation), ui.statusBarItems, and per-repo / per-projectHostSetup overrides. geminiCliOAuthEnabled is dropped.

Remote wire compatibility

Mixed client/host versions are the normal state, so retired ids stay accepted on the wire even though nothing publishes them anymore:

  • client-ui-schemas.ts — UiUpdate is .strict(), so an unknown key is a hard rejection. _antigravityStatusBarDefaultAdded stays as an accepted no-op, and the retired status-bar ids stay in the enum but are stripped by a transform (dropping them from the enum would make tolerateUnknownValues discard the whole statusBarItems field, silently losing an old client's other toggles). Extracted to client-ui-status-bar-items.ts to stay under max-lines.
  • mobile/src/components/accounts-snapshot.ts — still parses retired providers, so an older paired host's usage snapshot doesn't fail wholesale over one unused entry.

Reviewer callouts

  • The Antigravity usage / status-bar surface is removed. It had no credentials of its own — it read the Gemini CLI OAuth tokens. With those gone it could only ever report empty. Antigravity as an agent is untouched.
  • The Gemini WebGL renderer fallback ([Bug]: mid session flicker on terminal window #7428) is gone. resolvePaneRendererPolicy no longer takes a title or an owner; it resolves from userGpuMode, webglUnavailable, and context-loss containment only. This is a behavior change for anyone who was relying on Gemini panes silently falling back to DOM.
  • MANAGED_HOOK_TIMEOUT_MILLISECONDS was deleted as dead once the Gemini hook service went.
  • Orphan i18n strings are intentionally left in place in locales/*.json. Both verify:localization-catalog and verify:localization-extraction pass; pruning them is a separate sweep.

Testing

  • pnpm typecheck (node + cli + web) — passes, 0 errors
  • pnpm lint (oxlint, code-quality audits, reliability gates, max-lines ratchet, bundled skill guides, skill bundle manifest, all three localization gates) — passes
  • pnpm test — 4329 files / 46397 tests pass. The only failures are the 2 in src/relay/agent-exec-handler.test.ts, which fail identically on unmodified main (verified by stashing this branch's changes and re-running); they assert on spawn env and trip over GIT_CONFIG_COUNT leaking from the local shell. Unrelated to this change.

Tests were updated rather than deleted wherever the case covered a still-live contract that merely used Gemini as a fixture — substituting codex/droid/aider/pi so the original intent ("an unsupported agent", "a third agent row", "ambiguous sibling agents") survives. Tests were deleted only where they existed solely to cover removed behavior: the bucket windows, Antigravity usage durability, isGeminiTerminalTitle, and the four #7428 DOM-gating cases. retired-agent-settings-cleanup.test.ts is new and covers every scrubbed field, including the no-op path and a profile missing every optional collection.

Mobile typecheck could not run in this worktree (expo/tsconfig.base.json missing — deps not installed), so the mobile edits rely on CI.

Made with Orca 🐋

@greptile-apps

greptile-apps Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

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

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

@coderabbitai

coderabbitai Bot commented Aug 5, 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
📝 Walkthrough

Walkthrough

This change retires Gemini support across the application. It removes Gemini agent configuration, hooks, session scanning, OAuth and rate-limit handling, title detection, status-bar usage, native-chat support, settings UI, and shared type entries. Persisted profiles are cleaned during loading. Compatibility schemas still accept retired status-bar values before filtering them. Tests, fixtures, mobile mappings, help text, and bundled skill guides are updated accordingly.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the changes and testing, but it omits the required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the required sections, state “No visual change” if applicable, document the AI review and cross-platform checks, and provide the security audit and follow-up notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 46.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 summarizes the primary change: removing legacy Gemini CLI support.
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.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch refactor-remove-legacy-gemini-cli-current-main

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.

@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: 2

🧹 Nitpick comments (2)
src/main/retired-agent-settings-cleanup.test.ts (1)

71-84: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

toMatchObject cannot prove that retired keys were removed.

toMatchObject matches nested objects partially. A leftover gemini key inside selectedModelByAgent, discoveredModelsByAgent, or modelOverridesByOperation still satisfies this assertion, so the test passes even if dropRetiredAgentKeys regresses. Use toEqual on the cleaned sourceControlAi object, as the sibling tests at lines 92 and 104 already do.

💚 Proposed assertion change
-    expect(ai).toMatchObject({
+    expect(ai).toEqual({
       agentId: null,
       selectedModelByAgent: { claude: 'opus' },
       selectedModelByAgentByHost: { 'ssh:box': {} },
       discoveredModelsByAgent: {},
       actions: {
         commitMessage: { agentId: null, commandInputTemplate: '{diff}' },
         pullRequest: { agentId: 'claude' }
       },
       launchActionDefaults: { fixCommitFailure: { agentId: null } },
       modelOverridesByOperation: { commitMessage: { selectedModelByAgent: {} } }
     })
src/renderer/src/components/terminal-pane/terminal-renderer-policy.ts (1)

13-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Narrow RendererPolicyDecision.confidence.

resolvePaneRendererPolicy returns only 'authoritative', and current consumers pass only gpuEnabled. Drop fallback from RendererPolicyDecision, or remove confidence if this value is not needed by consumers.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 64f5840f-d409-4e22-bc84-e7bcbca98ee7

📥 Commits

Reviewing files that changed from the base of the PR and between ae1ed5e and eac8b37.

📒 Files selected for processing (187)
  • mobile/scripts/mock-server-rpc-handlers.ts
  • mobile/src/components/accounts-snapshot.ts
  • mobile/src/components/mobile-agent-icon-assets.ts
  • mobile/src/tasks/mobile-tui-agents.ts
  • mobile/src/worktree/agent-row-display.ts
  • skill-guides/orca-cli.md
  • skill-guides/orchestration.md
  • src/cli/bundled-skill-guides.ts
  • src/cli/help.ts
  • src/main/agent-hooks/installer-utils.test.ts
  • src/main/agent-hooks/installer-utils.ts
  • src/main/agent-hooks/managed-agent-hook-registry.ts
  • src/main/agent-hooks/managed-hook-local-filesystem.test.ts
  • src/main/agent-hooks/managed-hook-stdin-lifecycle.test.ts
  • src/main/agent-hooks/managed-hook-timeout.test.ts
  • src/main/agent-hooks/remote-hook-service-installers.test.ts
  • src/main/agent-hooks/remote-managed-hook-installers.ts
  • src/main/agent-hooks/server.test.ts
  • src/main/ai-vault/remote-session-scanner-sources.ts
  • src/main/ai-vault/session-scanner-accumulator.ts
  • src/main/ai-vault/session-scanner-agent-parser.ts
  • src/main/ai-vault/session-scanner-codex-workers.test.ts
  • src/main/ai-vault/session-scanner-gemini-parsers.ts
  • src/main/ai-vault/session-scanner-incremental-fixtures.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner-scope.test.ts
  • src/main/ai-vault/session-scanner-source-discovery.ts
  • src/main/ai-vault/session-scanner-test-fixtures.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/ai-vault/session-scanner.test.ts
  • src/main/ai-vault/session-scanner.ts
  • src/main/automations/service.test.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/service.test.ts
  • src/main/gemini/hook-service.test.ts
  • src/main/gemini/hook-service.ts
  • src/main/index.ts
  • src/main/ipc/agent-hooks.ts
  • src/main/ipc/notification-options.ts
  • src/main/opencode/hook-service.ts
  • src/main/persistence.test.ts
  • src/main/persistence.ts
  • src/main/pi/agent-status-extension-source.ts
  • src/main/providers/agent-foreground-process.test.ts
  • src/main/rate-limits/gemini-bucket-formatting.test.ts
  • src/main/rate-limits/gemini-bucket-formatting.ts
  • src/main/rate-limits/gemini-cli-oauth-extractor.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.test-fixtures.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.ts
  • src/main/rate-limits/service.test.ts
  • src/main/rate-limits/service.ts
  • src/main/retired-agent-settings-cleanup.test.ts
  • src/main/retired-agent-settings-cleanup.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/orchestration/groups.ts
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/main/runtime/rpc/methods/client-ui-status-bar-items.ts
  • src/main/runtime/rpc/methods/client-ui.test.ts
  • src/main/runtime/rpc/methods/orchestration.ts
  • src/main/skills/discovery.test.ts
  • src/main/skills/skill-discovery-sources.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/relay/pty-shell-utils.test.ts
  • src/renderer/src/components/agent-session-continuation/agent-session-continuation-selection.test.ts
  • src/renderer/src/components/feature-wall/feature-wall-usage-tracking.ts
  • src/renderer/src/components/native-chat/NativeChatView.test.tsx
  • src/renderer/src/components/native-chat/native-chat-availability.test.ts
  • src/renderer/src/components/native-chat/native-chat-availability.ts
  • src/renderer/src/components/native-chat/native-chat-image-paste.ts
  • src/renderer/src/components/native-chat/native-chat-pane-resolution.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/renderer/src/components/native-chat/use-native-chat-toggle-shortcut.test.ts
  • src/renderer/src/components/native-chat/use-native-chat-toggle-shortcut.ts
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/AppearancePane.test.tsx
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/renderer/src/components/settings/CommitMessageAiPane.test.tsx
  • src/renderer/src/components/settings/OrchestrationPane.test.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/settings/appearance-status-bar-antigravity-toggle-search.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.test.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/renderer/src/components/sidebar/smart-attention.test.ts
  • src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageEmptyCta.tsx
  • src/renderer/src/components/status-bar/UsageRosterPanel.tsx
  • src/renderer/src/components/status-bar/icons.tsx
  • src/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsx
  • src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/components/status-bar/tooltip.test.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.test.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/renderer/src/components/tab-bar/TabBarCreateEntry.keyboard.test.tsx
  • src/renderer/src/components/tab-bar/tab-agent-launch-options.test.ts
  • src/renderer/src/components/terminal-pane/agent-completion-coordinator.test.ts
  • src/renderer/src/components/terminal-pane/agent-completion-coordinator.ts
  • src/renderer/src/components/terminal-pane/agent-interrupt-inference.test.ts
  • src/renderer/src/components/terminal-pane/agent-interrupt-inference.ts
  • src/renderer/src/components/terminal-pane/pane-foreground-agent-tracker.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/terminal-renderer-policy.test.ts
  • src/renderer/src/components/terminal-pane/terminal-renderer-policy.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.test.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.ts
  • src/renderer/src/components/terminal-pane/title-agent-identity.ts
  • src/renderer/src/components/terminal-quick-commands/terminal-quick-command-agent-options.test.ts
  • src/renderer/src/components/terminal-quick-commands/terminal-quick-command-agent-options.ts
  • src/renderer/src/hooks/useSettingsNavigationMetadata.ts
  • src/renderer/src/lib/agent-catalog.tsx
  • src/renderer/src/lib/agent-favicon-assets.ts
  • src/renderer/src/lib/agent-launch-prompt-delivery.test.ts
  • src/renderer/src/lib/agent-paste-draft.test.ts
  • src/renderer/src/lib/agent-paste-draft.ts
  • src/renderer/src/lib/agent-send-title-status.ts
  • src/renderer/src/lib/agent-status-count.test.ts
  • src/renderer/src/lib/agent-status.test.ts
  • src/renderer/src/lib/agent-status.ts
  • src/renderer/src/lib/native-chat-initial-view-mode.test.ts
  • src/renderer/src/lib/native-chat-launch-draft-mirrorability.test.ts
  • src/renderer/src/lib/orchestration-skill-coverage.test.ts
  • src/renderer/src/lib/tui-agent-startup.test.ts
  • src/renderer/src/lib/use-tab-agent-pi-identity.test.ts
  • src/renderer/src/lib/use-tab-agent-retained-identity.test.ts
  • src/renderer/src/lib/use-tab-agent-sleeping-session.test.ts
  • src/renderer/src/lib/use-tab-agent.test.ts
  • src/renderer/src/store/slices/rate-limits.test.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/store/slices/runtime-pane-title-sort-epoch.test.ts
  • src/renderer/src/store/slices/ui.test.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/store/slices/workspace-cleanup.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/agent-detection.ts
  • src/shared/agent-hook-listener.test.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/agent-hook-relay.ts
  • src/shared/agent-hook-types.ts
  • src/shared/agent-kind.ts
  • src/shared/agent-name-token-match.ts
  • src/shared/agent-process-recognition.test.ts
  • src/shared/agent-process-recognition.ts
  • src/shared/agent-row-conversation-name.test.ts
  • src/shared/agent-row-conversation-name.ts
  • src/shared/agent-session-option-catalog-cursor.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/agent-session-resume.test.ts
  • src/shared/agent-session-resume.ts
  • src/shared/agent-status-types.ts
  • src/shared/agent-title-core.ts
  • src/shared/agent-title-decoration.ts
  • src/shared/agent-title-identity.ts
  • src/shared/agent-title-status.ts
  • src/shared/agent-type-label.ts
  • src/shared/ai-vault-resume-command.ts
  • src/shared/ai-vault-types.ts
  • src/shared/constants.test.ts
  • src/shared/constants.ts
  • src/shared/feature-wall-tiles.ts
  • src/shared/rate-limit-types.test.ts
  • src/shared/rate-limit-types.ts
  • src/shared/skills-cli-agent-keys.ts
  • src/shared/status-bar-defaults.ts
  • src/shared/telemetry-events.ts
  • src/shared/terminal-quick-commands.test.ts
  • src/shared/terminal-title-agent-type.test.ts
  • src/shared/terminal-title-agent-type.ts
  • src/shared/tui-agent-config.ts
  • src/shared/tui-agent-display-names.ts
  • src/shared/tui-agent-permissions.ts
  • src/shared/tui-agent-selection.test.ts
  • src/shared/tui-agent-selection.ts
  • src/shared/types.ts
💤 Files with no reviewable changes (90)
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/main/ai-vault/session-scanner-test-fixtures.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/shared/status-bar-defaults.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.test.ts
  • src/shared/agent-type-label.ts
  • src/main/ai-vault/session-scanner-codex-workers.test.ts
  • src/shared/agent-status-types.ts
  • src/main/ai-vault/session-scanner-scope.test.ts
  • src/main/ai-vault/session-scanner-agent-parser.ts
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/main/ai-vault/session-scanner-incremental-fixtures.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/shared/agent-hook-relay.ts
  • src/main/ai-vault/session-scanner-gemini-parsers.ts
  • src/renderer/src/components/settings/CommitMessageAiPane.test.tsx
  • src/main/gemini/hook-service.ts
  • src/renderer/src/components/terminal-pane/agent-interrupt-inference.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.ts
  • src/main/rate-limits/gemini-bucket-formatting.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.test-fixtures.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/rate-limits/gemini-cli-oauth-extractor.ts
  • src/renderer/src/components/settings/appearance-status-bar-antigravity-toggle-search.ts
  • src/main/ipc/notification-options.ts
  • src/shared/terminal-quick-commands.test.ts
  • src/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsx
  • src/main/rate-limits/gemini-bucket-formatting.ts
  • src/renderer/src/components/settings/AppearancePane.test.tsx
  • src/main/runtime/orchestration/groups.ts
  • src/main/gemini/hook-service.test.ts
  • src/shared/tui-agent-selection.ts
  • src/shared/agent-hook-listener.test.ts
  • src/main/ai-vault/session-scanner-source-discovery.ts
  • src/shared/tui-agent-permissions.ts
  • src/renderer/src/components/native-chat/native-chat-image-paste.ts
  • src/main/index.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.test.ts
  • src/preload/api-types.ts
  • src/main/ipc/agent-hooks.ts
  • src/main/skills/skill-discovery-sources.ts
  • src/shared/agent-row-conversation-name.test.ts
  • src/shared/agent-session-option-catalog-cursor.ts
  • src/shared/agent-title-identity.ts
  • src/shared/constants.ts
  • src/main/agent-hooks/remote-managed-hook-installers.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/shared/ai-vault-resume-command.ts
  • src/shared/agent-kind.ts
  • src/preload/index.ts
  • src/shared/constants.test.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • mobile/src/tasks/mobile-tui-agents.ts
  • src/main/codex-accounts/service.test.ts
  • src/main/ai-vault/session-scanner.test.ts
  • src/shared/agent-session-resume.ts
  • src/shared/tui-agent-display-names.ts
  • src/main/skills/discovery.test.ts
  • src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts
  • src/shared/telemetry-events.ts
  • src/renderer/src/components/status-bar/icons.tsx
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/shared/agent-name-token-match.ts
  • src/shared/ai-vault-types.ts
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/shared/skills-cli-agent-keys.ts
  • src/main/ai-vault/remote-session-scanner-sources.ts
  • src/renderer/src/lib/agent-catalog.tsx
  • src/shared/agent-title-core.ts
  • src/shared/agent-detection.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/terminal-title-agent-type.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/renderer/src/components/terminal-quick-commands/terminal-quick-command-agent-options.ts
  • mobile/src/components/mobile-agent-icon-assets.ts
  • src/main/agent-hooks/managed-agent-hook-registry.ts
  • src/renderer/src/store/slices/workspace-cleanup.ts
  • src/shared/agent-title-status.ts
  • src/renderer/src/components/terminal-pane/agent-completion-coordinator.ts
  • src/renderer/src/lib/agent-status.ts
  • src/renderer/src/lib/agent-favicon-assets.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.ts
  • src/shared/types.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/renderer/src/lib/agent-send-title-status.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/tui-agent-config.ts

Comment thread src/renderer/src/hooks/useSettingsNavigationMetadata.ts
Comment thread src/shared/rate-limit-types.test.ts Outdated
@AmethystLiang

Copy link
Copy Markdown
Contributor Author

@coderabbitai Fixing. Will be in the next commit

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@AmethystLiang Acknowledged. I will verify the fix after the next commit.

You are interacting with an AI system.

@AmethystLiang
AmethystLiang force-pushed the refactor-remove-legacy-gemini-cli-current-main branch from 37d6238 to c49f4c4 Compare August 7, 2026 17:15
@coderabbitai

coderabbitai Bot commented Aug 7, 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: 2

🧹 Nitpick comments (3)
src/main/agent-hooks/remote-managed-hook-installers.ts (1)

83-88: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Check the abort signal before the remote cleanup.

The cleanup performs SFTP writes and unlinks on the remote home. It runs before any options?.signal?.throwIfAborted() call. If the relay request is already cancelled, this still mutates remote user config, which contradicts the contract stated at Lines 95-97.

Add the abort check first. Note that removeRetiredGeminiManagedHooksRemote already swallows its own errors, so the surrounding try/catch is defensive only.

♻️ Proposed change
   // Why: strip retired Gemini CLI hooks on remote homes the same way as local.
+  options?.signal?.throwIfAborted()
   try {
     await removeRetiredGeminiManagedHooksRemote(sftp, remoteHome)
   } catch (error) {
     console.warn('[agent-hooks] Failed to clean retired remote Gemini managed hooks:', error)
   }
src/main/automations/headless-dispatch.ts (1)

120-140: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Terminate the completion chain with a final rejection handler.

markDispatchResult performs store writes and usage collection, so it can reject. Two paths leak that rejection:

  • If markDispatchResult rejects inside .then at Lines 122-131, the .catch at Lines 132-139 runs and calls markDispatchResult a second time with dispatch_failed.
  • If the .catch handler itself rejects, nothing handles it. The chain starts with void, so the process reports an unhandled rejection.

Add a terminal .catch that only logs. Also consider passing precheckResult in the failure branch for parity with the success branch.

♻️ Proposed change
         .catch((error) =>
           markDispatchResult({
             runId: run.id,
             status: 'dispatch_failed',
             ...launchRunTarget,
+            precheckResult,
             error: error instanceof Error ? error.message : String(error)
           })
         )
+        .catch((error) => {
+          console.warn('[automations] Failed to persist headless dispatch result:', error)
+        })
src/main/retired-agent-settings-cleanup.ts (1)

91-104: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoff

Avoid two full serializations of the persisted state.

JSON.stringify(state) runs twice over the whole profile, which includes githubCache, automationRuns, and workspace session partitions. Large profiles reach several megabytes, so this allocates two full copies on every load in addition to the recursive walk.

Track mutations with a flag inside scrub and dropRetiredKeys instead.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bb096cad-c008-4cb2-a8ef-3b714539512a

📥 Commits

Reviewing files that changed from the base of the PR and between bc1e049 and c49f4c4.

⛔ Files ignored due to path filters (1)
  • src/shared/agent-icons/gemini.png is excluded by !**/*.png
📒 Files selected for processing (230)
  • config/electron-builder.config.cjs
  • config/scripts/verify-agent-hook-stdin-lifecycle.mjs
  • config/tsconfig.cli.json
  • mobile/scripts/mock-server-rpc-handlers.ts
  • mobile/src/components/accounts-snapshot.ts
  • mobile/src/components/mobile-agent-icon-assets.ts
  • mobile/src/session/mobile-terminal-tab-agent.test.ts
  • mobile/src/tasks/mobile-tui-agents.ts
  • mobile/src/worktree/agent-row-display.ts
  • skill-guides/orca-cli.md
  • skill-guides/orchestration.md
  • src/cli/bundled-skill-guides.ts
  • src/cli/help.ts
  • src/main/agent-hooks/installer-utils.test.ts
  • src/main/agent-hooks/installer-utils.ts
  • src/main/agent-hooks/managed-agent-hook-controls.ts
  • src/main/agent-hooks/managed-agent-hook-registry.ts
  • src/main/agent-hooks/managed-hook-local-filesystem.test.ts
  • src/main/agent-hooks/managed-hook-runtime.ts
  • src/main/agent-hooks/managed-hook-stdin-lifecycle.test.ts
  • src/main/agent-hooks/managed-hook-timeout.test.ts
  • src/main/agent-hooks/remote-hook-service-installers.test.ts
  • src/main/agent-hooks/remote-managed-hook-installers.ts
  • src/main/agent-hooks/retired-gemini-hook-cleanup.test.ts
  • src/main/agent-hooks/retired-gemini-hook-cleanup.ts
  • src/main/agent-hooks/server.test.ts
  • src/main/agent-hooks/wsl-hook-fs-adapter.ts
  • src/main/agent-hooks/wsl-hook-relay-manager.test.ts
  • src/main/ai-vault/remote-session-scanner-sources.ts
  • src/main/ai-vault/session-scanner-accumulator.ts
  • src/main/ai-vault/session-scanner-agent-parser.ts
  • src/main/ai-vault/session-scanner-codex-workers.test.ts
  • src/main/ai-vault/session-scanner-gemini-parsers.ts
  • src/main/ai-vault/session-scanner-incremental-fixtures.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner-scope.test.ts
  • src/main/ai-vault/session-scanner-source-discovery.ts
  • src/main/ai-vault/session-scanner-test-fixtures.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/ai-vault/session-scanner.test.ts
  • src/main/ai-vault/session-scanner.ts
  • src/main/automations/headless-dispatch.ts
  • src/main/automations/headless-workspace-create.test.ts
  • src/main/automations/headless-workspace-create.ts
  • src/main/automations/service.test.ts
  • src/main/automations/service.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/service.test.ts
  • src/main/gemini/hook-service.test.ts
  • src/main/gemini/hook-service.ts
  • src/main/index.ts
  • src/main/ipc/agent-hooks.test.ts
  • src/main/ipc/agent-hooks.ts
  • src/main/ipc/notification-options.ts
  • src/main/opencode/hook-service.ts
  • src/main/persistence.test.ts
  • src/main/persistence.ts
  • src/main/pi/agent-status-extension-source.ts
  • src/main/providers/agent-foreground-process.test.ts
  • src/main/rate-limits/gemini-bucket-formatting.test.ts
  • src/main/rate-limits/gemini-bucket-formatting.ts
  • src/main/rate-limits/gemini-cli-oauth-extractor.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.test-fixtures.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.ts
  • src/main/rate-limits/service.test.ts
  • src/main/rate-limits/service.ts
  • src/main/retired-agent-settings-cleanup.test.ts
  • src/main/retired-agent-settings-cleanup.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/orchestration/groups.ts
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/main/runtime/rpc/methods/client-ui-status-bar-items.ts
  • src/main/runtime/rpc/methods/client-ui.test.ts
  • src/main/runtime/rpc/methods/orchestration-worker-launch-preferences.test.ts
  • src/main/runtime/rpc/methods/orchestration.ts
  • src/main/runtime/rpc/methods/worktree-schemas.test.ts
  • src/main/runtime/rpc/methods/worktree-schemas.ts
  • src/main/skills/discovery.test.ts
  • src/main/skills/skill-discovery-sources.ts
  • src/main/ssh/ssh-relay-session-managed-hooks.test.ts
  • src/main/ssh/ssh-relay-session.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/relay/agent-exec-handler-test-harness.ts
  • src/relay/agent-exec-handler.test.ts
  • src/relay/pty-shell-utils.test.ts
  • src/renderer/src/components/agent-session-continuation/agent-session-continuation-selection.test.ts
  • src/renderer/src/components/automations/AutomationDetail.tsx
  • src/renderer/src/components/automations/AutomationsPage.tsx
  • src/renderer/src/components/automations/automation-draft-model.ts
  • src/renderer/src/components/automations/automation-host-client.test.ts
  • src/renderer/src/components/automations/automation-source-availability.ts
  • src/renderer/src/components/automations/automation-target-availability.ts
  • src/renderer/src/components/dashboard/dashboard-worktree-launch-options.test.ts
  • src/renderer/src/components/feature-wall/feature-wall-usage-tracking.ts
  • src/renderer/src/components/native-chat/NativeChatView.test.tsx
  • src/renderer/src/components/native-chat/native-chat-availability.test.ts
  • src/renderer/src/components/native-chat/native-chat-availability.ts
  • src/renderer/src/components/native-chat/native-chat-image-paste.ts
  • src/renderer/src/components/native-chat/native-chat-pane-resolution.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/renderer/src/components/native-chat/use-native-chat-toggle-shortcut.test.ts
  • src/renderer/src/components/native-chat/use-native-chat-toggle-shortcut.ts
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/AppearancePane.test.tsx
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/renderer/src/components/settings/CommitMessageAiPane.test.tsx
  • src/renderer/src/components/settings/OrchestrationPane.test.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/settings/appearance-status-bar-antigravity-toggle-search.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.test.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/renderer/src/components/sidebar/smart-attention.test.ts
  • src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageEmptyCta.tsx
  • src/renderer/src/components/status-bar/UsageRosterPanel.tsx
  • src/renderer/src/components/status-bar/icons.tsx
  • src/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsx
  • src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/components/status-bar/tooltip.test.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.test.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/renderer/src/components/tab-bar/TabBarCreateEntry.keyboard.test.tsx
  • src/renderer/src/components/tab-bar/tab-agent-launch-options.test.ts
  • src/renderer/src/components/terminal-pane/agent-completion-coordinator.test.ts
  • src/renderer/src/components/terminal-pane/agent-completion-coordinator.ts
  • src/renderer/src/components/terminal-pane/agent-interrupt-inference.test.ts
  • src/renderer/src/components/terminal-pane/agent-interrupt-inference.ts
  • src/renderer/src/components/terminal-pane/pane-foreground-agent-tracker.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/remote-hidden-output-restore-outcomes.test.ts
  • src/renderer/src/components/terminal-pane/remote-hidden-output-restore-unavailable-banner.repro.test.ts
  • src/renderer/src/components/terminal-pane/terminal-renderer-policy.test.ts
  • src/renderer/src/components/terminal-pane/terminal-renderer-policy.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.test.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.ts
  • src/renderer/src/components/terminal-pane/title-agent-identity.ts
  • src/renderer/src/components/terminal-quick-commands/terminal-quick-command-agent-options.test.ts
  • src/renderer/src/components/terminal-quick-commands/terminal-quick-command-agent-options.ts
  • src/renderer/src/hooks/useAutomationDispatchEvents.ts
  • src/renderer/src/hooks/useSettingsNavigationMetadata.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/agent-catalog.tsx
  • src/renderer/src/lib/agent-favicon-assets.ts
  • src/renderer/src/lib/agent-launch-prompt-delivery.test.ts
  • src/renderer/src/lib/agent-paste-draft.test.ts
  • src/renderer/src/lib/agent-paste-draft.ts
  • src/renderer/src/lib/agent-send-title-status.ts
  • src/renderer/src/lib/agent-status-count.test.ts
  • src/renderer/src/lib/agent-status.test.ts
  • src/renderer/src/lib/agent-status.ts
  • src/renderer/src/lib/launch-agent-background-session.ts
  • src/renderer/src/lib/native-chat-initial-view-mode.test.ts
  • src/renderer/src/lib/native-chat-launch-draft-mirrorability.test.ts
  • src/renderer/src/lib/orchestration-skill-coverage.test.ts
  • src/renderer/src/lib/tui-agent-startup.test.ts
  • src/renderer/src/lib/use-tab-agent-pi-identity.test.ts
  • src/renderer/src/lib/use-tab-agent-retained-identity.test.ts
  • src/renderer/src/lib/use-tab-agent-sleeping-session.test.ts
  • src/renderer/src/lib/use-tab-agent.test.ts
  • src/renderer/src/store/slices/rate-limits.test.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/store/slices/runtime-pane-title-sort-epoch.test.ts
  • src/renderer/src/store/slices/ui.test.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/store/slices/workspace-cleanup.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/agent-detection.ts
  • src/shared/agent-hook-listener.test.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/agent-hook-relay.ts
  • src/shared/agent-hook-types.ts
  • src/shared/agent-kind.ts
  • src/shared/agent-name-token-match.ts
  • src/shared/agent-process-recognition.test.ts
  • src/shared/agent-process-recognition.ts
  • src/shared/agent-row-conversation-name.test.ts
  • src/shared/agent-row-conversation-name.ts
  • src/shared/agent-session-option-catalog-cursor.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/agent-session-resume.test.ts
  • src/shared/agent-session-resume.ts
  • src/shared/agent-status-types.ts
  • src/shared/agent-title-core.ts
  • src/shared/agent-title-decoration.ts
  • src/shared/agent-title-identity.ts
  • src/shared/agent-title-status.ts
  • src/shared/agent-type-label.ts
  • src/shared/ai-vault-resume-command.ts
  • src/shared/ai-vault-types.ts
  • src/shared/automations-types.ts
  • src/shared/constants.test.ts
  • src/shared/constants.ts
  • src/shared/feature-wall-tiles.ts
  • src/shared/rate-limit-types.test.ts
  • src/shared/rate-limit-types.ts
  • src/shared/skills-cli-agent-keys.ts
  • src/shared/status-bar-defaults.ts
  • src/shared/telemetry-events.ts
  • src/shared/terminal-quick-commands.test.ts
  • src/shared/terminal-title-agent-type.test.ts
  • src/shared/terminal-title-agent-type.ts
  • src/shared/tui-agent-config.ts
  • src/shared/tui-agent-display-names.ts
  • src/shared/tui-agent-draft-launch.ts
  • src/shared/tui-agent-permissions.ts
  • src/shared/tui-agent-selection.test.ts
  • src/shared/tui-agent-selection.ts
  • src/shared/tui-agent-session-option-props.ts
  • src/shared/tui-agent-startup.test.ts
  • src/shared/tui-agent-startup.ts
  • src/shared/types.ts
💤 Files with no reviewable changes (91)
  • src/renderer/src/components/terminal-pane/remote-hidden-output-restore-outcomes.test.ts
  • src/renderer/src/components/native-chat/native-chat-image-paste.ts
  • src/shared/constants.test.ts
  • src/shared/ai-vault-resume-command.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/preload/index.ts
  • src/main/runtime/orchestration/groups.ts
  • mobile/src/tasks/mobile-tui-agents.ts
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/renderer/src/components/terminal-pane/remote-hidden-output-restore-unavailable-banner.repro.test.ts
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/renderer/src/components/terminal-pane/agent-completion-coordinator.ts
  • src/main/rate-limits/gemini-cli-oauth-extractor.ts
  • src/main/ai-vault/session-scanner-scope.test.ts
  • src/main/runtime/rpc/methods/orchestration-worker-launch-preferences.test.ts
  • mobile/src/components/mobile-agent-icon-assets.ts
  • src/main/ai-vault/session-scanner-codex-workers.test.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/renderer/src/lib/agent-status.ts
  • src/main/ai-vault/session-scanner-source-discovery.ts
  • src/main/ai-vault/session-scanner-test-fixtures.ts
  • src/main/skills/skill-discovery-sources.ts
  • src/shared/agent-title-identity.ts
  • src/shared/agent-name-token-match.ts
  • src/main/agent-hooks/managed-agent-hook-registry.ts
  • src/main/ai-vault/session-scanner.test.ts
  • src/renderer/src/components/settings/CommitMessageAiPane.test.tsx
  • src/main/ai-vault/session-scanner-gemini-parsers.ts
  • src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/ipc/agent-hooks.test.ts
  • src/shared/agent-status-types.ts
  • src/main/rate-limits/gemini-usage-fetcher.ts
  • src/shared/agent-detection.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/agent-title-core.ts
  • src/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsx
  • src/main/rate-limits/gemini-usage-fetcher.test-fixtures.ts
  • src/renderer/src/components/status-bar/icons.tsx
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/renderer/src/components/terminal-quick-commands/terminal-quick-command-agent-options.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/shared/constants.ts
  • src/main/ai-vault/session-scanner-agent-parser.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/preload/api-types.ts
  • src/renderer/src/lib/agent-send-title-status.ts
  • src/main/ipc/agent-hooks.ts
  • src/shared/agent-hook-listener.test.ts
  • src/renderer/src/store/slices/workspace-cleanup.ts
  • src/shared/agent-row-conversation-name.test.ts
  • src/renderer/src/lib/agent-catalog.tsx
  • src/renderer/src/lib/agent-favicon-assets.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/ai-vault/remote-session-scanner-sources.ts
  • config/electron-builder.config.cjs
  • src/renderer/src/components/settings/appearance-status-bar-antigravity-toggle-search.ts
  • src/main/ipc/notification-options.ts
  • src/shared/agent-session-option-catalog-cursor.ts
  • src/shared/agent-title-status.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/shared/agent-session-resume.ts
  • src/main/skills/discovery.test.ts
  • src/shared/agent-hook-relay.ts
  • src/shared/status-bar-defaults.ts
  • src/main/ai-vault/session-scanner-incremental-fixtures.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/shared/agent-kind.ts
  • src/main/gemini/hook-service.ts
  • src/shared/agent-type-label.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/main/rate-limits/gemini-bucket-formatting.ts
  • src/main/codex-accounts/service.test.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/shared/ai-vault-types.ts
  • src/main/gemini/hook-service.test.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.test.ts
  • src/shared/tui-agent-display-names.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.ts
  • src/renderer/src/components/settings/AppearancePane.test.tsx
  • src/renderer/src/components/terminal-pane/agent-interrupt-inference.test.ts
  • src/shared/skills-cli-agent-keys.ts
  • src/shared/terminal-title-agent-type.ts
  • src/main/rate-limits/gemini-bucket-formatting.test.ts
  • src/shared/telemetry-events.ts
  • src/renderer/src/components/settings/accounts-search.ts
  • src/shared/types.ts
  • src/shared/terminal-quick-commands.test.ts
  • src/shared/tui-agent-permissions.ts
🚧 Files skipped from review as they are similar to previous changes (94)
  • mobile/scripts/mock-server-rpc-handlers.ts
  • src/main/agent-hooks/installer-utils.test.ts
  • src/renderer/src/lib/use-tab-agent-retained-identity.test.ts
  • src/renderer/src/components/native-chat/NativeChatView.test.tsx
  • src/shared/feature-wall-tiles.ts
  • src/renderer/src/hooks/useSettingsNavigationMetadata.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/renderer/src/lib/agent-launch-prompt-delivery.test.ts
  • src/renderer/src/lib/native-chat-initial-view-mode.test.ts
  • src/shared/agent-row-conversation-name.ts
  • mobile/src/worktree/agent-row-display.ts
  • src/shared/agent-process-recognition.ts
  • src/renderer/src/components/tab-bar/TabBarCreateEntry.keyboard.test.tsx
  • src/main/agent-hooks/installer-utils.ts
  • src/main/agent-hooks/managed-hook-timeout.test.ts
  • src/renderer/src/components/tab-bar/tab-agent-launch-options.test.ts
  • src/renderer/src/lib/use-tab-agent-pi-identity.test.ts
  • src/shared/agent-process-recognition.test.ts
  • skill-guides/orchestration.md
  • src/shared/agent-session-option-catalog.ts
  • src/renderer/src/store/slices/rate-limits.test.ts
  • src/main/runtime/rpc/methods/client-ui.test.ts
  • src/renderer/src/lib/use-tab-agent-sleeping-session.test.ts
  • src/renderer/src/lib/agent-paste-draft.ts
  • src/renderer/src/components/terminal-quick-commands/terminal-quick-command-agent-options.test.ts
  • src/renderer/src/components/agent-session-continuation/agent-session-continuation-selection.test.ts
  • src/renderer/src/lib/agent-paste-draft.test.ts
  • src/main/ai-vault/session-scanner-accumulator.ts
  • src/main/pi/agent-status-extension-source.ts
  • src/renderer/src/components/terminal-pane/terminal-renderer-policy.ts
  • src/main/persistence.test.ts
  • src/renderer/src/components/terminal-pane/agent-interrupt-inference.ts
  • src/renderer/src/store/slices/ui.test.ts
  • mobile/src/components/accounts-snapshot.ts
  • src/renderer/src/components/settings/OrchestrationPane.test.tsx
  • src/main/ai-vault/session-scanner.ts
  • src/renderer/src/components/terminal-pane/title-agent-identity.ts
  • src/main/runtime/rpc/methods/orchestration.ts
  • src/renderer/src/components/native-chat/use-native-chat-toggle-shortcut.test.ts
  • src/renderer/src/store/slices/runtime-pane-title-sort-epoch.test.ts
  • src/renderer/src/i18n/locales/en.json
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/renderer/src/components/native-chat/native-chat-pane-resolution.test.ts
  • src/renderer/src/components/feature-wall/feature-wall-usage-tracking.ts
  • src/renderer/src/lib/native-chat-launch-draft-mirrorability.test.ts
  • src/main/opencode/hook-service.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
  • src/main/agent-hooks/managed-hook-local-filesystem.test.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/main/agent-hooks/server.test.ts
  • src/renderer/src/components/terminal-pane/pane-foreground-agent-tracker.test.ts
  • src/relay/agent-exec-handler-test-harness.ts
  • src/renderer/src/components/terminal-pane/agent-completion-coordinator.test.ts
  • src/renderer/src/components/terminal-pane/terminal-renderer-policy.test.ts
  • src/renderer/src/lib/agent-status-count.test.ts
  • src/renderer/src/lib/use-tab-agent.test.ts
  • src/renderer/src/lib/orchestration-skill-coverage.test.ts
  • src/cli/help.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/i18n/locales/es.json
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/persistence.ts
  • src/shared/agent-hook-types.ts
  • src/main/rate-limits/service.ts
  • src/renderer/src/components/native-chat/native-chat-availability.test.ts
  • src/relay/pty-shell-utils.test.ts
  • src/main/runtime/rpc/methods/client-ui-status-bar-items.ts
  • src/main/rate-limits/service.test.ts
  • src/renderer/src/components/native-chat/native-chat-availability.ts
  • src/shared/agent-session-resume.test.ts
  • src/main/providers/agent-foreground-process.test.ts
  • src/renderer/src/components/native-chat/use-native-chat-toggle-shortcut.ts
  • src/renderer/src/i18n/locales/ko.json
  • src/main/agent-hooks/managed-hook-stdin-lifecycle.test.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/shared/rate-limit-types.ts
  • src/renderer/src/i18n/locales/zh.json
  • src/main/runtime/orca-runtime.ts
  • src/main/agent-hooks/remote-hook-service-installers.test.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.test.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.ts
  • src/shared/rate-limit-types.test.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/shared/agent-title-decoration.ts
  • src/renderer/src/lib/agent-status.test.ts
  • src/renderer/src/components/status-bar/tooltip.test.ts
  • src/renderer/src/components/status-bar/UsageRosterPanel.tsx
  • src/renderer/src/components/sidebar/smart-attention.test.ts
  • src/renderer/src/components/status-bar/StatusBarUsageEmptyCta.tsx
  • src/shared/terminal-title-agent-type.test.ts
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts

Comment thread src/main/agent-hooks/retired-gemini-hook-cleanup.test.ts Outdated
Comment thread src/renderer/src/hooks/useAutomationDispatchEvents.ts
@AmethystLiang

Copy link
Copy Markdown
Contributor Author

@coderabbitai Fixing. Will be in the next commit

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@AmethystLiang Acknowledged. I will verify the fix after the next commit.

You are interacting with an AI system.

@AmethystLiang
AmethystLiang force-pushed the refactor-remove-legacy-gemini-cli-current-main branch 6 times, most recently from 7e71335 to 2048398 Compare August 14, 2026 05:10
AmethystLiang and others added 11 commits August 14, 2026 00:49
Gemini CLI is no longer a launchable agent, a usage/rate-limit provider, an
AI-vault session source, or a managed-hook target. This removes that code and
the Antigravity usage surface that only existed on top of the Gemini OAuth
credentials, while keeping Antigravity itself (its sessions, hooks, and skills
live under ~/.gemini/ but are not Gemini CLI).

Existing profiles that reference the retired ids are scrubbed at the
profile-load boundary instead of crashing or preselecting a missing agent:
retired-agent-settings-cleanup.ts clears defaultTuiAgent, disabled/override
maps, Source Control AI + commitMessageAi agent selections (including per-repo
and per-project-host overrides), the geminiCliOAuthEnabled toggle, and retired
status-bar items.

Wire compatibility is preserved in both directions: the ui.set schema still
accepts the retired status-bar ids and _antigravityStatusBarDefaultAdded as
no-ops (unknown keys are a hard rejection there), and the mobile accounts
snapshot still parses retired providers from an older paired host.
Removes Gemini CLI credential extraction, which was an experimental fallback
for Google auth. This eliminates the non-authoritative renderer confidence
path that relied on Gemini title parsing. Updates all i18n strings and test
assertions accordingly.
- Change --provider help example from cursor to opencode
- Move comment explaining why retired providers are kept closer to enum entries
Collapse the settings migration from eleven shape-specific walkers into one
key-matched depth-first pass (219 -> 104 lines), and trim the managed-hook
cleanup to its read/strip/write core (120 -> 87 lines).

Fixes two bugs the rewrite exposed: commitMessageAi kept its `enabled` flag
(only automations disable on a retired agent), and already-disabled automations
no longer re-trigger a save.

Co-authored-by: Orca <help@stably.ai>
- Use `isTuiAgent()` to validate agent IDs instead of just falsy checks, properly rejecting retired/cleared agents persisted by older hosts
- Add abort-first safety for remote Gemini hook cleanup to prevent config mutations after client disconnect
- Add error handling to prevent unhandled rejections from dispatch result persistence
- Fix test mock specifier to match cleanup's `node:os` import
When Orca clients and hosts run different versions, retired agent ids (e.g. gemini) can still be sent. Rather than silently dropping associated data, rehome it: prompts become drafts, hooks are preserved until cleanup confirms no references remain. Add per-mutation dirty tracking to retired-agent cleanup so the settings file isn't rewritten unnecessarily, and only run cleanup once if no supported agents are detected — avoiding duplicate passes over the same config.
Update tests to use Copilot as the example deletable agent instead of Gemini, completing the removal of legacy Gemini CLI support from session deletion workflows.
- Remove Gemini from documented AI_VAULT_AGENTS sources in capability matrix
- Remove Gemini i18n test cases for status bar menu and settings index
- Update agent-send-title-status test to use Codex instead of Gemini example
- Update AI Vault session delete test to use Hermes sample data
Safely retire the Gemini agent throughout the system:
- Strip Gemini managed hooks from homes during installs and empty-allowlist cleanup
- Clean retired agent references from settings with proper scoping to avoid touching unrelated state
- Re-enable automations when user picks a new agent after retirement cleared the previous one
- Handle mixed-version RPC clients that send retired agent IDs without breaking unrelated edits
- Filter unsupported agents from detected allowlists and drop legacy status bar keys for backwards compatibility
- Clear sleeping agent sessions referencing retired agents so they don't wedge recovery
- Clients and hosts update independently, so old clients send retired agent ids that the host no longer ships. Add a compat layer to rehome startup params instead of silently spawning unavailable agents.
- When auditing configs for cleanup, return an explicit 'unverified' outcome if the shape is unexpected (array, scalar, or unreadable values). Skip the script sweep rather than silently reporting clean and unlinking files the config may still reference.
- Transform SettingsUpdate to omit undefined values, preventing rejected/retired keys from clearing valid post-upgrade defaults via spread.
- Expand edge-case tests for corrupt automations collections, unexpected hook shapes, and retired agent launch bundles.
@AmethystLiang
AmethystLiang force-pushed the refactor-remove-legacy-gemini-cli-current-main branch from 2048398 to 1e763e4 Compare August 15, 2026 19:40
@nwparker

Copy link
Copy Markdown
Contributor

Migration review of head 1e763e48fae27dcda7978b62c9baa4b054b36bdc: I am not adopting this removal unchanged, because it removes Antigravity functionality as well as Gemini CLI.

The candidate deletes Antigravity from RateLimitState, ProviderRateLimits, service refresh/state, and the status bar. Its persisted-settings migration also includes antigravity in RETIRED_STATUS_BAR_ITEMS. I compiled the candidate's actual cleanRetiredAgentReferences and ran this isolated fixture:

{"settings":{"defaultTuiAgent":"antigravity"},"ui":{"statusBarItems":["antigravity","codex"]},"automations":[]}

It returns changed: true, leaves Antigravity selected as the default agent, and rewrites the status-bar selection to ["codex"]. That is a concrete removal of the surviving product's saved preference, not just retirement of Gemini.

The stated reason for deleting Antigravity usage—its dependence on Gemini OAuth—has a replacement in #21654, which reads agy's native /usage command independently. I rechecked installed agy 1.2.7: agy --print /usage --output-format json returns the native command.name: "usage" envelope. This API-key-authenticated profile returns zero groups; this does not prove populated paid-account quota. Earlier PR evidence explicitly distinguishes that from fixture quota rendering. Do not run that probe on agy before 1.1.11: those versions can treat /usage as a model prompt.

ELI5: retiring Gemini should not remove Antigravity's usage display or erase the user's choice to show it. Any takeover should retain the native Antigravity provider, named quota buckets, UI entry, and persisted selection, and reconcile the independent-account work before removing old Gemini plumbing.

The migration reproduction uses an in-memory fixture; no real profile was edited. No PR merged or issue closed. Legacy history retention and mixed-version running-session behavior also need a separate review before adopting the broad removal.

@nwparker

Copy link
Copy Markdown
Contributor

Additional compatibility finding at head 1e763e48fae27dcda7978b62c9baa4b054b36bdc, beyond the previously reported Antigravity quota/preference removal:

P2 — existing Gemini sessions lose the resume path. The candidate removes Gemini from RESUMABLE_TUI_AGENTS, deletes its getAgentResumeArgv branch, and removes its AI Vault history source/parser. Deprecating new Gemini setup should not silently make existing saved conversations inaccessible in Orca.

I compiled the exact current and candidate agent-session-resume.ts modules and supplied a synthetic saved {key: 'session_id', id: 'synthetic-saved-session'}:

  • Current code recognizes Gemini and returns gemini --resume synthetic-saved-session.
  • Candidate no longer recognizes Gemini. A direct legacy call produces no resume argv (the removed switch branch falls through to undefined).
  • The Antigravity branch rejects that Gemini session record; its conversation-ID contract is different. Renaming the provider is not a session conversion.

This is an exact-module compatibility check, not a real Gemini or agy session launch. The scanner removal is additionally visible in session-scanner-agent-sources.ts and the deleted Gemini parser; I have not claimed a rendered history reproduction here.

Please separate deprecating new setup from deleting persisted-session readers/resume compatibility. Keep old history readable and either retain a clearly labeled legacy resume route or provide an explicit supported migration before removing it. The same distinction matters when an older execution host still publishes a Gemini identity. Do not relabel those sessions as Antigravity without evidence they can actually resume.

This reinforces why I have not adopted the removal candidate as the completion of #17345. The existing native Antigravity fixes can proceed independently of deleting legacy records/readers.

This branch has not been deployed

No deployments
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.

2 participants