fix(ext,bot): Accept All WS regression + auto_approve dual-write — VSIX v0.4.5
This commit is contained in:
@@ -402,9 +402,27 @@ async function activate(context) {
|
||||
wsBridge = new ws_client_1.WSBridgeClient(hubUrl, regCode, projectName, pcName, {
|
||||
onResponse: (data) => {
|
||||
logToFile(`[WS-RESPONSE] ${data.request_id?.substring(0, 12)} approved=${data.approved} step_type=${data.step_type || '(none)'}`);
|
||||
// Direct approval — WS path has no pending file, so call tryApprovalStrategies directly
|
||||
const approved = data.approved ?? true;
|
||||
const stepType = data.step_type || '';
|
||||
// ── diff_review: Accept all / Reject all (REGRESSION FIX) ──
|
||||
// Previously only handled in processResponseFile (file-bridge path).
|
||||
// WS path was missing this logic entirely, causing Accept All to fail.
|
||||
if (stepType === 'diff_review') {
|
||||
logToFile(`[WS-RESPONSE] diff_review detected — routing to handleDiffReviewResponse`);
|
||||
(0, step_probe_1.handleDiffReviewResponse)({
|
||||
request_id: data.request_id,
|
||||
approved,
|
||||
button_index: data.button_index,
|
||||
step_type: stepType,
|
||||
})
|
||||
.then(result => {
|
||||
logToFile(`[WS-RESPONSE] diff_review result: ${result}`);
|
||||
(0, step_probe_1.resetPendingState)();
|
||||
})
|
||||
.catch(err => logToFile(`[WS-RESPONSE] diff_review error: ${err.message}`));
|
||||
return;
|
||||
}
|
||||
// Normal approval — tryApprovalStrategies
|
||||
const approvalCtx = (0, step_probe_1.getApprovalContext)();
|
||||
logToFile(`[WS-RESPONSE] Triggering approval: approved=${approved} session=${approvalCtx.sessionId.substring(0, 8)} stepType=${stepType} stepIndex=${approvalCtx.stepIndex}`);
|
||||
(0, step_probe_1.tryApprovalStrategies)(approved, approvalCtx.sessionId, stepType, approvalCtx.stepIndex)
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user