Repository navigation
feat: label ACP providers in provider switch - #3266
Conversation
|
Tested and it worked fine. Any comment on the formatting @cybaol ? |
|
@teto: The current |
|
@Tiancheng-Xu you can run |
|
Thanks — I installed the repo-pinned |
|
Since this change only affects UI presentation, it does not need to introduce a new public API in Could we keep the change local to format_item = function(provider_name)
if Config.acp_providers[provider_name] then
return provider_name .. " (ACP)"
end
return provider_name
end, |
|
Thanks for pointing this out — agreed, this is UI-only, so a provider-level API is unnecessary. I moved the suffix formatting into the picker’s I also updated the verification notes. The focused Neovim check, Lua syntax check, Stylua check, and |
good idea
If you are on linux, you can install nix https://nixos.org/ and dependencies are cached so even if primary source doesn't work, there it might. Any reason it is still a draft ? I would like to merge it (though I am still unsure about merging AI-generated tests for non-crucial behaviors). |
|
Moved this out of draft. Linux/macOS unit tests, the Linux/macOS/Windows library builds, and pre-commit all passed on |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The change is a small, display-only picker label that preserves selection behavior, backed by a focused test, with no correctness or nil-safety concerns.
Review effort: Balanced
Findings: None
What changed in this PR
This PR improves provider discoverability in :AvanteSwitchProvider by appending (ACP) to ACP provider entries in the selection picker, addressing issue #3257. The labeling is kept local to the picker via vim.ui.select's format_item, so the underlying provider names passed to switch_provider remain unchanged and no new provider API is exposed.
Changes:
- Add a
format_itemcallback in theAvanteSwitchProviderpicker to suffix ACP providers with(ACP)while leaving regular providers unchanged. - Add a new
tests/plugin_spec.luaverifying the picker label formatting and that selection still switches to the correct (unformatted) provider name. - Extend
tests/providers/init_spec.luasetup with anacp_providersentry.
| File | Description |
|---|---|
| plugin/avante.lua | Adds display-only format_item to label ACP providers (ACP) in the switch-provider picker. |
| tests/plugin_spec.lua | New test covering picker label formatting and correct provider selection via mocked modules. |
| tests/providers/init_spec.lua | Adds an acp_providers entry to the provider test config. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Remove AI generated tests would be |
|
Removed the added picker spec and reverted the ACP test fixture in I retained a local-only picker check: ACP and regular labels, plus passing the original provider name on selection, all pass. The same check fails on the unmodified base. Formatting and Lua syntax checks pass. The updated verification notes keep full-suite/typecheck limitations explicit; the new head still needs its upstream checks. |
|
thanks for the follow up and thanks for the review @cybaol ;) |
Summary
(ACP)in:AvanteSwitchProviderso their type is clear in mixed provider lists.format_itemcallback; no new provider API or committed test changes.Verification
stylua --check --config-path stylua.toml plugin/avante.lua tests/providers/init_spec.luapassed.luac -ppassed for the picker and restored provider test fixture.make luatestcould not run locally:scripts/run-luatest.shstops becausenluais unavailable.make lua-typecheckwas not run becauselua-language-serveris unavailable locally.Closes #3257