Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
[github] Add Github Copilot
Jeroen Evensb161fa4f9a75
diff --git a/nanobot/cli/commands.py b/nanobot/cli/commands.pyindex 5280d0f88..ff3493a16 100644--- a/nanobot/cli/commands.py+++ b/nanobot/cli/commands.py@@ -892,7 +892,9 @@ def status():p = getattr(config.providers, spec.name, None)if p is None:continue- if spec.is_local:+ if spec.is_oauth:+ console.print(f"{spec.label}: [green]✓ (OAuth)[/green]")+ elif spec.is_local:# Local deployments show api_base instead of api_keyif p.api_base:console.print(f"{spec.label}: [green]✓ {p.api_base}[/green]")diff --git a/nanobot/config/schema.py b/nanobot/config/schema.pyindex 76ec74dc1..99c659cc1 100644--- a/nanobot/config/schema.py+++ b/nanobot/config/schema.py@@ -298,7 +298,9 @@ class Config(BaseSettings):if spec.is_oauth:continuep = getattr(self.providers, spec.name, None)- if p and p.api_key:+ if p is None:+ continue+ if p.api_key:return p, spec.namereturn None, Nonediff --git a/nanobot/providers/litellm_provider.py b/nanobot/providers/litellm_provider.pyindex 8cc4e3599..43dfbb58d 100644--- a/nanobot/providers/litellm_provider.py+++ b/nanobot/providers/litellm_provider.py@@ -38,6 +38,9 @@ class LiteLLMProvider(LLMProvider):# api_key / api_base are fallback for auto-detection.self._gateway = find_gateway(provider_name, api_key, api_base)+ # Detect GitHub Copilot (uses OAuth device flow, no API key)+ self.is_github_copilot = "github_copilot" in default_model+# Configure environment variablesif api_key:self._setup_env(api_key, api_base, default_model)@@ -76,6 +79,10 @@ class LiteLLMProvider(LLMProvider):def _resolve_model(self, model: str) -> str:"""Resolve model name by applying provider/gateway prefixes."""+ # GitHub Copilot models pass through directly+ if self.is_github_copilot:+ return model+if self._gateway:# Gateway mode: apply gateway prefix, skip provider-specific prefixesprefix = self._gateway.litellm_prefix