Replies: 2 comments
-
@acoliver Nice! Would you mind moving this to https://github.com/zed/agent-client-protocol? We'd love to be able to support multiple models. The way I was imagining that it works is that the agent replies to init with Then on each prompt call we add One open question is whether this should be per-prompt or per-session. I kind of like the idea of per-prompt (because you can do stuff and then when the model bails out, switch model and try again), but we should only do that if the agents support it. |
Beta Was this translation helpful? Give feedback.
-
Moved here: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I work on LLxprt Code a multi-provider fork of Gemini CLI. https://github.com/acoliver/llxprt-code/
Presently to use more than one model in zed you have to do this:
This creates two new options for conversations in Zed. One for using Qwen/Cerebras and the other for Sonnet/Anthropic. And since then you need one for zai GLM 4.5, etc etc etc. What would be nice is if we could just use the same /profile load claudecode or /profile load cerebrasqwen3 inside of the Zed panel with ACP extensions. This would benefit gemini-cli and claude code as well. Claude lets you do /model among other things and Gemini has its /corgi mode which they felt was important.
This is what Qwen suggested:
Assistant
...
I notice from my analysis that:
initialize
method ofGeminiAgent
, the agent capabilities are set to:Looking at the protocol schema, there don't seem to be specific methods for model switching or accessing other llxprt features. The current implementation primarily handles authentication, session management, and prompting.
To access more llxprt features in ACP mode, we could:
Instrument slash commands: Add support for slash commands like
/model
in the Zed integration. This would require implementing command parsing and execution within the ACP handler.Extend protocol capabilities: Add new methods to the ACP protocol schema to support model switching and other llxprt features.
Use embedded context references: As you noted, references with
@
work because Zed has a local implementation for them. We could leverage this pattern for other features.Let me check how slash commands are implemented in the TUI mode to understand what would be needed to add them to ACP mode:
Tool Call: 'packages/cli/src/ui/commands/*.ts'
Status: Completed
Found 64 matching file(s)
Tool Call: ...ckages/src/ui/commands/modelCommand.ts
Status: Completed
Tool Call: ...ackages/cli/src/zed-integration/acp.ts
Status: Completed
**Tool Call: 'command|slash command' in /*.ts
Status: Completed
Found 4539 matches
[Showing first 50 of 4539 matches as requested]
Tool Call: 'ClientCapabilities' in packages/cli/src/zed-integration/*.ts
Status: Completed
Found 7 matches
Tool Call: ...packages/cli/src/ui/commands/types.ts
Status: Completed
Assistant
Based on the code I've reviewed, I can see that the ACP (Agent Communication Protocol) integration in LLxprt Code has limited capabilities compared to the full TUI (Text User Interface) mode. Let me summarize what I found and provide recommendations for improving model switching and other features in ACP mode:
Current Limitations in ACP Mode
Agent Capabilities Declaration:
In the
zedIntegration.ts
file, the agent capabilities are declared as:This shows that model switching capabilities aren't exposed explicitly through the protocol.
Client Capabilities:
The client capabilities only cover file system operations:
There's no explicit capability for model switching or provider management.
Proposed Solutions
To improve access to llxprt features through the protocol, here are a few suggestions:
Enhanced Client Capabilities Schema:
We could extend the client capabilities schema to include provider/model management abilities. In
schema.ts
, we might add:Add New ACP Methods:
Define new ACP methods for model/provider switching in
schema.ts
:Instrument Slash Commands Through ACP:
We could modify the
Session
class inzedIntegration.ts
to handle slash commands:Client Integration for Commands:
The client would need to be modified to send command requests to the agent:
Why References with @ Work in Zed
References with
@
work in Zed because:#resolvePrompt
method in theSession
class processes these referencesHowever, slash commands like
/model
are not currently handled because:Implementation Recommendation
To enable access to model switching and other features in ACP mode:
Add a new method to handle slash commands in the agent:
Update the
#processMessage
method in the ACP connection to handle these commandsModify the client (Zed) to send command requests when slash commands are entered
This would involve extending the schema and protocol to include command execution capabilities while maintaining compatibility with existing implementations.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions