createCopilotHarness
Purpose and behavior
Section titled “Purpose and behavior”Create the GitHub Copilot CLI preset without starting the CLI; createAgent({ harness, model }) binds it and rejects reasoning and maxOutputTokens. It captures and resumes session bundles, accepts acknowledged steering through its native RPC server, and rejects fork. Native hooks, MCP servers or leases without live input use interruption/resume. Usage is reported per message, then as a session total read after exit.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”settingsOptionalCopilotSettings | undefinedGitHub Copilot CLI settings; model, reasoning and maxOutputTokens belong on createAgent() and are rejected here.settings.hooksOptionalreadonly CopilotHook<keyof CopilotHookEvents>[] | undefinedNative Copilot hooks declared with defineCopilotHook. The collection is copied at composition; callbacks require live process input on the sandbox lease.settings.authenticationOptionalAgentAuthentication | undefinedAccount forms only: “account” forwards the token that copilot login stored in ~/.copilot/config.json as COPILOT_GITHUB_TOKEN, key or variable forward a fine-grained token. Usage forms fail when the agent is composed, and classic ghp_ tokens are rejected.settings.variablesOptionalReadonly<Record<string, string>> | undefinedEnvironment variables for Copilot commands, merged over .outpost/.env; COPILOT_AUTO_UPDATE defaults to false. A name also set by the sandbox provider fails with code configuration.settings.conversationsOptionalConversationStore | undefinedStore that captures, locates and restores Copilot session bundles instead of the default native store, such as createTransportConversations(createCopilotConversations(), …). A store that declares another format is rejected when the harness is created.settings.mcpServersOptionalMcpServers | undefinedMCP servers passed to Copilot with —additional-mcp-config for each run, keyed by server name. Secrets stay ${NAME} references expanded by Copilot; each referenced variable must be declared.settings.profileOptionalAgentProfile | undefinedPortable declaration from defineAgentProfile(), projected into Copilot CLI requests. MCP servers merge with mcpServers and duplicate names fail at harness creation. Copilot CLI refuses any built-in tool allowlist at createAgent().

