Skip to content

feat: remove chat mode#1309

Merged
zerob13 merged 12 commits intodevfrom
feat/remove-chat-mode
Feb 12, 2026
Merged

feat: remove chat mode#1309
zerob13 merged 12 commits intodevfrom
feat/remove-chat-mode

Conversation

@zerob13
Copy link
Collaborator

@zerob13 zerob13 commented Feb 12, 2026

Summary by CodeRabbit

  • Breaking Changes

    • Chat mode removed — existing chat conversations are silently migrated to agent mode.
    • Web-search settings (enableSearch, forcedSearch, searchStrategy) removed; related streaming/search options no longer available.
  • Removed Features

    • Full web search capability removed: search UI, results drawer, search assistant/engine settings, and web content enrichment.
  • Other Changes

    • Agent tools now load consistently across modes; localization cleaned across multiple languages.

- Remove 'chat' mode, keep only 'agent' and 'acp agent' modes
- Migrate legacy 'chat' mode conversations to 'agent' mode silently
- Remove web search feature (searchPresenter, search components, stores)
- Remove search-related config (enableSearch, forcedSearch, searchStrategy)
- Remove ContentEnricher and web content length limit
- Update all ChatMode type definitions
- Clean up i18n files for all 12 languages
- Update toolPresenter to always load agent tools

BREAKING CHANGE: 'chat' mode is no longer available
- Remove 'chat' mode, keep only 'agent' and 'acp agent' modes
- Migrate legacy 'chat' mode conversations to 'agent' mode silently
- Remove web search feature (searchPresenter, search components, stores)
- Remove search-related config (enableSearch, forcedSearch, searchStrategy)
- Remove ContentEnricher and web content length limit
- Update all ChatMode type definitions
- Clean up i18n files for all 12 languages
- Update toolPresenter to always load agent tools

BREAKING CHANGE: 'chat' mode is no longer available
- Remove 'chat' mode, keep only 'agent' and 'acp agent' modes
- Migrate legacy 'chat' mode conversations to 'agent' mode silently
- Remove web search feature (searchPresenter, search components, stores)
- Remove search-related config (enableSearch, forcedSearch, searchStrategy)
- Remove ContentEnricher and web content length limit
- Update all ChatMode type definitions
- Clean up i18n files for all 12 languages
- Update toolPresenter to always load agent tools

BREAKING CHANGE: 'chat' mode is no longer available
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

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

Removes the legacy "chat" mode and all web search functionality; narrows ChatMode to 'agent' | 'acp agent', deletes search presenters/managers/stores/components and ContentEnricher, migrates legacy 'chat' conversation settings to agent, and strips related config/model fields, UI, and i18n entries.

Changes

