Implementation:0xsline OpenChatCut Copilot Agent Plugin
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Agent, Copilot, HTTP |
| Last Updated | 2026-10-22 14:00 GMT |
Overview
Copilot agent plugin that manages GitHub Copilot SDK turns, model listing, and tool result settlement via HTTP endpoints.
Description
The Copilot Agent Plugin provides HTTP endpoints for GitHub Copilot agent integration. It manages model listing, turn streaming, and tool result submission (up to 32MB). Uses `runCopilotTurn` for turn lifecycle, `inspectCopilotInstallation` for CLI version checks, and `readCopilotAuth` for authentication status.
Usage
- Agent turns: HTTP streaming endpoint for starting Copilot conversation turns.
- Model listing: Query available Copilot models for the UI.
Code Reference
Source Location
- Repository: OpenChatCut
- File: server/plugins/copilot-agent.ts
- Lines: 1-346
Signature
export const copilotAgentPlugin: Plugin;
// Endpoints:
// GET /api/copilot/status → installation + auth status
// GET /api/copilot/models → list available models
// POST /api/copilot/turn → start streaming turn
// POST /api/copilot/tool-result → settle tool call result
Import
import { copilotAgentPlugin } from './plugins/copilot-agent.ts';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| request | CopilotTurnRequest | Yes | Turn prompt and context |
| result | CopilotToolResultRequest | Yes | Tool result for settlement |
Outputs
| Name | Type | Description |
|---|---|---|
| status | CopilotAgentStatus | Installation and auth state |
| models | CopilotAgentModelsResponse | Available Copilot models |
| stream | SSE | Server-sent events with CopilotTurnStreamEvent |
Usage Examples
Starting a Copilot Agent Turn
// POST /api/copilot/turn
// Body: { prompt: "Edit clip 1", tools: [...] }
// Response: SSE stream of CopilotTurnStreamEvent
Related Pages
Implements Principle
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment