feat(KB-082): complete Step 1 — Add error field to Task type and store

This commit is contained in:
gsxdsm
2026-03-29 21:41:28 -07:00
parent 385739ee2c
commit a2be60d8c9
2 changed files with 8 additions and 1 deletions

View File

@@ -419,7 +419,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
async updateTask(
id: string,
updates: { title?: string; description?: string; prompt?: string; worktree?: string; status?: string | null; dependencies?: string[]; blockedBy?: string | null; paused?: boolean; baseBranch?: string; size?: "S" | "M" | "L"; reviewLevel?: number; mergeRetries?: number; modelProvider?: string | null; modelId?: string | null; validatorModelProvider?: string | null; validatorModelId?: string | null },
updates: { title?: string; description?: string; prompt?: string; worktree?: string; status?: string | null; dependencies?: string[]; blockedBy?: string | null; paused?: boolean; baseBranch?: string; size?: "S" | "M" | "L"; reviewLevel?: number; mergeRetries?: number; modelProvider?: string | null; modelId?: string | null; validatorModelProvider?: string | null; validatorModelId?: string | null; error?: string | null },
): Promise<Task> {
return this.withTaskLock(id, async () => {
const dir = this.taskDir(id);
@@ -487,6 +487,11 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
} else if (updates.validatorModelId !== undefined) {
task.validatorModelId = updates.validatorModelId;
}
if (updates.error === null) {
task.error = undefined;
} else if (updates.error !== undefined) {
task.error = updates.error;
}
task.updatedAt = new Date().toISOString();
await this.atomicWriteTaskJson(dir, task);

View File

@@ -151,6 +151,8 @@ export interface Task {
/** ISO-8601 timestamp of when the task last entered its current column.
* Used to sort cards within a column so that recently-moved cards appear at the top. */
columnMovedAt?: string;
/** Error message from the last failure, if the task failed during execution */
error?: string;
createdAt: string;
updatedAt: string;
}