fix(cloud-agent-next): scrub transient lifecycle parts on session restore - #5092
Merged
Conversation
…tore Drop leftover CLI snapshot-progress parts (kilocode.lifecycle=transient) from export JSON before kilo import so cold restore cannot poison later LLM turns via invalid providerOptions.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of the sanitize-pipeline rework (one composed jq pass with a now-total transient-parts filter) found no issues in the changed code; both previous findings are resolved at HEAD and covered by a new regression test. Files Reviewed (2 files)
Previous Review Summary (commit f133b2f)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit f133b2f)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (2 files)
Reviewed by kimi-k3 · Input: 41K · Output: 8.7K · Cached: 245.9K Review guidance: REVIEW.md from base branch |
- Guard the transient-parts jq filter with a top-level type check so non-object snapshots pass through unchanged instead of yielding empty output that sanitizeSnapshotWithJq would rename (0 bytes) over a user-supplied --file snapshot - Compose token-count and transient-part sanitization into one jq invocation so large exports are read+rewritten once per restore - Fix the part-shape typing in the transient-parts test and add a regression test for non-object --file passthrough
jeanduplessis
approved these changes
Aug 6, 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
kilo import, strip message parts withmetadata["kilocode.lifecycle"] == "transient"from the session export (same pre-import sanitize path as negative token counts).providerOptionsand rejected (providerOptions.kilocode.lifecycleexpected record, got"transient").toModelMessagesis still needed for full coverage.Test plan
bun test src/restore-session.test.tsinservices/cloud-agent-next/wrapper(40 pass), including new test that captures the import payload and asserts transient parts are removedInitializing snapshot…transient part; confirm follow-up prompts succeed