Cohort / File(s) Summary
Planning & Docs
docs/specs/remove-chat-mode/spec.md, docs/specs/remove-chat-mode/plan.md, .git-commit-msg.txt
Adds spec and multi-phase rollout plan documenting removal, silent migration of legacy chat conversations, acceptance checklist, and risk mitigation.
Core types & session
src/main/presenter/agentPresenter/session/sessionResolver.ts, src/main/presenter/agentPresenter/session/sessionManager.ts, src/main/presenter/agentPresenter/session/sessionContext.ts, src/shared/types/presenters/*.d.ts, src/main/presenter/sessionPresenter/types.ts
Centralizes `ChatMode = 'agent'
Search subsystem removal
src/main/presenter/searchPresenter/*, src/main/presenter/searchPresenter/managers/*, src/main/presenter/searchPresenter/handlers/*, src/main/presenter/searchPresenter/index.ts, src/main/presenter/searchPresenter/interface.ts
Deletes SearchPresenter, SearchManager, SearchHandler and all search public types/APIs.
Content enrichment removal
src/main/presenter/content/contentEnricher.ts, src/main/presenter/content/index.ts, src/main/presenter/mcpPresenter/inMemoryServers/powerpackServer.ts
Removes ContentEnricher implementation, its re-export, get_web_info tool, and related enrichment handling.
Agent presenter & handlers
src/main/presenter/agentPresenter/index.ts, src/main/presenter/agentPresenter/loop/*, src/main/presenter/agentPresenter/streaming/*, src/main/presenter/agentPresenter/loop/toolCallHandler.ts, src/main/presenter/agentPresenter/streaming/llmEventHandler.ts, src/main/presenter/agentPresenter/message/messageBuilder.ts, src/main/presenter/agentPresenter/permission/*, src/main/presenter/agentPresenter/utility/utilityHandler.ts, src/main/presenter/agentPresenter/types/handlerContext.ts
Removes search wiring and in-flight search tracking across handlers; stream generation no longer invokes search; adds BaseHandler/ThreadHandlerContext helpers; messageBuilder normalizes chatMode and gates agent prompts by new ChatMode. Adds AgentPresenter.cleanupConversation API.
Tool & MCP wiring
src/main/presenter/toolPresenter/index.ts, src/main/presenter/mcpPresenter/toolManager.ts, src/main/presenter/agentPresenter/acp/agentToolManager.ts
Narrows tool presenter chatMode types and now always initializes/loads agent tools (removes conditional chat path); method signature adjustments.
LLM providers & ACP
src/main/presenter/llmProviderPresenter/index.ts, src/main/presenter/llmProviderPresenter/providers/*, src/main/presenter/llmProviderPresenter/providers/acpProvider.ts
Removes enableSearch/forcedSearch/searchStrategy from startStreamCompletion signature and provider injection; provider-specific search injection removed (e.g., GoogleSearch removed), and added clearAcpSession/clearSession hooks for ACP session cleanup.
Config & model shapes
src/main/presenter/configPresenter/*, src/main/presenter/configPresenter/modelConfig.ts, src/main/presenter/configPresenter/providerModelHelper.ts
Removes webContentLengthLimit and per-model fields enableSearch, forcedSearch, searchStrategy from model/config flows and metadata surfaces.
Renderer UI removal
src/renderer/settings/*, src/renderer/src/components/*, src/renderer/src/components/chat-input/*, src/renderer/src/components/message/*, src/renderer/src/components/settings/ModelConfigDialog.vue
Deletes search-related settings UI and components (SearchEngineSettings, SearchAssistantModelSection, WebContentLimitSetting, SearchResultsDrawer, SearchStatusIndicator, MessageBlockSearch); removes webSearch UI, props/emits, and related composable usage.
Renderer stores & composables
src/renderer/src/stores/*, src/renderer/src/composables/*, src/renderer/src/lib/storeInitializer.ts, src/renderer/src/components/chat-input/composables/*
Removes useSearchEngineStore, useSearchAssistantStore, useSearchConfig, search-related composables and searchPreview flag; narrows ChatMode types and removes webSearch state/APIs (setWebSearch/toggleWebSearch).
I18n cleanup
src/renderer/src/i18n/{da-DK,en-US,fa-IR,fr-FR,he-IL,ja-JP,ko-KR,pt-BR,ru-RU,zh-CN,zh-HK,zh-TW}/chat.json, .../settings.json
Removes mode.chat translations and search/web-content related keys across ~12 locales.
Shared presenter surface
src/shared/types/presenters/*.d.ts, src/shared/types/presenters/search.presenter.d.ts, src/shared/types/presenters/llmprovider.presenter.d.ts
Removes ISearchPresenter, SearchResult, and search APIs/types; strips search fields from public ModelConfig/CONVERSATION_SETTINGS and removes search params from LLM presenter signatures; adds AgentPresenter.cleanupConversation and LLMProviderPresenter.clearAcpSession.
Session & lifecycle changes
src/main/presenter/sessionPresenter/index.ts, src/main/presenter/tabPresenter.ts, src/main/presenter/agentPresenter/index.ts
On tab/window close and conversation deletion, invokes conversation cleanup (AgentPresenter.cleanupConversation) and attempts ACP session clear; stopMessageGeneration adjusted to drop search stop logic.
Tests
test/main/presenter/agentPresenter/sessionManager.test.ts
Updates tests to expect migration of legacy 'chat' mode to 'agent' and adjusts mocks accordingly.

Sequence Diagram(s)

sequenceDiagram
  participant Tab as "Window/Tab"
  participant TabPresenter as "tabPresenter"
  participant SessionPresenter as "sessionPresenter"
  participant AgentPresenter as "agentPresenter"
  participant LLMProvider as "llmProviderPresenter"
  participant AcpProv as "AcpProvider"

  rect rgba(52,152,219,0.5)
  Tab->>TabPresenter: WINDOW_CLOSED(viewId)
  TabPresenter->>SessionPresenter: getActiveConversationIdSync(viewId)
  alt conversationId found
    TabPresenter->>AgentPresenter: cleanupConversation(conversationId)
    AgentPresenter->>LLMProvider: clearAcpSession(conversationId)
    LLMProvider->>AcpProv: clearSession(conversationId) (if ACP provider present)
    AcpProv-->>LLMProvider: ack
    LLMProvider-->>AgentPresenter: done
    AgentPresenter-->>TabPresenter: cleanup complete
  end
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • deepinfect

"I’m a rabbit who hopped through code at night,
I nudged 'chat' away and set the agents right.
No web-search traces left upon the loam,
Old chats now wander to their agent home.
Hooray for tidy branches — hop! 🌿🐇"

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: remove chat mode' is concise, clear, and directly describes the primary change in the PR - removing the chat mode functionality from the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/remove-chat-mode

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (7)
src/main/presenter/llmProviderPresenter/providers/dashscopeProvider.ts (1)

23-25: ⚠️ Potential issue | 🟡 Minor

Stale JSDoc: still references enable_search.

The comment mentions enable_search which was removed in this PR.

Proposed fix
-  /** Override coreStream method to support DashScope's enable_thinking and enable_search parameters */
+  /** Override coreStream method to support DashScope's enable_thinking parameter */
src/renderer/src/i18n/fa-IR/settings.json (1)

