Skip to content

Commit f247f1a

Browse files
ndemiancCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent fab9021 commit f247f1a

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

extensions/levelcode-ai/extension.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,13 +1389,14 @@ class ChatViewProvider {
13891389
case 'send': await handleSend(msg.text); break;
13901390
case 'stop': dbg('stop.clicked', { running: commandStops.size }); for (const [, stop] of commandStops) { try { stop(); } catch (e) { /* gone */ } } if (abort) { abort.abort(); } clearApprovals(); clearQuestions(); break;
13911391
case 'stopCommand': { dbg('stopCommand', { id: msg.id }); const s = commandStops.get(msg.id); if (s) { try { s(); } catch (e) { /* gone */ } } break; }
1392-
case 'approvalResponse':
1393-
// "Always allow" on an MCP card persists the tool to the allow-list BEFORE resolving, so a
1394-
// future run skips the prompt. It only ever adds an ALLOW (never a broadening default), and
1395-
// the webview offers it only for non-destructive tools — mcpAllowAlways re-checks anyway.
1396-
if (msg.approved && msg.remember && msg.mcpName) { await mcpAllowAlways(msg.mcpName); }
1392+
case 'approvalResponse': {
1393+
// Persisting "Always allow" should not block the approved tool call.
1394+
if (msg.approved && msg.remember && msg.mcpName) {
1395+
Promise.resolve(mcpAllowAlways(msg.mcpName)).catch(() => { /* best-effort */ });
1396+
}
13971397
resolveApproval(msg.id, msg.approved);
13981398
break;
1399+
}
13991400
case 'questionsResponse': resolveQuestions(msg.id, msg.answers, msg.notes); break;
14001401
case 'accountSignIn': await accountSignIn(msg.provider, msg.create); break;
14011402
case 'accountSignOut': await accountSignOut(); break;

0 commit comments

Comments
 (0)