Creates a new HalClient instance for low-level ACP communication.
Most users should use hal_chat() instead.
Usage
hal_client(
model = NULL,
cli_path = NULL,
permission_policy = "auto-allow",
on_text = NULL,
on_tool_call = NULL,
on_thought = NULL,
quiet = FALSE
)Arguments
- model
Model identifier (e.g.,
"claude-sonnet-5","gpt-5.2"). Passed as--modelto the CLI at startup. IfNULL, falls back to theCOPILOT_MODELenvironment variable, then the server default.- cli_path
Path to the Copilot CLI binary. If
NULL, searchesPATHand common install locations.- permission_policy
How to handle tool permission requests:
"auto-allow"(default) auto-approves,"auto-deny"auto-denies,"ask"prompts interactively (vscode backend only), or a function receiving permission params. The function returns an ACP option id on copilot, or a string containing"allow"/"deny"on vscode/claude.- on_text
Callback for streaming text chunks:
function(chunk).- on_tool_call
Callback for tool call events:
function(tool_call).- on_thought
Callback for thought chunks:
function(chunk).- quiet
Logical; suppress informational messages (default
FALSE).
Value
A HalClient object.
