Conversation
…ve errors The sync effect's catch block was calling applyAgentModelLocally() on any conversations.retrieve failure, which cleared the hasConversationModelOverride flag and reset the model display to agent defaults — even though the override was still persisted in the DB. This caused intermittent model snap-back that didn't require a recent /model command to trigger: any transient network error during the sync cycle would discard the local override knowledge, and without another agentState change to re-trigger the effect, the reset persisted for the remainder of the turn. The fix simply preserves current local state on error. The next sync cycle will retry the retrieve and self-correct if needed. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
ace3465 to
abb4d57
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
catchblock was callingapplyAgentModelLocally()on anyconversations.retrievefailure, which clearedhasConversationModelOverrideand reset the model display to agent defaults — even though the override was still persisted in the DB./modelto trigger: any transient network error during the sync cycle would discard local override state, and without anotheragentStatechange to re-trigger the effect, the reset persisted.Context
This addresses the error-path fallback identified during review of #1229 and #1238. Those PRs target the narrow race between
handleModelSelectand the first-chunksyncAgentState, but the observed snap-back (without recent/model) is more likely caused by this error-path resetting the override flag on transient failures.Test plan
bun run typecheck— pre-existing errors only, no new issuesbun run lint— clean (warnings only, pre-existing)bun test src/tests/agent/model-preset-refresh.wiring.test.ts— 9/9 pass👾 Generated with Letta Code