Skip to content

Conversation

@zerob13
Copy link
Collaborator

@zerob13 zerob13 commented Jan 21, 2026

Summary by CodeRabbit

  • Documentation

    • Added specification documentation for provider simplification improvements.
  • Chores

    • Simplified internal provider detection mechanisms by removing legacy classification APIs.
    • Refactored provider architecture to consolidate base abstractions and improve code maintainability.
  • Tests

    • Expanded test coverage for provider model refresh behavior across different provider types.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

This PR simplifies agent provider identification by removing the isAgentProvider classification API from public interfaces, eliminating the BaseAgentProvider abstraction, and replacing runtime checks with a direct local check for ACP via providerId === 'acp'. The AcpProvider now extends BaseLLMProvider directly, and the renderer's model refresh logic has been updated to bypass IPC-based classification.

Changes

Cohort / File(s) Summary
Documentation & Specifications
docs/specs/agent-provider-simplification/plan.md, spec.md, tasks.md
New specification documents outlining the consolidation strategy, removal of isAgentProvider, AcpProvider base class changes, and acceptance criteria for the simplification.
Type Definitions
src/shared/types/presenters/llmprovider.presenter.d.ts, legacy.presenters.d.ts
Removed isAgentProvider(providerId: string): boolean method signatures from ILlmProviderPresenter interface.
Presenter Implementation
src/main/presenter/llmProviderPresenter/index.ts
Removed public isAgentProvider() method delegation from LLMProviderPresenter class.
Base Abstraction Removal
src/main/presenter/llmProviderPresenter/baseAgentProvider.ts
Deleted the abstract BaseAgentProvider class and its session/process lifecycle coordination logic.
Provider Instance Management
src/main/presenter/llmProviderPresenter/managers/providerInstanceManager.ts
Removed private helper methods isAgentConstructor() and isAgentProvider() along with their classification logic.
ACP Provider Refactoring
src/main/presenter/llmProviderPresenter/providers/acpProvider.ts
Changed base class from BaseAgentProvider to BaseLLMProvider; removed getSessionManager(), getProcessManager(), and requestPermission() method overrides.
Renderer Store Logic
src/renderer/src/stores/modelStore.ts
Replaced runtime isAgentProvider() check with direct conditional providerId === 'acp' for agent model refresh routing.
Model Store Tests
test/renderer/stores/modelStore.test.ts
New Vitest suite validating model refresh behavior for ACP vs. non-ACP providers, mocking Pinia store, query cache, and IPC hooks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 No more isAgentProvider to call,
Just check if providerId's 'acp' at all!
BaseAgentProvider has hopped away,
Simpler logic wins the day. ✨
Inheritance streamlined, types made clean,
The cleanest refactor we've ever seen!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: agent provider simplification' directly summarizes the main change: removing the isAgentProvider classification logic and BaseAgentProvider abstraction while consolidating ACP as the sole agent provider.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@zerob13 zerob13 merged commit 63a8f82 into dev Jan 21, 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.

2 participants