Skip to content

Commit d3e7040

Browse files
committed
feat: remove isFirst property from checkpoint system
- Removed isFirst from checkpoint schema - Removed isFirst from CheckpointEventMap type - Removed isFirst logic from ShadowCheckpointService - Updated core checkpoints to not use isFirst - Updated tests to remove isFirst references This completes the removal of the Initial Checkpoint terminology distinction.
1 parent 60d4d14 commit d3e7040

File tree

5 files changed

+4
-8
lines changed

5 files changed

+4
-8
lines changed

src/core/checkpoints/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ async function checkGitInstallation(
134134
cline.checkpointServiceInitializing = false
135135
})
136136

137-
service.on("checkpoint", ({ isFirst, fromHash: from, toHash: to }) => {
137+
service.on("checkpoint", ({ fromHash: from, toHash: to }) => {
138138
try {
139139
provider?.postMessageToWebview({ type: "currentCheckpointUpdated", text: to })
140140

141141
cline
142-
.say("checkpoint_saved", to, undefined, undefined, { isFirst, from, to }, undefined, {
142+
.say("checkpoint_saved", to, undefined, undefined, { from, to }, undefined, {
143143
isNonInteractive: true,
144144
})
145145
.catch((err) => {

src/services/checkpoints/ShadowCheckpointService.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,13 @@ export abstract class ShadowCheckpointService extends EventEmitter {
215215
await this.stageAll(this.git)
216216
const commitArgs = options?.allowEmpty ? { "--allow-empty": null } : undefined
217217
const result = await this.git.commit(message, commitArgs)
218-
const isFirst = this._checkpoints.length === 0
219218
const fromHash = this._checkpoints[this._checkpoints.length - 1] ?? this.baseHash!
220219
const toHash = result.commit || fromHash
221220
this._checkpoints.push(toHash)
222221
const duration = Date.now() - startTime
223222

224-
if (isFirst || result.commit) {
225-
this.emit("checkpoint", { type: "checkpoint", isFirst, fromHash, toHash, duration })
223+
if (result.commit) {
224+
this.emit("checkpoint", { type: "checkpoint", fromHash, toHash, duration })
226225
}
227226

228227
if (result.commit) {

src/services/checkpoints/__tests__/ShadowCheckpointService.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,6 @@ describe.each([[RepoPerTaskCheckpointService, "RepoPerTaskCheckpointService"]])(
693693
expect(eventData.type).toBe("checkpoint")
694694
expect(eventData.toHash).toBe(result?.commit)
695695
expect(typeof eventData.duration).toBe("number")
696-
expect(typeof eventData.isFirst).toBe("boolean") // Can be true or false depending on checkpoint history
697696
})
698697

699698
it("does not emit checkpoint event when no changes and allowEmpty=false", async () => {

src/services/checkpoints/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export interface CheckpointEventMap {
2525
initialize: { type: "initialize"; workspaceDir: string; baseHash: string; created: boolean; duration: number }
2626
checkpoint: {
2727
type: "checkpoint"
28-
isFirst: boolean
2928
fromHash: string
3029
toHash: string
3130
duration: number

webview-ui/src/components/chat/checkpoints/schema.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { z } from "zod"
22

33
export const checkpointSchema = z.object({
4-
isFirst: z.boolean(),
54
from: z.string(),
65
to: z.string(),
76
})

0 commit comments

Comments
 (0)