feat(agent): sync model when switching agents#124
Open
jeffusion wants to merge 2 commits into
Open
Conversation
84e6b54 to
8f89b1d
Compare
added 2 commits
May 20, 2026 19:55
When switching agents via the Telegram bot, the model now automatically syncs to the model configured for that agent in OpenCode config. If the agent has no model configured, the current model is preserved. Manual model switching remains independent and unaffected.
Remove /rename as an independent command and unify all session
operations (Select, Rename, Delete) into a session preview panel
accessed via /sessions. This eliminates the fragmented entry points
and ensures a consistent UX for session management.
Key changes:
- Remove /rename command, rename.ts, and RenameManager
- Add preview panel with Select/Rename/Delete/Close actions
- Add session deletion with confirmation dialog and detach cleanup
- Add SSE session.deleted event handling for external deletions
- Add fetchCurrentModelFromSession() to sync model on session switch
- Fix post-attach ordering: model sync before context limit refresh
- Fix agent sync: use clearCurrentAgent() instead of setCurrentAgent("")
- Use sessions.deleted_external i18n key for external deletion notices
8f89b1d to
58b72b2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
src/agent/types.ts— Add optionalmodelfield toAgentInfointerfacesrc/agent/manager.ts— Map SDKAgent.modeltoAgentInfo; addgetModelForAgent()helpersrc/bot/handlers/agent.ts— After selecting an agent, sync model + refresh context limit if the agent has a configured modelTest plan