Skip to content

feat(session-ingest): export session diffs#3762

Open
iscekic wants to merge 2 commits into
mainfrom
feat/session-diff-export
Open

feat(session-ingest): export session diffs#3762
iscekic wants to merge 2 commits into
mainfrom
feat/session-diff-export

Conversation

@iscekic
Copy link
Copy Markdown
Contributor

@iscekic iscekic commented Jun 5, 2026

Summary

Export the latest session_diff payload from session ingest as a top-level sessionDiff field so clients can restore filesystem state without scraping message summaries. Update the cloud-agent restore wrapper to prefer that top-level diff payload, apply patch-backed diffs with git apply --3way, and retain the existing message-summary fallback for older exports.

Verification

  • No UI path to manually verify; this is backend export/restore behavior. The end-to-end CLI import path was verified against a local fake ingest export in the companion Kilo PR.

Visual Changes

N/A

Reviewer Notes

This keeps the ingest export format backward compatible: sessions without a stored diff return sessionDiff: [], and restore still falls back to legacy messages[].info.summary.diffs data.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Jun 5, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The previously flagged WARNING (R2 fallback emitting {} instead of [] for a missing session_diff blob) has been resolved: enqueueItemData now accepts a missingFallback parameter, and the session_diff call site passes '[]', with a new integration test asserting the empty-array output.

Files Reviewed (4 files)
  • services/session-ingest/src/dos/SessionIngestDO.ts — fixed (previous WARNING resolved)
  • services/session-ingest/test/integration/session-ingest-do.test.ts — new test added
  • services/cloud-agent-next/wrapper/src/restore-session.ts — no changes
  • services/cloud-agent-next/wrapper/src/restore-session.test.ts — no changes

Reviewed by claude-4.6-sonnet-20260217 · 171,711 tokens

Review guidance: REVIEW.md from base branch main

@iscekic iscekic self-assigned this Jun 5, 2026
@iscekic
Copy link
Copy Markdown
Contributor Author

iscekic commented Jun 5, 2026

Fixed in debe6c7. enqueueItemData now accepts a fallback payload, the sessionDiff export path passes [] for missing R2-backed diffs, and the integration test covers that missing-blob case.

@iscekic iscekic requested a review from eshurakov June 5, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant