Compare commits

...

4 Commits

Author SHA1 Message Date
celestial-vault a94f3b3ba9 merge conflicts 2025-09-30 11:13:45 -07:00
celestial-vault c751cff677 merge conflicts 2025-09-27 16:41:31 -07:00
celestial-vault 67e0d9883c consolidate statemanager calls to use variables 2025-09-27 10:28:05 -07:00
celestial-vault 8964561b9e remove task class enable checkpoints variable and directly use statemanager 2025-09-26 16:37:31 -07:00
+10 -11
View File
@@ -256,6 +256,8 @@ export class Task {
})
}
const enableCheckpoints = this.stateManager.getGlobalSettingsKey("enableCheckpointsSetting")
// Initialize checkpoint manager based on workspace configuration
try {
this.checkpointManager = buildCheckpointManager({
@@ -278,7 +280,7 @@ export class Task {
if (
shouldUseMultiRoot({
workspaceManager: this.workspaceManager,
enableCheckpoints: this.stateManager.getGlobalSettingsKey("enableCheckpointsSetting"),
enableCheckpoints: enableCheckpoints,
isMultiRootEnabled: featureFlagsService.getMultiRootEnabled(),
})
) {
@@ -289,7 +291,7 @@ export class Task {
}
} catch (error) {
console.error("Failed to initialize checkpoint manager:", error)
if (this.stateManager.getGlobalSettingsKey("enableCheckpointsSetting")) {
if (enableCheckpoints) {
const errorMessage = error instanceof Error ? error.message : "Unknown error"
HostProvider.window.showMessage({
type: ShowMessageType.ERROR,
@@ -1737,10 +1739,12 @@ export class Task {
}),
)
const enableCheckpoints = this.stateManager.getGlobalSettingsKey("enableCheckpointsSetting")
// Initialize checkpointManager first if enabled and it's the first request
if (
isFirstRequest &&
this.stateManager.getGlobalSettingsKey("enableCheckpointsSetting") &&
enableCheckpoints &&
this.checkpointManager && // TODO REVIEW: may be able to implement a replacement for the 15s timer
!this.taskState.checkpointManagerErrorMessage
) {
@@ -1759,7 +1763,7 @@ export class Task {
// Now, if it's the first request AND checkpoints are enabled AND tracker was successfully initialized,
// then say "checkpoint_created" and perform the commit.
if (isFirstRequest && this.stateManager.getGlobalSettingsKey("enableCheckpointsSetting") && this.checkpointManager) {
if (isFirstRequest && enableCheckpoints && this.checkpointManager) {
await this.say("checkpoint_created") // Now this is conditional
const lastCheckpointMessageIndex = findLastIndex(
this.messageStateHandler.getClineMessages(),
@@ -1787,7 +1791,7 @@ export class Task {
}
} else if (
isFirstRequest &&
this.stateManager.getGlobalSettingsKey("enableCheckpointsSetting") &&
enableCheckpoints &&
!this.checkpointManager &&
this.taskState.checkpointManagerErrorMessage
) {
@@ -1916,12 +1920,7 @@ export class Task {
// Capture task initialization timing telemetry for the first API request
if (isFirstRequest) {
const durationMs = Math.round(performance.now() - this.taskInitializationStartTime)
telemetryService.captureTaskInitialization(
this.ulid,
this.taskId,
durationMs,
this.stateManager.getGlobalSettingsKey("enableCheckpointsSetting"),
)
telemetryService.captureTaskInitialization(this.ulid, this.taskId, durationMs, enableCheckpoints)
}
// since we sent off a placeholder api_req_started message to update the webview while waiting to actually start the API request (to load potential details for example), we need to update the text of that message