fix(channels): preserve unresolved secret refs#3371
Merged
Conversation
Letta Code (agent-c2adbf5c-8419-4211-8cd8-3740db164974) Preserve keyring-backed channel secret refs when secure-store reads return null, so restart hydration leaves the persisted account recoverable instead of rewriting it with a blank token. Regression covers the Telegram restart path through accounts.json hydration and persistence. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
just-cameron
approved these changes
Jul 15, 2026
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
Scope
This replaces #3270 with the narrow fix for the original restart/hydration failure. It does not change blank settings-save policy, plugin secrets, mutation locking, or account transaction behavior.
Proof
The regression fails on current main because hydration removes
__letta_secret_refs.tokenand persiststoken: "". It passes with this patch and verifies the account file remains byte-for-byte unchanged.Validation
bun test src/channels/credential-store.test.ts src/websocket/listen-client-channel-accounts.test.ts— 14 passbun run check— 12 checks passLinear: LET-9461
👾 Generated with Letta Code