fix(workflow): Add user choice for session completion and sync task status on archive

- Replace auto-complete with AskUserQuestion in execute.md Phase 5
  - User can choose "Enter Review" or "Complete Session"
- Fix archived tasks showing incomplete on dashboard
  - executeArchive now updates all .task/*.json status to completed
This commit is contained in:
catlog22
2026-01-03 11:36:20 +08:00
parent 4fb247f7c5
commit 255d4244ea
2 changed files with 48 additions and 5 deletions

View File

@@ -696,6 +696,23 @@ function executeArchive(params: Params): any {
} catch { /* continue */ }
}
}
// Update all task JSONs to completed status
const taskDir = join(session.path, '.task');
if (existsSync(taskDir)) {
const taskFiles = readdirSync(taskDir).filter(f => f.endsWith('.json'));
for (const taskFile of taskFiles) {
try {
const taskPath = join(taskDir, taskFile);
const taskData = readJsonFile(taskPath);
if (taskData.status && taskData.status !== 'completed') {
taskData.status = 'completed';
taskData.completed_at = new Date().toISOString();
writeJsonFile(taskPath, taskData);
}
} catch { /* skip invalid task files */ }
}
}
}
// Ensure archive directory exists