fix(ext): WS response → tryApprovalStrategies 직접 호출 (파일 경유 제거)

This commit is contained in:
Variet Worker
2026-03-17 17:43:45 +09:00
parent adbed69237
commit 2eea5fa638
4 changed files with 46 additions and 27 deletions

View File

@@ -41,6 +41,26 @@ const lastSeenStep = new Map<string, number>();
const lastSnapshotText = new Map<string, string>();
const registeredSessions = new Set<string>(); // track which sessions have been registered
/**
* Get current approval context for WS response routing.
* Used by extension.ts onResponse handler to call tryApprovalStrategies.
*/
export function getApprovalContext(): { sessionId: string; stepIndex: number } {
return {
sessionId: ctx.activeSessionId || '',
stepIndex: ctx.lastPendingStepIndex ?? -1,
};
}
/**
* Reset pending state after successful approval.
* Called after WS response triggers approval in extension.ts.
*/
export function resetPendingState(): void {
ctx.stallProbed = false;
ctx.sawRunningAfterPending = false;
}
/**
* Write a registration file for the Bot to discover session → project mapping.
* Called automatically on first step event per session.