pub struct CopilotHeadlessConfig {
pub cli_path: Option<PathBuf>,
pub working_directory: Option<PathBuf>,
pub model: String,
pub github_token: Option<String>,
pub permission_policy: PermissionPolicy,
pub max_history_turns: usize,
pub mcp_tool_calling: bool,
}Expand description
Configuration for the Copilot Headless (ACP) provider.
Fields§
§cli_path: Option<PathBuf>Override path to the copilot CLI binary (default: auto-detect via PATH).
working_directory: Option<PathBuf>Directory every copilot --acp subprocess runs in and the cwd of every
session it serves. Copilot treats that directory as the project — it
loads .mcp.json, agent files and custom instructions from it — so a
host that sets this hands the model that project. A relative path is
anchored to the host’s cwd. Unset, the runner uses a scratch directory
under the system temp dir, not the host process’s working directory.
model: StringDefault model to use for completions.
github_token: Option<String>GitHub token for authentication (optional, uses stored OAuth by default).
permission_policy: PermissionPolicyPolicy for handling permission requests from the copilot subprocess.
max_history_turns: usizeMaximum number of prior conversation messages (user + assistant) to include in the ACP prompt for multi-turn context. Set to 0 to disable history injection.
mcp_tool_calling: boolAdvertise SDK_TOOL_CALLING so callers route tool turns through the
ACP converse() loop with per-request MCP servers (native tool
calling), instead of falling through to text-based <tool_call>
parsing. The caller must pass mcp_servers on each request for tools
to be reachable. Default: false.
Implementations§
Source§impl CopilotHeadlessConfig
impl CopilotHeadlessConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Create configuration from environment variables.
Environment variables:
COPILOT_CLI_PATH— Override path to copilot binaryCOPILOT_HEADLESS_WORKING_DIR— Directory the subprocess and its sessions run in (default: a scratch directory under the system temp dir)COPILOT_HEADLESS_MODEL— Default model (defaults to the top-ranked candidate incrate::copilot_models::CATALOG)COPILOT_GITHUB_TOKEN/GH_TOKEN/GITHUB_TOKEN— GitHub auth tokenCOPILOT_HEADLESS_MAX_HISTORY_TURNS— Max conversation history turns (default: 20)COPILOT_HEADLESS_MCP_TOOL_CALLING— AdvertiseSDK_TOOL_CALLINGfor native ACP MCP tool calling (default: false)