Skip to content

fix(core): snapshot runs in user-created child sessions - #506

Merged
lg2m merged 2 commits into
mainfrom
fix/child-session-snapshots
Oct 30, 2026
Merged

lg2m merged 2 commits into
mainfrom
fix/child-session-snapshots

Conversation

@lg2m

@lg2m lg2m commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Change

User-created child sessions now take their own workspace snapshots, so undo preserves earlier runs’ edits. Spawned write children still share a sponsoring run’s snapshot.

The rule uses immutable RunOrigin::Delegated.owner_run_id and skips only when that sponsor or a delegated ancestor has an existing snapshot for the same workspace (execution.rs:3268-3303). The spawner stores sessions.owner_run_id and the delegated run origin (commands.rs:136-180); CreateSession stores parent/depth without a sponsoring run (commands.rs:789-859). Session depth alone does not establish coverage.

Verification

  • cargo nextest run -p qq-core -E 'test(/snapshot|undo/)': 55 passed. On origin/main with the tests added, 54 passed and the user-created-child regression failed (one snapshot instead of two).
  • SessionRuntime tests verify undo removes only the child’s change, preserves the earlier root change, and root undo reverts a spawned write child without a child snapshot.
  • cargo xtask check: passed on 7b91208; subsequent commit only clarifies design documentation. git diff --check passed.

Known impact

None.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T23:57:06.679389Z 007bbb2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lg2m
lg2m merged commit e33bb26 into main Oct 30, 2026
10 checks passed
@lg2m
lg2m deleted the fix/child-session-snapshots branch October 30, 2026 00:08
@lg2m lg2m mentioned this pull request Oct 30, 2026
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