Repository navigation
feat(review): support --resume for workspace mode - #1922
Conversation
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s). |
|
Thanks for updating this on top of #1915. Strict/static workspace resume is the intended scope: unchanged HEAD and review input, reuse completed checkpoints, and retry unfinished work. Incremental reuse after edits and protection against edits during execution remain out of scope. I tested a binary built from 1. Reject resume after a tracked-file deletionReproduced with two independently dispatched workspace changes:
Actual: exit 0, terminal state Expected: reject before creating a child session or issuing an LLM request, and ask for a fresh review. This is an input change before admission, not a concurrent-edit or incremental-resume requirement. The identity currently relies on the review-item digest, and 2. Add an end-to-end regressionPlease add a deterministic CLI-level test using a temporary Git repository and a controlled fake LLM, covering a saved partially completed workspace session and its resume. Assert:
The live test already confirmed the unchanged-input case and rejection after a selected-file edit or HEAD change. The deletion case is the failing one; please retain the passing behavior and existing range/commit coverage. 3. Synchronize the tool guides
AI assistance disclosure: Codex assisted with review/test preparation and this summary; the live OCR tests used |
Workspace identity hashed only non-deleted diffs, so deleting an otherwise unchanged tracked file left source_artifact_sha256 identical to the parent's and a resumed session silently reviewed a different workspace: the deleted file was excluded while its dependent edits were reused. Include deleted diffs in the workspace digest. Range and commit reviews keep skipping them because their comparison endpoints already seal the old side; workspace reviews have no such seal, so a deletion or restoration of a tracked file must change the admitted identity and fail closed on resume. Add a deterministic CLI-level regression: a real Git repository plus a fake LLM produce a partially completed workspace session, and the test asserts that unchanged input reuses completed files and retries only unfinished ones, while editing a selected file, deleting an unchanged tracked file, restoring a file deleted in the parent input, or moving HEAD is rejected before a child session or LLM request. Returning the workspace exactly to the parent input is accepted again. Update all five tool guides to describe the strict/static workspace resume contract instead of claiming it is unsupported.
|
Thanks — all three points are addressed in 60ceb8e (pushed to 1. Tracked-file deletion is now part of the workspace identity. 2. Deterministic CLI-level regression added as
I also verified the deletion subtest fails on the pre-fix code and passes with the fix. 3. All five tool guides synchronized ( Verification: AI disclosure: the implementation and tests above were produced with DeepSeek Harness (deepseek-v4.1-flash); I reviewed the diff and ran the suite. |
|
Thanks for the update. I checked Could you make two focused documentation/test follow-ups? 1. Make the normalized-input boundary explicit and test itThe current identity compares the selected, parsed/normalized diff, not a byte-identical snapshot of the selected files. For example, an untracked file without a final LF and the same file with a final LF can produce the same synthesized patch ( Please clarify that distinction wherever the resume contract could imply byte-for-byte worktree equality, including the CLI references/tool guides and the introductory comment in Please add deterministic cases with a real untracked file and the fake LLM to pin the intended behavior for adding/removing its final LF and converting LF/CRLF. If normalized-diff equality is the intended contract, assert that these equivalent inputs may resume and reuse completed work, while a substantive content edit still rejects before creating a child session or issuing an LLM request. If byte-exact equality is intended instead, the identity needs to preserve those distinctions rather than documenting the stronger guarantee over the current fingerprint. This is a contract clarification and regression request, not a request for incremental recovery, workspace snapshots, or protection against edits during execution. 2. Tighten the existing zero-request assertionIn AI assistance disclosure: Codex assisted with this follow-up review and comment. |
The workspace resume identity covers the selected, parsed diff rather than a byte-for-byte worktree snapshot. Document that boundary in the CLI references and tool guides (all five locales) and pin it with an end-to-end test: an untracked file that gains or loses its final newline, or switches between LF and CRLF, normalizes to the same diff and reuses completed checkpoints, while a substantive edit is still rejected before a child session or LLM request. Also tighten the rejected-resume assertion to compare complete per-file attempt counts; comparing only the number of file keys would miss a second request for an already-seen file.
|
Addressed both follow-ups in 1. Normalized-input boundary. I kept the contract as normalized-diff equality — identity is the selected, parsed diff — rather than byte-exact worktree equality, and made the distinction explicit:
2. Zero-request assertion. Verification: AI assistance disclosure: implementation and wording were drafted with DeepSeek Harness (deepseek-v4.1-flash) and verified locally as described above. |
Description
Closes #1880.
Workspace mode — the default
ocr reviewwith no--from/--to/--commit— can now resume an interrupted session. PreviouslyloadReviewResumeStaterejected it outright, so the only way to finish a large uncommitted review was to start over.The rules are strict, and follow the existing resume contract:
reviewItemFingerprint/ manifest coverage path, so only files the parent settled as completed are skipped;Because workspace input cannot be sealed the way
agent.SealedInputseals commit endpoints, the admission check is the sole guarantee; this is documented invalidateInputIdentity. Edits made during a resumed run are outside the contract (there is nothing to pin them to).Docs updated in all five locales (
en,zh,ja,ko,ru).Type of Change
How Has This Been Tested?
make testpasses locally (go test ./..., all 26 packages)go vet ./...andgofmt -lare cleanTestValidateOptions_WorkspaceMatches/TestValidateOptions_RejectsWorkspaceMismatchTestValidateResumecases for workspace accepted, changed content, changed baseTestLoadReviewResumeState/workspace_resume_loads_sessionTestValidateResumeIdentityWorkspace(real git worktree: accepted when unchanged, rejected and persists nothing after an edit)TestApplyResumeWorkspaceReusesCompletedItemsChecklist
go fmt,go vet)AI disclosure: implementation was drafted with DeepSeek Harness (deepseek-v4.1-flash) and reviewed/tested by the author; no AI co-author trailer.
Related Issues
Closes #1880