fix(acp): add missing await for async isToolEnabled in Session.runTool

PermissionManager.isToolEnabled was changed to async in this PR but the
call site in Session.runTool was not updated, causing the Promise to be
evaluated as a truthy value and the L1 tool-enablement check to always
pass — effectively disabling permission denial in the ACP session path.
This commit is contained in:
LaZzyMan 2026-03-27 10:37:20 +08:00
parent 585bce06d2
commit cb97bf6068

View file

@ -590,7 +590,7 @@ export class Session implements SessionContext {
// ---- L1: Tool enablement check ----
const pm = this.config.getPermissionManager?.();
if (pm && !pm.isToolEnabled(fc.name as string)) {
if (pm && !(await pm.isToolEnabled(fc.name as string))) {
return earlyErrorResponse(
new Error(
`Qwen Code requires permission to use "${fc.name}", but that permission was declined.`,