Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/checkpoints/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ async function checkGitInstallation(
cline.checkpointServiceInitializing = false
})

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

cline
.say("checkpoint_saved", to, undefined, undefined, { isFirst, from, to }, undefined, {
.say("checkpoint_saved", to, undefined, undefined, { from, to }, undefined, {
isNonInteractive: true,
})
.catch((err) => {
Expand Down
5 changes: 2 additions & 3 deletions src/services/checkpoints/ShadowCheckpointService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,13 @@ export abstract class ShadowCheckpointService extends EventEmitter {
await this.stageAll(this.git)
const commitArgs = options?.allowEmpty ? { "--allow-empty": null } : undefined
const result = await this.git.commit(message, commitArgs)
const isFirst = this._checkpoints.length === 0
const fromHash = this._checkpoints[this._checkpoints.length - 1] ?? this.baseHash!
const toHash = result.commit || fromHash
this._checkpoints.push(toHash)
const duration = Date.now() - startTime

if (isFirst || result.commit) {
this.emit("checkpoint", { type: "checkpoint", isFirst, fromHash, toHash, duration })
if (result.commit) {
this.emit("checkpoint", { type: "checkpoint", fromHash, toHash, duration })
}

if (result.commit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,6 @@ describe.each([[RepoPerTaskCheckpointService, "RepoPerTaskCheckpointService"]])(
expect(eventData.type).toBe("checkpoint")
expect(eventData.toHash).toBe(result?.commit)
expect(typeof eventData.duration).toBe("number")
expect(typeof eventData.isFirst).toBe("boolean") // Can be true or false depending on checkpoint history
})

it("does not emit checkpoint event when no changes and allowEmpty=false", async () => {
Expand Down
1 change: 0 additions & 1 deletion src/services/checkpoints/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export interface CheckpointEventMap {
initialize: { type: "initialize"; workspaceDir: string; baseHash: string; created: boolean; duration: number }
checkpoint: {
type: "checkpoint"
isFirst: boolean
fromHash: string
toHash: string
duration: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export const CheckpointSaved = ({ checkpoint, ...props }: CheckpointSavedProps)
<div className="flex items-center justify-between">
<div className="flex gap-2">
<span className="codicon codicon-git-commit text-blue-400" />
<span className="font-bold">
{metadata.isFirst ? t("chat:checkpoint.initial") : t("chat:checkpoint.regular")}
</span>
<span className="font-bold">{t("chat:checkpoint.regular")}</span>
{isCurrent && <span className="text-muted text-sm">{t("chat:checkpoint.current")}</span>}
</div>
<CheckpointMenu {...props} checkpoint={metadata} />
Expand Down
1 change: 0 additions & 1 deletion webview-ui/src/components/chat/checkpoints/schema.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { z } from "zod"

export const checkpointSchema = z.object({
isFirst: z.boolean(),
from: z.string(),
to: z.string(),
})
Expand Down
1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/ca/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/de/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/en/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
"streamingFailed": "API Streaming Failed"
},
"checkpoint": {
"initial": "Initial Checkpoint",
"regular": "Checkpoint",
"initializingWarning": "Still initializing checkpoint... If this takes too long, you can disable checkpoints in <settingsLink>settings</settingsLink> and restart your task.",
"menu": {
Expand Down
1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/es/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/fr/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/hi/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/id/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/it/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/ja/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/ko/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/nl/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/pl/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/pt-BR/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/ru/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/tr/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/vi/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/zh-CN/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webview-ui/src/i18n/locales/zh-TW/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.