Repository navigation
feat(checkpoints): per-step change cards and changeCardDetail setting (B3a, #1375) #1411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
easonLiangWorldedtech
wants to merge
39
commits into
Zoo-Code-Org:main
Choose a base branch
from
easonLiangWorldedtech:feat/change-cards-b3a
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
abfbe7f
feat(checkpoints): per-write checkpoints, task-start baseline, and pe…
easonliang28 93a8329
feat(checkpoints): per-task change journal with torn-tail repair (B2,…
easonliang28 2500ab3
feat(checkpoints): per-step change cards and changeCardDetail setting…
easonliang28 9b0787a
fix(fws): test the pre-hydration change-card detail default
easonliang28 1f36d80
feat(fws): record per-write checkpoint and change card for apply_diff…
easonliang28 94fea2f
test(fws): keep the apply_diff change-card spec green on the trial st…
easonliang28 341a9c2
test(fws): assert the perWriteCheckpoints initializer default alongsi…
easonliang28 67d8525
feat(fws): edit and search_replace writes now record the per-write ch…
easonliang28 c202745
fix(fws): type the settings Slider test double and correct the nl cha…
easonliang28 8c5c53b
test(fws): type the VSCodeCheckbox/VSCodeLink test doubles in the set…
easonliang28 0d31ea0
chore(ci): empty commit — re-trigger CI and the CodeRabbit current-he…
easonliang28 0c11570
fix(settings): address CodeRabbit review feedback (PR 1411)
easonliang28 fb9aa06
Merge remote-tracking branch 'upstream/main' into feat/change-cards-b3a
86b3c25
test(visual): regenerate electron chat-dark sidebar reference for #1411
39c1eff
Merge upstream/main (9c069e94ef) into feat/change-cards-b3a
easonliang28 c72617c
style(checkpoints): prettier-format files flagged by the new format:c…
easonliang28 9633e18
i18n(tr): fix possessive link in changeCardDetail disabled-state sent…
easonliang28 c3bef96
fix(checkpoints): skip task-start baseline on history resume
easonliang28 f73f38c
fix(checkpoints): skip baseline on aborted task; share default constant
easonliang28 525c023
fix(checkpoints): recheck cancellation after the baseline state lookup
easonliang28 578d8fb
fix(tools): defer the queued-message handoff until the patch checkpoi…
easonliang28 e0f15d2
fix(task): never dequeue queued messages for an aborted task
easonliang28 2ef4573
chore: remove carried-over Stryker suppression directives from touche…
easonliang28 f37b9bf
Merge remote-tracking branch 'upstream/main' into feat/change-cards-b3a
easonLiangWorldedtech 1ee917c
fix: satisfy unused-variable lint after main refresh
easonliang28 d1998f9
test: de-indent the delete-patch fixture markers
easonliang28 7191d82
Merge remote-tracking branch 'upstream/main' into feat/change-cards-b3a
easonLiangWorldedtech e25d427
Merge upstream/main (tool-call state scoping) and adapt execute spec …
easonliang28 047595e
style: apply Prettier formatting to callback fixture edits
easonliang28 1790ba3
test: cover the change-card Zod contracts directly
easonliang28 501d206
fix: skip change-card emission for no-op checkpoints
easonliang28 eae754b
fix: harden change-journal append and task-ID path containment
easonliang28 b66edb1
fix: propagate non-ENOENT tail-inspection errors and complete partial…
easonliang28 edeb407
fix: validate journal entry shape on load and sync the new file's dir…
easonliang28 ce72f5c
fix: make journal updates serialized and atomic per checkpoint
easonliang28 8148928
fix(checkpoints): typed partial-persistence errors; explicit tool fai…
easonliang28 f7da3b1
fix(checkpoints): harden journal durability and defer success until p…
easonliang28 fca9a55
fix(checkpoints): require a stable journal location for write-metadat…
easonliang28 4a0799b
fix(checkpoints): fail loudly on lost commits and keep card diffs out…
easonliang28 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file modified
BIN
+2.79 KB
(110%)
apps/vscode-e2e/src/visual/__screenshots__/electron-chat-dark-sidebar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| import { describe, expect, it } from "vitest" | ||
|
|
||
| import type { ChangeCardData } from "@roo-code/types" | ||
|
|
||
| import { | ||
| buildChangeCard, | ||
| buildChangeCardPayload, | ||
| isAutoApprovedStep, | ||
| resolveChangeCardDetail, | ||
| type ChangeCardWrite, | ||
| } from "../changeCard" | ||
|
|
||
| describe("changeCard (B3a)", () => { | ||
| function write(overrides: Partial<ChangeCardWrite> = {}): ChangeCardWrite { | ||
| return { | ||
| path: "src/a.ts", | ||
| diffStats: { additions: 2, deletions: 1 }, | ||
| diff: "--- a/src/a.ts\n+++ b/src/a.ts\n@@ -1 +1,2 @@\n-old\n+new-1\n+new-2", | ||
| ...overrides, | ||
| } | ||
| } | ||
|
|
||
| describe("isAutoApprovedStep", () => { | ||
| it("returns false for an empty step", () => { | ||
| expect(isAutoApprovedStep([])).toBe(false) | ||
| }) | ||
|
|
||
| it("returns true only when every write was auto-approved", () => { | ||
| expect(isAutoApprovedStep([write({ autoApproved: true }), write({ autoApproved: true })])).toBe(true) | ||
| expect(isAutoApprovedStep([write({ autoApproved: true }), write()])).toBe(false) | ||
| expect(isAutoApprovedStep([write()])).toBe(false) | ||
| }) | ||
| }) | ||
|
|
||
| describe("resolveChangeCardDetail", () => { | ||
| it("forces summary for auto-approved steps even when the setting is full", () => { | ||
| const writes = [write({ autoApproved: true })] | ||
| expect(resolveChangeCardDetail(writes, "full")).toBe("summary") | ||
| expect(resolveChangeCardDetail(writes, undefined)).toBe("summary") | ||
| }) | ||
|
|
||
| it("follows the setting for interactive steps, defaulting to summary when unset", () => { | ||
| const writes = [write()] | ||
| expect(resolveChangeCardDetail(writes, "full")).toBe("full") | ||
| expect(resolveChangeCardDetail(writes, "summary")).toBe("summary") | ||
| expect(resolveChangeCardDetail(writes, undefined)).toBe("summary") | ||
| }) | ||
| }) | ||
|
|
||
| describe("buildChangeCard", () => { | ||
| it("carries the inline diff per file for full detail on a multi-file step", () => { | ||
| const card = buildChangeCard( | ||
| "sha-1", | ||
| [write(), write({ path: "src/b.ts", diffStats: { additions: 1, deletions: 0 }, diff: "+b" })], | ||
| "full", | ||
| ) | ||
|
|
||
| expect(card).toEqual({ | ||
| checkpointIds: ["sha-1"], | ||
| files: [ | ||
| { | ||
| path: "src/a.ts", | ||
| additions: 2, | ||
| deletions: 1, | ||
| diff: "--- a/src/a.ts\n+++ b/src/a.ts\n@@ -1 +1,2 @@\n-old\n+new-1\n+new-2", | ||
| }, | ||
| { path: "src/b.ts", additions: 1, deletions: 0, diff: "+b" }, | ||
| ], | ||
| totalFiles: 2, | ||
| detail: "full", | ||
| }) | ||
| }) | ||
|
|
||
| it("omits the diff per file for summary detail (lazy fetch is B3b)", () => { | ||
| const card = buildChangeCard("sha-1", [write()], "summary") | ||
|
|
||
| expect(card.files).toEqual([{ path: "src/a.ts", additions: 2, deletions: 1 }]) | ||
| expect(card.files[0]).not.toHaveProperty("diff") | ||
| expect(card.detail).toBe("summary") | ||
| expect(card.totalFiles).toBe(1) | ||
| }) | ||
|
|
||
| it("defaults missing diffStats to zero counts and keeps full detail without diff for a write without one", () => { | ||
| const card = buildChangeCard("sha-1", [write({ diffStats: undefined, diff: undefined })], "full") | ||
|
|
||
| expect(card.files[0]).toEqual({ path: "src/a.ts", additions: 0, deletions: 0 }) | ||
| }) | ||
| }) | ||
|
|
||
| describe("buildChangeCardPayload", () => { | ||
| it("resolves the detail level and builds the payload in one call", () => { | ||
| // The expectations are typed against the shared ChangeCardData | ||
| // contract in @roo-code/types, so the builder's output is checked | ||
| // against the same single source of truth the webview consumes. | ||
| // Interactive step with the full setting: diff inline. | ||
| const full: ChangeCardData = buildChangeCardPayload("sha-1", [write()], "full") | ||
| expect(full.detail).toBe("full") | ||
| expect(full.files[0].diff).toBe("--- a/src/a.ts\n+++ b/src/a.ts\n@@ -1 +1,2 @@\n-old\n+new-1\n+new-2") | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| // Auto-approved step with the full setting: compact summary, no diff. | ||
| const compact: ChangeCardData = buildChangeCardPayload("sha-1", [write({ autoApproved: true })], "full") | ||
| expect(compact.detail).toBe("summary") | ||
| expect(compact.files[0]).not.toHaveProperty("diff") | ||
| expect(compact.checkpointIds).toEqual(["sha-1"]) | ||
| expect(compact.totalFiles).toBe(1) | ||
| }) | ||
| }) | ||
| }) | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.