1-62: ⚠️ Potential issue | 🔴 Critical

Pipeline failure: missing i18n key common.charactersUnit.

The CI check reports that common.charactersUnit is missing from this file. It was likely removed along with the other web-content-length keys, but something in the codebase still references it. Either restore the key here (and in all other locale files) or remove the reference in the consuming code.

#!/bin/bash
# Find where common.charactersUnit is still referenced in the codebase
rg -rn "charactersUnit" --type-add 'src:include:*.ts,*.tsx,*.vue,*.js,*.jsx' --type src
src/renderer/src/i18n/fr-FR/chat.json (1)

37-45: ⚠️ Potential issue | 🟠 Major

Remove orphaned search translation keys from all 12 language files.

The PR removes web search functionality, leaving the search section in chat.json orphaned. This section is not referenced anywhere in the codebase and appears identically in all 12 language files (da-DK, en-US, fa-IR, fr-FR, he-IL, ja-JP, ko-KR, pt-BR, ru-RU, zh-CN, zh-HK, zh-TW). Delete these keys from all locales to keep translations synchronized and free of dead code.

src/renderer/src/composables/useModelCapabilities.ts (1)

25-29: ⚠️ Potential issue | 🟡 Minor

Stale JSDoc — still mentions "search capabilities".

The comment on line 28 reads "Handles reasoning support, thinking budget ranges, and search capabilities", but search capabilities have been removed from this composable.

Proposed fix
 /**
  * Composable for fetching and managing model capabilities
- * Handles reasoning support, thinking budget ranges, and search capabilities
+ * Handles reasoning support and thinking budget ranges
  */
src/main/presenter/agentPresenter/permission/permissionHandler.ts (1)

80-99: ⚠️ Potential issue | 🟡 Minor

Remove unused llmProviderPresenter from constructor options.

The llmProviderPresenter parameter accepted at line 84 is never assigned to a field—the class already accesses it through BaseHandler's protected getter (this.llmProviderPresenter retrieves it from this.ctx.llmProviderPresenter). Remove this parameter and update all instantiation sites accordingly.

