UNPKG

aetherlight

Version:

Voice-to-intelligence platform for developers. Voice capture, sprint planning with AI, bug/feature forms, pattern matching to prevent AI hallucinations.

117 lines 4.69 kB
"use strict"; /** * Error Recovery Prompts - Handle task failures (AS-024) * * DESIGN DECISION: Offer recovery options when tasks fail * WHY: Agent failures shouldn't halt entire sprint, user can intervene * * REASONING CHAIN: * 1. API-001 task fails (agent encounters error) * 2. Error recovery prompt shows: * - Error message * - Files that were being modified * - Recovery options (retry, skip, manual fix, abort) * 3. User chooses "Manual Fix" * 4. Sprint pauses, user fixes issue manually * 5. User resumes → Task marked complete, dependent tasks start * 6. Result: Sprint recovers from failures without full restart * * PATTERN: Pattern-APPROVAL-003 (Error Recovery) * RELATED: AS-024 (Error Recovery Prompts) */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.ErrorRecoveryPrompt = exports.RecoveryAction = void 0; const vscode = __importStar(require("vscode")); var RecoveryAction; (function (RecoveryAction) { RecoveryAction["RETRY"] = "RETRY"; RecoveryAction["SKIP"] = "SKIP"; RecoveryAction["MANUAL_FIX"] = "MANUAL_FIX"; RecoveryAction["ABORT"] = "ABORT"; })(RecoveryAction || (exports.RecoveryAction = RecoveryAction = {})); class ErrorRecoveryPrompt { /** * Show error recovery prompt * * @param signal - Failed task completion signal */ async show(signal) { const message = this.formatErrorMessage(signal); const choice = await vscode.window.showErrorMessage(`Task ${signal.task_id} Failed`, { modal: true, detail: message }, 'Retry', 'Skip Task', 'Fix Manually', 'Abort Sprint'); switch (choice) { case 'Retry': return { action: RecoveryAction.RETRY }; case 'Skip Task': const skipReason = await vscode.window.showInputBox({ prompt: 'Why are you skipping this task?', placeHolder: 'e.g., Not critical, will fix later', }); return { action: RecoveryAction.SKIP, reason: skipReason || 'User skipped', }; case 'Fix Manually': vscode.window.showInformationMessage('Sprint paused. Fix the issue manually, then click Resume Sprint.'); return { action: RecoveryAction.MANUAL_FIX }; case 'Abort Sprint': return { action: RecoveryAction.ABORT, reason: 'User aborted sprint', }; default: return { action: RecoveryAction.ABORT, reason: 'User canceled', }; } } formatErrorMessage(signal) { let message = `Error: ${signal.error || 'Unknown error'}\n\n`; message += `Agent: ${signal.agent_type}\n`; message += `Task: ${signal.task_id}\n\n`; if (signal.files_changed.length > 0) { message += `Files Modified Before Failure:\n`; signal.files_changed.forEach(file => { message += ` - ${file}\n`; }); message += `\n`; } message += `How would you like to proceed?`; return message; } } exports.ErrorRecoveryPrompt = ErrorRecoveryPrompt; //# sourceMappingURL=error_recovery.js.map