Objective: Integrate the official GitHub Copilot SDK to provide native, streaming LLM capabilities with proper session management and tool bridging.
- Analyze
copilot-sdk/goarchitecture and types - Ensure
copilotCLI is detectable/installable (graceful fallback if missing)
-
Create
internal/copilot/package-
provider.go- Implementmodel.Providerinterface wrapping SDK -
bridge.go- Bridge VibeAuracletooling.Tool→ Copilot SDKTool -
events.go- Handle streaming events (assistant.message_delta, etc.) -
mcp.go- Bridge for Model Context Protocol servers
-
-
Add SDK dependency
- Add
github.com/github/copilot-sdk/goto workspace (internal/copilot-sdk-go) - Configure local replace directive pointing to
./internal/copilot-sdk-go
- Add
-
Graceful Detection
- Check if
copilotCLI exists in PATH - Fall back to existing
langchaingoOpenAI provider if missing - Log clear message about degraded mode
- Check if
-
Wire into Cognitive Loop
- Import copilot package in brain
- Auto-select
copilot-sdkwhen CLI available and gh auth present - Dual generation path (SDK or standard model)
- Graceful shutdown via
Brain.Shutdown()
-
System Message Customization
- Use
SystemMessageConfig.Mode = "append"to inject VibeAuracle personality - Preserve SDK guardrails while adding our prompt layers
- Use
-
Export VibeAuracle Tools to Copilot
- Convert
tooling.ToolMetadata→copilot.Tool - Auto-generate JSON schema from our
Parametersfield - Implement
ToolHandlerthat routes to ourTool.Execute() - Register core tools with SDK on startup
- Convert
-
Bi-directional Tool Awareness
- Allow Copilot's native tools (file, bash, etc.) to coexist
- Use
AvailableTools/ExcludedToolsfor fine-grained control
-
Replace Blocking Generation
- Use
session.On()event handler for callbacks - Emit
assistant.message_deltato provider callbacks - Handle
session.idleto know when response is complete
- Use
-
TUI Integration
- Add
streamDeltaMsgandstreamDoneMsgmessage types - Add streaming content state to model struct
- Real-time viewport updates with cursor indicator
- Add
- Custom Provider Passthrough
- Add
ProviderOptionsstruct with BYOK fields - Check vault for
openai_api_keyandanthropic_api_key - Configure
sdk.ProviderConfigwith custom credentials - Allow
BaseURLoverride for local models (Ollama via OpenAI-compat)
- Add
- Model Context Protocol
- Create
MCPBridgeininternal/copilot/mcp.go - Support local/stdio and remote HTTP/SSE servers
-
RegisterMCPServers()for SDK session config - Common MCP server presets (filesystem, github, memory)
- Create
✅ Phase 1 Complete - Foundation SDK provider with streaming and tool bridge ✅ Phase 2 Complete - Brain integration with dual-path generation ✅ Phase 3 Complete - Core tools registered with Copilot SDK ✅ Phase 4 Complete - Streaming events and TUI integration ✅ Phase 5 Complete - BYOK support for OpenAI/Anthropic/Ollama ✅ Phase 6 Complete - MCP server bridge
✅ internal/copilot - builds successfully
✅ internal/brain - builds successfully
✅ internal/model - builds successfully
✅ cmd/vibeaura - builds successfully
internal/copilot/provider.go- Main SDK provider with BYOKinternal/copilot/bridge.go- VibeAuracle tool → SDK tool bridgeinternal/copilot/events.go- Event routing for streaminginternal/copilot/mcp.go- MCP server integrationinternal/brain/brain.go- Dual-path generation, tool registrationcmd/vibeaura/chat.go- TUI streaming support