Skip to content

Preview snapshot edits and bind application to the reviewed result - #54

Merged
Telli merged 10 commits into
mainfrom
codex/snapshot-edit-previews
Nov 6, 2026
Merged

Telli merged 10 commits into
mainfrom
codex/snapshot-edit-previews

Conversation

@Telli

@Telli Telli commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Agents in read-only and plan modes can use preview_file_snapshot to inspect the exact text removed and inserted by a proposed batch. The preview reports original line coordinates, the resulting content hash, and a deterministic preview ID.

Callers can pass that ID to edit_file_snapshot to require the reviewed target and result. A changed source returns staleSnapshot. A changed target or proposed result returns previewMismatch. Preview and apply share the same batch validation and text construction.

Validation

  • Release solution build passed with warnings treated as errors.
  • All 481 .NET tests passed in one run, including 328 unit, 133 integration, and 20 parity tests.
  • Tests cover plan-mode preview, workspace denial, exact CRLF and Unicode fragments, stale content, path and result mismatches, no-ops, and direct and preview-bound edits through checkpoint undo/redo after restart.

Compatibility

The original apply arguments and result format remain supported. The preview ID checks consistency. Write permissions and the mutation journal still govern publication. The existing filesystem concurrency limits are documented in docs/interactive-runtime.md.

Stacked on PR #53. Local validation ran on macOS.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Telli and others added 5 commits November 5, 2026 18:31
…paction pinning

- Stage snapshot replacements with the target's Unix mode before writing
  content, and report a target deleted mid-staging as stale.
- Document that snapshot publication does not keep owner/ACLs/xattrs.
- write_file and edit_file take the shared semantic-write lock.
- REPL: keep the session open on non-provider prompt failures; return
  nonzero for unknown slash commands and failed custom commands; keep
  the last exit code on idle Ctrl+C.
- Compaction: check the summary budget only once compaction is needed,
  and pin the turn's original request as well as the latest correction.
- Keep provider-reported usage when the response text is empty.
- Add coverage for staging recheck, precheck cancellation, snapshot
  symlink escape, unfinished primary compaction, and cancel isolation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ontrol' into codex/runtime-resilience

# Conflicts:
#	src/SharpClaw.Code.Runtime/Context/AutomaticContextManager.cs
…reviews

# Conflicts:
#	docs/interactive-runtime.md
#	docs/tools.md
#	src/SharpClaw.Code.Permissions/Rules/WorkspaceBoundaryRule.cs
#	src/SharpClaw.Code.Tools/BuiltIn/EditFileSnapshotTool.cs
#	src/SharpClaw.Code.Tools/Models/SnapshotEditModels.cs
#	src/SharpClaw.Code.Tools/ToolsServiceCollectionExtensions.cs
#	src/SharpClaw.Code.Tools/Utilities/FileTextSnapshot.cs
#	tests/SharpClaw.Code.IntegrationTests/Runtime/InteractiveMilestoneTests.cs
#	tests/SharpClaw.Code.UnitTests/Tools/SnapshotEditingTests.cs
@Telli
Telli changed the base branch from codex/editor-live-turns to main November 6, 2026 03:15
@Telli
Telli marked this pull request as ready for review November 6, 2026 03:15
Copilot AI balanced review requested due to automatic review settings November 6, 2026 03:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Telli
Telli merged commit f42d30b into main Nov 6, 2026
1 of 2 checks passed
@Telli
Telli deleted the codex/snapshot-edit-previews branch November 6, 2026 03:18
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.

2 participants