Proposed fix
   constructor(
     context: ThreadHandlerContext,
     options: {
       generatingMessages: Map<string, GeneratingMessageState>
-      llmProviderPresenter: ILlmProviderPresenter
       getMcpPresenter: () => IMCPPresenter
       getToolPresenter: () => IToolPresenter
       streamGenerationHandler: StreamGenerationHandler
       llmEventHandler: LLMEventHandler
       commandPermissionHandler: CommandPermissionService
     }
   ) {

Also remove the unused ILlmProviderPresenter import on line 4.

Update instantiation at src/main/presenter/agentPresenter/index.ts:102 to remove the llmProviderPresenter property.

src/renderer/src/components/chat-input/ChatInput.vue (1)

335-353: 🛠️ Refactor suggestion | 🟠 Major

Remove stale search config bindings from <ChatConfig> that are no longer supported.

Lines 342–344 pass v-model:enable-search, v-model:forced-search, and v-model:search-strategy to <ChatConfig>, but this component no longer accepts these props in its defineProps or defineEmits. Additionally, the fallback config object (lines 671–673) still defines configEnableSearch, configForcedSearch, and configSearchStrategy, which are never returned from usePromptInputConfig() and unused when variant === 'chat' (the only time ChatConfig renders).

Vue silently ignores unrecognized v-model props, so this won't cause a runtime crash, but these are dead bindings representing incomplete refactoring. Remove all three search-related v-model bindings from the <ChatConfig> component and the corresponding properties from the fallback config object.

Proposed changes
              <ChatConfig
                v-model:system-prompt="config.configSystemPrompt.value"
                v-model:temperature="config.configTemperature.value"
                v-model:context-length="config.configContextLength.value"
                v-model:max-tokens="config.configMaxTokens.value"
                v-model:artifacts="config.configArtifacts.value"
                v-model:thinking-budget="config.configThinkingBudget.value"
-                v-model:enable-search="config.configEnableSearch.value"
-                v-model:forced-search="config.configForcedSearch.value"
-                v-model:search-strategy="config.configSearchStrategy.value"
                v-model:reasoning-effort="config.configReasoningEffort.value"
                v-model:verbosity="config.configVerbosity.value"
-        configEnableSearch: ref(false),
-        configForcedSearch: ref(false),
-        configSearchStrategy: ref(''),
src/shared/types/presenters/session.presenter.d.ts (1)

34-36: ⚠️ Potential issue | 🟠 Major

Incomplete cleanup: Removing search fields from SessionConfig requires updating all usages across the codebase.

Lines 34–36 in session.presenter.d.ts contain search-related fields that are actively referenced in 30+ locations: renderer stores (agentModelStore.ts, modelStore.ts), Vue components (ModelConfigItem.vue, OllamaProviderSettingsDetail.vue, ProviderModelList.vue), provider implementations in llmProviderPresenter, the knowledge memory exporter, and multiple tests. Removing these fields from the type definition alone will break these references.

The commit "feat(core): remove chat mode and web search" (363c941) explicitly aims to remove web search, and the local SessionConfig in src/main/presenter/sessionPresenter/types.ts has already been cleaned. However, the removal is incomplete: search fields remain in multiple shared type definitions (llmprovider.presenter.d.ts, thread.presenter.d.ts, legacy.presenters.d.ts) and are still actively used throughout the renderer and main process code.

Complete the removal by:

  1. Remove enableSearch, forcedSearch, searchStrategy from session.presenter.d.ts lines 34–36
  2. Update all usages in renderer stores and components
  3. Clean up provider implementations that set these fields
  4. Remove search-related assertions from tests
  5. Update the specification checklist in docs/specs/remove-chat-mode/spec.md
🤖 Fix all issues with AI agents
In `@docs/specs/remove-chat-mode/plan.md`:
- Around line 82-88: The plan and implementation disagree on handling legacy
settings.chatMode === 'chat'; update the runtime logic in sessionResolver.ts to
match the plan by explicitly treating 'chat' as legacy: replace the current
expression settings.chatMode || input.fallbackChatMode || 'agent' with logic
that checks if settings.chatMode exists and is not 'chat' (e.g. if
(settings.chatMode && settings.chatMode !== 'chat') use it; else use
input.fallbackChatMode || 'agent'), and keep the comment behavior that migrating
settings.chatMode === 'chat' to 'agent' is runtime-only (persist only via
updateConversationSettings).

In `@src/main/presenter/agentPresenter/message/messageBuilder.ts`:
- Around line 120-126: conversation.settings.chatMode may contain the legacy
string 'chat' at runtime which bypasses the nullish fallback; update the
initialization in messageBuilder.ts so you validate and normalize the runtime
value first (e.g., read rawChatMode = conversation.settings.chatMode, if
rawChatMode === 'chat' set normalized = 'agent', else if rawChatMode is 'agent'
or 'acp agent' use it, otherwise fall back to await
presenter.configPresenter.getSetting('input_chatMode') and then to 'agent');
then compute isAgentMode from the normalized value and leave isToolPromptMode =
true. Ensure you reference conversation.settings.chatMode,
presenter.configPresenter.getSetting, isAgentMode, and isToolPromptMode when
making the change.

In `@src/main/presenter/agentPresenter/session/sessionManager.ts`:
- Around line 112-117: The fallbackChatMode assignment in sessionManager
currently casts getSetting('input_chatMode') to only 'agent' | 'acp agent' |
undefined which hides legacy values like 'chat' that may be persisted; update
the logic around getSetting('input_chatMode') in sessionManager (the
fallbackChatMode computation) to read the raw value, explicitly sanitize/mapping
legacy 'chat' to 'agent' (or map any unknown value to the default 'agent'), and
then return the sanitized chatMode (instead of relying on the type cast and ??
only handling undefined).

In `@src/main/presenter/agentPresenter/session/sessionResolver.ts`:
- Around line 12-13: The current assignment to chatMode (settings.chatMode ||
input.fallbackChatMode || 'agent') does not remap the legacy string 'chat' to
'agent'; update the logic where chatMode is computed (the chatMode variable in
sessionResolver.ts) to explicitly normalize legacy values: read
settings.chatMode and input.fallbackChatMode, then if either equals the string
'chat' set chatMode to 'agent', otherwise use the existing value or default to
'agent'; ensure the final chatMode value conforms to the expected union ('agent'
| 'acp agent') so downstream code will not receive the legacy 'chat' value.
- Around line 15-16: SessionContextResolved.chatMode may receive legacy values
from persisted CONVERSATION_SETTINGS.chatMode (e.g., 'chat'); validate
settings.chatMode against the allowed set before assigning to the returned
chatMode: if settings.chatMode is one of 'agent' or 'acp agent' use it,
otherwise fall back to input.fallbackChatMode and then to 'agent'; update the
assignment in sessionResolver.ts (the variable currently using settings.chatMode
|| input.fallbackChatMode || 'agent') to perform this whitelist check (mirror
the approach used in messageBuilder.ts where a cast/validation is applied).

In `@src/renderer/src/components/chat-input/composables/useChatMode.ts`:
- Around line 104-112: The migration bug: legacy saved value 'chat' is accepted
as a ChatMode and ends up assigned to currentMode; update the logic in the
useChatMode composable around savedMode/currentMode to treat 'chat' as an
invalid legacy value and map it to 'agent' (same behavior as the existing 'acp
agent' fallback). Concretely, when savedMode === 'chat' (or when savedMode ===
'acp agent' && !hasAcpAgents.value) set currentMode.value = 'agent' and call
configPresenter.setSetting('input_chatMode','agent') to persist the corrected
value; otherwise assign currentMode.value = savedMode. Ensure you reference
savedMode, currentMode, hasAcpAgents, and configPresenter.setSetting in the
change.

In `@src/renderer/src/i18n/fa-IR/settings.json`:
- Line 51: The value for the JSON key "loggingRestartNotice" uses a Latin
question mark; replace the trailing "?" with the Persian question mark "؟" so it
matches the same phrase pattern used elsewhere (e.g., "آیا می‌خواهید ادامه
دهید؟") and keep the rest of the string unchanged.
🧹 Nitpick comments (10)
src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts (1)

819-821: LGTM — clean simplification of tool loading.

The removal of GoogleSearch gating and unconditional MCP tool loading aligns with the PR objective. The logic is correct.

Nit: consider adding braces for the multi-line if body for consistency with the rest of the file (e.g., the if (geminiTools.length > 0) block at line 840).

🔧 Optional: add braces
     // Load MCP tools if available
-    if (mcpTools.length > 0)
-      geminiTools = await presenter.mcpPresenter.mcpToolsToGeminiTools(mcpTools, this.provider.id)
+    if (mcpTools.length > 0) {
+      geminiTools = await presenter.mcpPresenter.mcpToolsToGeminiTools(mcpTools, this.provider.id)
+    }
src/main/presenter/llmProviderPresenter/providers/githubCopilotProvider.ts (1)

18-18: Pre-existing: Comments and error messages are in Chinese throughout this file.

The coding guidelines require all logs and comments to be in English (All logs and comments must be in English), but this file has extensive Chinese text in comments (e.g., line 18, 48, 75, 87) and user-facing error messages (e.g., lines 121–136, 438–451, 694–713). This is pre-existing and not introduced by this PR, but worth addressing in a follow-up. As per coding guidelines, "All logs and comments must be in English".

Also applies to: 48-48, 75-75, 87-87, 96-96, 108-108, 121-136

src/main/presenter/llmProviderPresenter/providers/dashscopeProvider.ts (1)

39-62: Consider restoring the original create method after the generator completes.

The monkey-patch on this.openai.chat.completions.create (line 43) is never reverted. If coreStream is called when thinking is enabled and then later when it isn't, the patched create from the first call persists on the instance. This is a pre-existing concern, but the simplified flow makes it a good time to address it — e.g., wrap the yield* in a try/finally that restores originalCreate.

Suggested approach
     if (shouldAddEnableThinking) {
       const originalCreate = this.openai.chat.completions.create.bind(this.openai.chat.completions)
       // Replace create method to add enable_thinking parameter
       this.openai.chat.completions.create = ((params: any, options?: any) => {
         const modifiedParams = { ...params }

         if (shouldAddEnableThinking) {
           modifiedParams.enable_thinking = true
           const dbBudget = modelCapabilities.getThinkingBudgetRange(
             this.provider.id,
             modelId
           ).default
           const budget = modelConfig?.thinkingBudget ?? dbBudget
           if (typeof budget === 'number') {
             modifiedParams.thinking_budget = budget
           }
         }

         return originalCreate(modifiedParams, options)
       }) as typeof this.openai.chat.completions.create
-    }
 
-    yield* super.coreStream(messages, modelId, modelConfig, temperature, maxTokens, mcpTools)
+      try {
+        yield* super.coreStream(messages, modelId, modelConfig, temperature, maxTokens, mcpTools)
+      } finally {
+        this.openai.chat.completions.create = originalCreate
+      }
+      return
+    }
+
+    yield* super.coreStream(messages, modelId, modelConfig, temperature, maxTokens, mcpTools)
src/renderer/src/components/settings/ModelConfigDialog.vue (1)

809-822: Consider using descriptive names for the destructured capability results.

The search-related capability fetches were correctly removed, and the remaining destructured values line up with the Promise.all calls. However, since this line was touched, the single/two-letter names (sr, br, se, ed, sv, vd) hurt readability—especially for newcomers to the file.

♻️ Suggested rename for clarity
-    const [sr, br, se, ed, sv, vd] = await Promise.all([
+    const [
+      supportsReasoning,
+      budgetRange,
+      supportsEffort,
+      effortDefault,
+      supportsVerbosity,
+      verbosityDefault
+    ] = await Promise.all([
       configPresenter.supportsReasoningCapability?.(props.providerId, props.modelId),
       configPresenter.getThinkingBudgetRange?.(props.providerId, props.modelId),
       configPresenter.supportsReasoningEffortCapability?.(props.providerId, props.modelId),
       configPresenter.getReasoningEffortDefault?.(props.providerId, props.modelId),
       configPresenter.supportsVerbosityCapability?.(props.providerId, props.modelId),
       configPresenter.getVerbosityDefault?.(props.providerId, props.modelId)
     ])
-    capabilitySupportsReasoning.value = typeof sr === 'boolean' ? sr : null
-    capabilityBudgetRange.value = br || {}
-    capabilitySupportsEffort.value = typeof se === 'boolean' ? se : null
-    capabilityEffortDefault.value = ed
-    capabilitySupportsVerbosity.value = typeof sv === 'boolean' ? sv : null
-    capabilityVerbosityDefault.value = vd
+    capabilitySupportsReasoning.value = typeof supportsReasoning === 'boolean' ? supportsReasoning : null
+    capabilityBudgetRange.value = budgetRange || {}
+    capabilitySupportsEffort.value = typeof supportsEffort === 'boolean' ? supportsEffort : null
+    capabilityEffortDefault.value = effortDefault
+    capabilitySupportsVerbosity.value = typeof supportsVerbosity === 'boolean' ? supportsVerbosity : null
+    capabilityVerbosityDefault.value = verbosityDefault
src/renderer/src/components/chat-input/composables/useChatMode.ts (1)

39-39: isAgentMode is now always true — consider removing or simplifying.

Since 'chat' mode no longer exists, isAgentMode is trivially true for both remaining modes. If any consumer relies on this to distinguish 'agent' from 'acp agent', the name is misleading. Consider removing it from the public API or at minimum adding a comment explaining it's kept for backward compatibility.

src/renderer/src/components/chat-input/composables/useWorkspaceMention.ts (1)

15-20: isEnabled check for isAgentMode is now always true.

Since chatMode can only be 'agent' or 'acp agent', the isAgentMode check on Line 17 is always true, making isEnabled effectively just !!options.workspacePath.value. This is a minor simplification opportunity.

src/shared/types/presenters/legacy.presenters.d.ts (1)

483-487: Stale optional methods on IConfigPresenter: supportsSearchCapability and getSearchDefaults.

These optional methods are still defined but should be removed alongside the broader search feature removal for consistency. They won't cause runtime issues (optional with ?), but they add dead surface area to the interface.

src/main/presenter/agentPresenter/session/sessionManager.ts (1)

88-102: else branch on line 100 is now dead code.

Since resolved.chatMode is typed as 'agent' | 'acp agent', the else branch after the if ('agent') / else if ('acp agent') checks can never execute. Consider removing it for clarity, or keep it as a defensive fallback with a comment.

test/main/presenter/agentPresenter/sessionManager.test.ts (1)

53-64: Migration test doesn't verify that the upgraded mode is persisted.

The test asserts that context.chatMode becomes 'agent', but it doesn't check that sessionPresenter.updateConversationSettings was called with the migrated chatMode. Without this assertion, you could have a bug where each load re-migrates without persisting, causing unnecessary writes on every resolveWorkspaceContext call. Consider adding:

expect(sessionPresenter.updateConversationSettings).toHaveBeenCalledWith(
  conversation.id,
  expect.objectContaining({ chatMode: 'agent' })
)
src/main/presenter/agentPresenter/index.ts (1)

491-498: Leftover search: false field in continue payload.

The search field in the continue payload is a remnant of the removed web search feature. While it's harmless (set to false), it's dead data that could be confusing post-removal.

Suggested cleanup
 const continuePayload = JSON.stringify({
   text: 'continue',
   files: [],
   links: [],
-  search: false,
   think: false,
   continue: true
 })

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/src/i18n/ko-KR/settings.json (1)

8-33: ⚠️ Potential issue | 🟡 Minor

Remove orphaned search-engine i18n keys from all 12 language files.

The keys searchEngine, searchEngineSelect, searchPreview, searchAssistantModel, selectModel, and the custom-search-engine block (lines 22–33) are not referenced anywhere in the codebase. With the removal of SearchEngineStore, SearchAssistantStore, and SearchPresenter, these translations are now dead code and should be cleaned up.

Remove these keys from all language files: da-DK, en-US, fa-IR, fr-FR, he-IL, ja-JP, ko-KR, pt-BR, ru-RU, zh-CN, zh-HK, zh-TW.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/main/presenter/agentPresenter/session/sessionResolver.ts`:
- Line 34: The current expression assigns chatMode using
normalizeChatMode(rawChatMode) ?? normalizeChatMode(rawFallback) ?? 'agent', but
normalizeChatMode never returns undefined so the fallback rawFallback is never
used; update the logic by introducing or using a validating normalizer that
returns undefined for invalid/absent values (e.g., validateChatMode) and replace
the calls to normalizeChatMode with that validator (apply to rawChatMode and
rawFallback) so the nullish coalescing works as intended and the user's settings
fallback is honored; ensure references to normalizeChatMode, rawChatMode,
rawFallback, and the chatMode assignment are updated accordingly.
🧹 Nitpick comments (8)
src/renderer/src/components/chat-input/composables/useChatMode.ts (2)

39-39: isAgentMode is now a constant true — consider removing or deprecating.

With 'chat' gone, isAgentMode is unconditionally true. If no consumers branch on it, it's dead code. If consumers still reference it, keeping it avoids churn now — but consider removing it in a follow-up to avoid misleading future readers.

#!/bin/bash
# Check how isAgentMode is consumed across the codebase
rg -n --type=ts --type=vue 'isAgentMode' -C2

9-9: ChatMode type is duplicated across renderer and main process.

This same type is defined in sessionResolver.ts (line 4) and here (line 9). Consider sharing it from a single source in src/shared/ to avoid drift.

src/main/presenter/agentPresenter/session/sessionResolver.ts (1)

16-24: normalizeChatMode and isLegacyChatMode are duplicated across files.

The same normalizeChatMode pattern appears in messageBuilder.ts (lines 121–124). Consider extracting both helpers into a shared utility alongside the ChatMode type to keep them in sync.

src/main/presenter/agentPresenter/session/sessionManager.ts (2)

117-119: Unreachable else branch — chatMode can only be 'agent' or 'acp agent'.

Since resolveSessionContext guarantees the result is one of those two values, this branch is dead code. It's harmless as defensive coding, but could be removed for clarity.


73-75: Repeated rawFallback reading pattern — consider extracting a private helper.

The same getSetting('input_chatMode') as string | undefined → normalize-to-ChatMode logic appears three times (resolveSession, resolveWorkspaceContext, and its error path). A small private method like getPreferredChatMode(): ChatMode would reduce duplication and ensure consistent normalization.

♻️ Proposed helper
+  private getPreferredChatMode(): ChatMode {
+    const raw = this.options.configPresenter.getSetting('input_chatMode') as string | undefined
+    return raw === 'acp agent' ? 'acp agent' : 'agent'
+  }

Then replace each occurrence with this.getPreferredChatMode().

Also applies to: 129-131, 152-154

src/main/presenter/agentPresenter/message/messageBuilder.ts (3)

132-132: isToolPromptMode is always true — dead variable.

Similar to isAgentMode in the renderer, this constant can be inlined. Line 194's condition isToolPromptMode && toolDefinitions.length > 0 would simplify to toolDefinitions.length > 0.


387-392: Non-English prompt string in main process code.

Line 388 contains a Chinese-language prompt: '以上是你刚执行的工具调用及其响应信息…'. While this is a model prompt (not a UI string or log), the coding guidelines require English for all text. This appears to be pre-existing, but worth flagging since the surrounding code was modified.

As per coding guidelines: **/*.{ts,tsx,js,jsx,vue}: "Use English for all logs and comments" and src/renderer/**/*.{ts,tsx,js,jsx,vue}: "All user-facing strings must use i18n keys (supports 12 languages)".


36-46: searchResults parameter is now dead — consider removing from the interface and all call sites.

searchResults is renamed to _searchResults (unused) on line 109, but still declared in the PreparePromptContentParams interface on line 40. Multiple call sites pass searchResults: null (e.g., utilityHandler.ts:355, streamGenerationHandler.ts:95, streamGenerationHandler.ts:251), so removing this requires updating those locations.

Note: The SearchResult import on line 5 is used elsewhere in the codebase (e.g., sessionPresenter), so it cannot be removed.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/renderer/src/components/chat-input/ChatInput.vue (1)

342-344: ⚠️ Potential issue | 🟠 Major

Remove stale search-related props passed to ChatConfig.

The v-model bindings for enable-search, forced-search, and search-strategy are passed to ChatConfig (lines 342–344), but ChatConfig.vue no longer declares these props, causing Vue warnings. Remove these three v-model bindings and delete the corresponding config refs (configEnableSearch, configForcedSearch, configSearchStrategy at lines 671–673 in ChatInput.vue).

src/main/presenter/sessionPresenter/index.ts (1)

933-934: ⚠️ Potential issue | 🟠 Major

Stale 'chat' fallback in toSession — should be 'agent' after this PR.

Line 933 uses conversation.settings.chatMode ?? 'chat' as the default resolvedChatMode. Since this PR removes 'chat' as a valid mode, this fallback should be updated to 'agent' to stay consistent with the migration.

Proposed fix
       context: {
-        resolvedChatMode: (conversation.settings.chatMode ??
-          'chat') as Session['context']['resolvedChatMode'],
+        resolvedChatMode: (conversation.settings.chatMode ??
+          'agent') as Session['context']['resolvedChatMode'],

- Add tools and prompts watchers back to useMentionData
- Improve workspace search with registration state tracking
- Add fallback handling when ripgrep is unavailable
@zerob13 zerob13 merged commit 976e5fb into dev Feb 12, 2026
2 checks passed
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.

1 participant