fix: use targeted JSON patching in sync_daemon_session_status#345
Merged
Conversation
Owner
Author
Self-ReviewSummaryClean, focused fix that correctly addresses the root cause: FindingsStrengths
Noted (non-blocking)
Security
Checklist
|
dccde75 to
1e99aad
Compare
sync_daemon_session_status() was using save_session_to_file() which round-trips through the Session struct, silently dropping fields from newer binary versions (e.g., task_list_id). This is the same class of bug fixed in agent_status.rs by PR #319. Changes: - Add patch_session_json_fields() for atomic multi-field JSON patching - Replace save_session_to_file() with field-level patches in sync_daemon_session_status - Add test verifying unknown fields survive multi-field patching Fixes #321
1e99aad to
082d930
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
sync_daemon_session_status()was usingsave_session_to_file()which round-trips through theSessionstruct, silently dropping fields from newer binary versions (e.g.,task_list_id)agent_status.rsby PR feat: transfer task list across agent sessions via CLAUDE_CODE_TASK_LIST_ID #319, just in a different code path (kild list/kild statusdaemon sync)patch_session_json_fields()helperChanges
crates/kild-core/src/sessions/persistence.rspatch_session_json_fields()for atomic multi-field JSON patchingcrates/kild-core/src/sessions/handler.rssave_session_to_file()with field-level patches insync_daemon_session_statuscrates/kild-core/src/sessions/persistence.rsTesting
cargo fmt --checkpassescargo clippy --all -- -D warningspassescargo test --allpasses (all 1243 tests)test_patch_session_json_fields_preserves_unknown_fieldsvalidates the fixValidation
Fixes #321