fix: tolerate missing private_key_nsec in agent store#1220
Merged
Conversation
A keyring build migrates each agent nsec into the macOS Keychain and strips the inline private_key_nsec from the shared dev store. Without serde(default) the required field made an older build fail the whole serde_json::from_str at the first stripped record, taking down load_managed_agents, nest regen, and every agent. Widening read tolerance lets an old build survive a half-migrated store; the empty-key spawn-refusal path already handles the missing value downstream. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
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.
A keyring build migrates each agent's nsec into the macOS Keychain and strips the inline
private_key_nsecfrom the shared dev agent store. On the old (non-keyring) build,private_key_nsecis a required field onManagedAgentRecord, so a stripped/missing inline key fails the wholeserde_json::from_strat the first affected record — taking download_managed_agents, nest-context regeneration, and every agent at once.Adding
#[serde(default)]toprivate_key_nsecwidens the old build's read tolerance: a missing inline key now deserializes to an emptyStringinstead of failing the parse, letting an old build survive a half-migrated store. The empty-key case is already handled downstream by the existing spawn-refusal path, so this is pure read-tolerance widening with no behavior change for valid stores.Related: keyring foundation #1172 (already forwards-tolerant on its own load path).