fix: preserve model for exit notifications#50
Merged
Conversation
Contributor
Author
|
need to mention the reason why i need this is: |
Owner
|
LGTM, thanks! |
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
promptAsyncSession.modelProblem
sendExitNotification()currently passes the originating agent but omits the model and variant. OpenCode resolves a prompt without an explicit model as:If the agent's configured default differs from the model selected for the current session, the generated
<pty_exited>user turn switches the session to that default. All subsequent assistant turns then use the wrong model.This uses only the standard OpenCode
session.getandpromptAsyncAPIs. It does not depend on another plugin. The local compatibility cast is needed because the package's pinned SDK type predates the runtimeSession.modelfield.Verification
bun test test/notification-manager.test.tsbun typecheckbun lintbun formatgpt-5.6-terra/highsession received a<pty_exited>notification and retainedgpt-5.6-terra/highon the notification user message, subsequent assistant messages, and session summary