diff --git a/src/cli/App.tsx b/src/cli/App.tsx index 47e6307..dd5a621 100644 --- a/src/cli/App.tsx +++ b/src/cli/App.tsx @@ -4413,6 +4413,33 @@ export default function App({ setStaticItems([separator, successItem]); setLines(toLines(buffersRef.current)); } + + // Restore pending approvals if any (fixes #540 for /resume command) + if (resumeData.pendingApprovals.length > 0) { + setPendingApprovals(resumeData.pendingApprovals); + + // Analyze approval contexts (same logic as startup) + try { + const contexts = await Promise.all( + resumeData.pendingApprovals.map(async (approval) => { + const parsedArgs = safeJsonParseOr< + Record + >(approval.toolArgs, {}); + return await analyzeToolApproval( + approval.toolName, + parsedArgs, + ); + }), + ); + setApprovalContexts(contexts); + } catch (approvalError) { + // If analysis fails, leave context as null (will show basic options) + console.error( + "Failed to analyze resume approvals:", + approvalError, + ); + } + } } } catch (error) { const errorCmdId = uid("cmd"); @@ -7516,6 +7543,35 @@ Plan file path: ${planFilePath}`; setStaticItems([separator, successItem]); setLines(toLines(buffersRef.current)); } + + // Restore pending approvals if any (fixes #540 for ConversationSelector) + if (resumeData.pendingApprovals.length > 0) { + setPendingApprovals(resumeData.pendingApprovals); + + // Analyze approval contexts (same logic as startup) + try { + const contexts = await Promise.all( + resumeData.pendingApprovals.map( + async (approval) => { + const parsedArgs = safeJsonParseOr< + Record + >(approval.toolArgs, {}); + return await analyzeToolApproval( + approval.toolName, + parsedArgs, + ); + }, + ), + ); + setApprovalContexts(contexts); + } catch (approvalError) { + // If analysis fails, leave context as null (will show basic options) + console.error( + "Failed to analyze resume approvals:", + approvalError, + ); + } + } } } catch (error) { const errorCmdId = uid("cmd");