feat: add option for hiding inactive provider#207
Conversation
📝 WalkthroughWalkthroughAdds a new Sequence Diagram(s)sequenceDiagram
participant User
participant SessionRegistry
participant Config
participant ProviderStore
participant UI as vim.ui.select
User->>SessionRegistry: trigger provider switch
SessionRegistry->>ProviderStore: fetch available providers
ProviderStore-->>SessionRegistry: list (installed + not_installed)
SessionRegistry->>Config: read provider_switcher.hide_unhealthy_providers
alt hide_unhealthy_providers == true
SessionRegistry->>SessionRegistry: filter out not_installed providers
alt filtered list empty
SessionRegistry->>User: notify "No healthy providers found. Showing unavailable providers."
SessionRegistry->>SessionRegistry: include not_installed providers
end
else hide_unhealthy_providers == false
SessionRegistry->>SessionRegistry: include not_installed providers
end
SessionRegistry->>UI: present provider list
UI-->>User: show selection prompt
User-->>UI: choose provider
UI-->>SessionRegistry: return selected provider
SessionRegistry->>ProviderStore: activate chosen provider
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lua/agentic/session_registry.lua`:
- Around line 109-111: When Config.provider_switcher.hide_unhealthy_providers is
true the code may call vim.ui.select with an empty sorted_providers (variable
sorted_providers) when none of the provider commands are installed
(not_installed list), leaving users with no items; change the logic before
calling vim.ui.select in the function that builds sorted_providers so that if
sorted_providers is empty you fall back to using not_installed (so users see
providers tagged "✗ not installed") and/or call Logger.notify with a short
message explaining no healthy providers were found; update references to
Config.provider_switcher.hide_unhealthy_providers, sorted_providers,
not_installed, vim.ui.select and Logger.notify accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2513ca62-d998-48e1-a4f0-684c362a9eae
📒 Files selected for processing (4)
doc/agentic.txtlua/agentic/config_default.lualua/agentic/session_registry.lualua/agentic/session_registry.test.lua
carlos-algms
left a comment
There was a problem hiding this comment.
Looks clean. Nice quality of life 👍🏻
Could you also please run timeout 5 nvim --headless -c "helptags doc/" -c "quit" to check if the new option gets its own tag?
Thanks.
## Summary - Adds `actions/cache@v4` for `.local/bin/rg` and `.local/bin/fd` with weekly-rotating keys (matches the nightly Neovim cache pattern at lines 161 of `pr-check.yml`) - Authenticates the `api.github.com/.../releases/latest` calls with `GITHUB_TOKEN` so we get the per-repo 1000/hr rate limit instead of the shared 60/hr per-IP unauthenticated limit (this was causing the v0.11.5 `tar: gzip: stdin: not in gzip format` failure on PR #207 when the unauth IP limit was hit and the API returned a JSON error in place of the asset URL) - Replaces `grep | cut | head` URL extraction with `jq` for cleaner JSON parsing and proper failure modes (`curl -sfL` now exits non-zero on HTTP errors instead of piping garbage into `tar`) - Adds `permissions: contents: read` at the workflow level for defense-in-depth
|
Could you please have a look at the failing tests? Are they passing locally on your machine? |
Update the provider selector, so the inactive providers can be filtered out based on configuration.