fix(agent): fall back to an available project agent#59
fix(agent): fall back to an available project agent#59khrypchenko wants to merge 1 commit intogrinev:mainfrom
Conversation
Keep the stored agent in sync with the selected project so switching worktrees does not send unsupported agent names to OpenCode.
|
@khrypchenko thanks for the fix - the new agent resolver looks good, and the regression tests around project-specific fallback are useful. I found one blocking gap before merge: the existing session selection flow still does not validate the stored agent against the selected project. In src/bot/commands/sessions.ts, the keyboard is initialized and sent after switching to an existing session, but this path does not call resolveProjectAgent() or otherwise refresh the agent state for the current project. Could you please apply the same normalization here as you already did in /new, project switching, prompt sending, model change, and variant change? It would also be good to add a regression test for the existing-session flow. |
Summary
build(or the first available primary agent) and persist that choice so project switches do not send unsupported agent names to OpenCodeVerification