Currently only the build agent is supported, Opencode allows to change the agent per message sent.
The problem is that we can't fetch available agents before the start of the session (we need a running sandbox for that).
Considerations
- Read Opencode config from the repo and infer available agents
- pros: we have all the agents before sandbox starts
- cons: we have to duplicate opencode config parsing, which adds complexity and a layer of indirection
- Fetch the agents from opencode /agent endpoint
- pros: opencode server is source of truth, so the agents are really running
- cons: to show agents before session starts, we need to add a cache
Proposed implementation
- Prompt-level agent selection through web -> control plane -> sandbox -> OpenCode
- Agent discovery from live OpenCode /agent
- Added repo+branch cache so agents can be shown before sandbox startup
Rushed implementation here.
Just wanted to bring up discussion if it's a good direction. cc: @ColeMurray
I deployed and if we agree I can refine the PR 🙇🏼♂️
Currently only the build agent is supported, Opencode allows to change the agent per message sent.
The problem is that we can't fetch available agents before the start of the session (we need a running sandbox for that).
Considerations
Proposed implementation
Rushed implementation here.
Just wanted to bring up discussion if it's a good direction. cc: @ColeMurray
I deployed and if we agree I can refine the PR 🙇🏼♂️