Skip to content

Commit 4f363b7

Browse files
eedorenkoclaude
andcommitted
fix: add request_permission to _ACPJudgeClient
_ACPJudgeClient was missing the request_permission() callback, causing "Method not found" ACP errors when the Copilot CLI was started with --deny-tool flags. Mirrors the existing implementation in _EvalClient. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent a3937cf commit 4f363b7

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

python/src/beval/judge.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,32 @@ async def session_update(
430430
if isinstance(update.content, TextContentBlock):
431431
self.chunks.append(update.content.text)
432432

433+
async def request_permission(
434+
self,
435+
options: Any,
436+
session_id: str, # noqa: ARG002
437+
tool_call: Any, # noqa: ARG002
438+
**kwargs: Any, # noqa: ARG002
439+
) -> Any:
440+
"""Auto-approve all permission requests during evaluation."""
441+
try:
442+
from acp.schema import AllowedOutcome, RequestPermissionResponse # noqa: I001
443+
except ImportError:
444+
return None
445+
446+
chosen_id = options[0].option_id if options else "allow_once"
447+
for opt in options or []:
448+
if "allow" in (getattr(opt, "kind", "") or "").lower():
449+
chosen_id = opt.option_id
450+
break
451+
452+
return RequestPermissionResponse(
453+
outcome=AllowedOutcome(
454+
outcome="selected",
455+
option_id=chosen_id,
456+
),
457+
)
458+
433459

434460
class ACPJudge(Judge):
435461
"""ACP-backed judge that invokes any ACP agent as a judge. See §14.2.

0 commit comments

Comments
 (0)