pub struct CopilotHeadlessRunner { /* private fields */ }Expand description
GitHub Copilot Headless (ACP) LLM provider.
Communicates with copilot --acp via the Agent Client Protocol (JSON-RPC over stdio).
Spawns a new copilot subprocess per request using NDJSON framing.
Uses types from agent-client-protocol-schema for protocol message deserialization.
Copilot manages its own tool execution internally (GitHub tools, code search),
but cannot execute external MCP tools. Tool calls are observed and reported
via HeadlessToolResponse from converse().
For custom tools, callers should use text-based tool calling (CLI tool loop).
Implementations§
Source§impl CopilotHeadlessRunner
impl CopilotHeadlessRunner
Sourcepub async fn from_env() -> Self
pub async fn from_env() -> Self
Create a new provider from environment configuration.
Attempts to discover available models via gh copilot models.
Falls back to a static list if discovery fails.
Sourcepub async fn with_config(config: CopilotHeadlessConfig) -> Self
pub async fn with_config(config: CopilotHeadlessConfig) -> Self
Create a new provider with explicit configuration.
Sourcepub async fn converse(
&self,
request: &ChatRequest,
) -> Result<HeadlessToolResponse, RunnerError>
pub async fn converse( &self, request: &ChatRequest, ) -> Result<HeadlessToolResponse, RunnerError>
Run a conversation turn and return detailed results including tool call metadata.
Unlike complete(), this returns an HeadlessToolResponse
with observed tool calls that copilot executed internally during the turn.
Trait Implementations§
Source§impl LlmProvider for CopilotHeadlessRunner
impl LlmProvider for CopilotHeadlessRunner
Source§fn display_name(&self) -> &str
fn display_name(&self) -> &str
Source§fn capabilities(&self) -> LlmCapabilities
fn capabilities(&self) -> LlmCapabilities
Source§fn default_model(&self) -> &str
fn default_model(&self) -> &str
Source§fn available_models(&self) -> &[String]
fn available_models(&self) -> &[String]
Source§fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, RunnerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, RunnerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn complete_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatStream, RunnerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatStream, RunnerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, RunnerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, RunnerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for CopilotHeadlessRunner
impl RefUnwindSafe for CopilotHeadlessRunner
impl Send for CopilotHeadlessRunner
impl Sync for CopilotHeadlessRunner
impl Unpin for CopilotHeadlessRunner
impl UnsafeUnpin for CopilotHeadlessRunner
impl UnwindSafe for CopilotHeadlessRunner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more