* feat(github-copilot-sdk): add workspace skills support - Introduce ENABLE_WORKSPACE_SKILLS valve to enable/disable workspace custom tools discovery - Modify _build_session_config() to auto-load tools from .copilot-skills/ directory - Add workspace_skills_example.py template with 3 working example tools - Update README.md and README_CN.md with Workspace Skills guide and usage examples - Create v0.9.0.md and v0.9.0_CN.md release notes - Sync version to all docs files (index.md, index.zh.md, and main docs) - Bump version from 0.8.0 to 0.9.0 across all 7+ locations * docs: establish temp files handling policy (project-based, not /tmp) - Add TEMP_FILES_POLICY.md guideline for all skills and workflows - Update pr-submitter skill to use .temp/ directory instead of /tmp - Update release-prep skill documentation with temp file convention - Add .temp/ and .build/ entries to .gitignore - Create internal policy memo in /memories/repo/ This policy ensures: - All temporary files stay within project workspace (not system /tmp) - Alignment with OpenWebUI workspace isolation principles - Multi-user safety and cleanup traceability - Consistent handling across all skills and development workflows * fix(terminology): rename 'workspace skills' to 'workspace custom tools' for accuracy The term 'Skills' in Anthropic context refers to instruction-based frameworks (SKILL.md files with YAML frontmatter + markdown), not custom tool functions. Our implementation uses @define_tool decorator to define custom tools that the SDK auto-discovers from .copilot-skills/ directory. These are Tools, not Skills. Changes: - Rename ENABLE_WORKSPACE_SKILLS valve -> ENABLE_WORKSPACE_TOOLS - Update all documentation (README, README_CN, docs, release notes) - Fix section headings and descriptions throughout - Ensure consistent terminology across all files This is a terminology-only change; functionality remains identical. * feat(pipes): release v0.9.0 of GitHub Copilot SDK Pipe - Integrated OpenWebUI Skills Bridge and manage_skills tool - Reinforced status bar stability with session_finalized logic - Added persistent SDK config directory support * docs(pipes): add comprehensive guides and v0.9.0 notes for Copilot SDK - Added skill manager and best practices guides - Added publishing tool documentation - Included v0.9.0 release notes and deployment script - Updated usage guides
205 lines
13 KiB
Markdown
205 lines
13 KiB
Markdown
# GitHub Copilot SDK Pipe for OpenWebUI
|
|
|
|
**Author:** [Fu-Jie](https://github.com/Fu-Jie) | **Version:** 0.9.0 | **Project:** [OpenWebUI Extensions](https://github.com/Fu-Jie/openwebui-extensions) | **License:** MIT
|
|
|
|
This is an advanced Pipe function for [OpenWebUI](https://github.com/open-webui/open-webui) that integrates the official [GitHub Copilot SDK](https://github.com/github/copilot-sdk). It enables you to use **GitHub Copilot models** (e.g., `gpt-5.2-codex`, `claude-sonnet-4.5`,`gemini-3-pro`, `gpt-5-mini`) **AND** your own models via **BYOK** (OpenAI, Anthropic) directly within OpenWebUI, providing a unified agentic experience with **strict User & Chat-level Workspace Isolation**.
|
|
|
|
> [!IMPORTANT]
|
|
> **Essential Companion**
|
|
> To unlock file handling and data analysis capabilities, you must install the [GitHub Copilot SDK Files Filter](https://openwebui.com/posts/403a62ee-a596-45e7-be65-fab9cc249dd6).
|
|
|
|
> [!TIP]
|
|
> **No Subscription Required for BYOK**
|
|
> If you are using your own API keys (BYOK mode with OpenAI/Anthropic), **you do NOT need a GitHub Copilot subscription.** A subscription is only required to access GitHub's official models.
|
|
|
|
---
|
|
|
|
## ✨ v0.9.0: The Skills Revolution & Stability Update
|
|
|
|
- **🧩 Copilot SDK Skills Support**: Native support for Copilot SDK skill directories (`SKILL.md` + resources).
|
|
- **🔄 OpenWebUI Skills Bridge**: Full bidirectional sync between OpenWebUI Workspace > Skills and SDK skill directories.
|
|
- **🛠️ Deterministic `manage_skills` Tool**: Expert tool for stable install/create/list/edit/delete skill operations.
|
|
- **🌊 Reinforced Status Bar**: Multi-layered locking mechanism (`session_finalized` guard) and atomic async delivery to prevent "stuck" indicators.
|
|
- **🗂️ Persistent Config Directory**: Added `COPILOTSDK_CONFIG_DIR` for stable session-state persistence across container restarts.
|
|
|
|
---
|
|
|
|
## ✨ Key Capabilities
|
|
|
|
- **🔑 Unified Intelligence (Official + BYOK)**: Seamlessly switch between official GitHub Copilot models (o1, GPT-4o, Claude 3.5 Sonnet, Gemini 2.0 Flash) and your own models (OpenAI, Anthropic) via **Bring Your Own Key** mode.
|
|
- **🛡️ Physical Workspace Isolation**: Every session runs in its own isolated directory sandbox. This ensures absolute data privacy and prevents cross-chat file contamination while allowing the Agent full filesystem access.
|
|
- **🔌 Universal Tool Protocol**:
|
|
- **Native MCP**: Direct, high-performance connection to Model Context Protocol servers.
|
|
- **OpenAPI Bridge**: Connect to any external REST API as an Agent tool.
|
|
- **OpenWebUI Native**: Zero-config bridge to your existing OpenWebUI tools and built-ins (Web Search, Memory, etc.).
|
|
- **🧩 OpenWebUI Skills Bridge**: Transforms simple OpenWebUI Markdown instructions into powerful SDK skill folders complete with supporting scripts, templates, and data.
|
|
- **♾️ Infinite Session Management**: Advanced context window management with automatic "Compaction" (summarization + list persistence). Carry out weeks-long projects without losing the core thread.
|
|
- **📊 Interactive Artifacts & Publishing**:
|
|
- **Live HTML/JS**: Instantly render and interact with apps, dashboards, or reports generated by the Agent.
|
|
- **Persistent Publishing**: Agents can "publish" generated files (Excel, CSV, docs) to OpenWebUI's file storage, providing permanent download links.
|
|
- **🌊 UX-First Streaming**: Full support for "Thinking" processes (Chain of Thought), status indicators, and real-time progress bars for long-running tasks.
|
|
- **🧠 Deep Database Integration**: Real-time persistence of TOD·O lists and session metadata ensures your workflow state is always visible in the UI.
|
|
|
|
---
|
|
|
|
## 🧩 Companion Files Filter (Required for raw files)
|
|
|
|
`GitHub Copilot SDK Files Filter` is the companion plugin that prevents OpenWebUI's default RAG pre-processing from consuming uploaded files before the Pipe receives them.
|
|
|
|
- **What it does**: Moves uploaded files to `copilot_files` so the Pipe can access raw binaries directly.
|
|
- **Why it matters**: Without it, uploaded files may be parsed/vectorized early and the Agent may lose direct raw-file access.
|
|
- **v0.1.3 highlights**:
|
|
- BYOK model-id matching fix (supports `github_copilot_official_sdk_pipe.xxx` prefixes).
|
|
- Optional dual-channel debug log (`show_debug_log`) to backend logger + browser console.
|
|
|
|
---
|
|
|
|
## ⚙️ Core Configuration (Valves)
|
|
|
|
### 1. Administrator Settings (Base)
|
|
|
|
Administrators define the default behavior for all users in the function settings.
|
|
|
|
| Valve | Default | Description |
|
|
| :--- | :--- | :--- |
|
|
| `GH_TOKEN` | `""` | Global GitHub Token (Requires 'Copilot Requests' permission). |
|
|
| `COPILOTSDK_CONFIG_DIR` | `""` | Persistent directory for SDK config and session state (e.g., `/app/backend/data/.copilot`). |
|
|
| `ENABLE_OPENWEBUI_TOOLS` | `True` | Enable OpenWebUI Tools (includes defined Tools and Built-in Tools). |
|
|
| `ENABLE_OPENAPI_SERVER` | `True` | Enable OpenAPI Tool Server connection. |
|
|
| `ENABLE_MCP_SERVER` | `True` | Enable Direct MCP Client connection (Recommended). |
|
|
| `ENABLE_OPENWEBUI_SKILLS` | `True` | Enable bidirectional sync with OpenWebUI Workspace > Skills. |
|
|
| `OPENWEBUI_SKILLS_SHARED_DIR` | `/app/backend/data/cache/copilot-openwebui-skills` | Shared cache directory for skills. |
|
|
| `GITHUB_SKILLS_SOURCE_URL` | `""` | Optional GitHub tree URL for batch skill import (e.g., anthropic/skills). |
|
|
| `DISABLED_SKILLS` | `""` | Comma-separated skill names to disable in SDK session. |
|
|
| `REASONING_EFFORT` | `medium` | Reasoning effort level: low, medium, high. |
|
|
| `SHOW_THINKING` | `True` | Show model reasoning/thinking process. |
|
|
| `INFINITE_SESSION` | `True` | Enable Infinite Sessions (automatic context compaction). |
|
|
| `MAX_MULTIPLIER` | `1.0` | Max allowed billing multiplier (0x for free models only). |
|
|
| `EXCLUDE_KEYWORDS` | `""` | Exclude models containing these keywords (comma separated). |
|
|
| `TIMEOUT` | `300` | Timeout for each stream chunk (seconds). |
|
|
| `BYOK_TYPE` | `openai` | BYOK Provider Type: `openai`, `anthropic`. |
|
|
| `BYOK_BASE_URL` | `""` | BYOK Base URL (e.g., <https://api.openai.com/v1>). |
|
|
| `BYOK_MODELS` | `""` | BYOK Model List (comma separated). Leave empty to fetch from API. |
|
|
| `CUSTOM_ENV_VARS` | `""` | Custom environment variables (JSON format). |
|
|
| `DEBUG` | `False` | Enable this to see detailed logs in your browser console. |
|
|
|
|
### 2. User Settings (Individual Overrides)
|
|
|
|
Standard users can override these settings in their individual Profile/Function settings.
|
|
|
|
| Valve | Description |
|
|
| :--- | :--- |
|
|
| `GH_TOKEN` | Use your personal GitHub Token. |
|
|
| `REASONING_EFFORT` | Individual reasoning effort preference. |
|
|
| `SHOW_THINKING` | Show model reasoning/thinking process. |
|
|
| `MAX_MULTIPLIER` | Maximum allowed billing multiplier override. |
|
|
| `EXCLUDE_KEYWORDS` | Exclude models containing these keywords. |
|
|
| `ENABLE_OPENWEBUI_SKILLS` | Enable loading all active OpenWebUI skills readable by you into SDK `SKILL.md` directories. |
|
|
| `GITHUB_SKILLS_SOURCE_URL` | Optional GitHub tree URL for batch skill import in your own session. |
|
|
| `DISABLED_SKILLS` | Comma-separated skill names to disable for your own session. |
|
|
| `BYOK_API_KEY` | Use your personal OpenAI/Anthropic API Key. |
|
|
|
|
---
|
|
|
|
### 📤 Enhanced Publishing & Interactive Components
|
|
|
|
The `publish_file_from_workspace` tool now uses a clearer delivery contract for production use:
|
|
|
|
- **Artifacts mode (`artifacts`, default)**: Agent returns `[Preview]` + `[Download]` and may output `html_embed` in a ```html block for direct chat rendering.
|
|
- **Rich UI mode (`richui`)**: Agent returns `[Preview]` + `[Download]` only; integrated preview is rendered automatically via emitter (no iframe block in message).
|
|
- **📄 PDF delivery safety rule**: Always output Markdown links only (`[Preview]` + `[Download]` when available). **Do not embed PDF via iframe/html blocks.**
|
|
- **⚡ Stable dual-channel publishing**: Keeps interactive viewing and persistent file download aligned across local/object-storage backends.
|
|
- **✅ Status integration**: Emits real-time publishing progress and completion feedback to the OpenWebUI status bar.
|
|
- **📘 Publishing Tool Guide (GitHub)**: [publish_file_from_workspace Guide](https://github.com/Fu-Jie/openwebui-extensions/blob/main/plugins/pipes/github-copilot-sdk/PUBLISH_FILE_FROM_WORKSPACE.md)
|
|
|
|
---
|
|
|
|
### 🧩 OpenWebUI Skills Bridge & `manage_skills` Tool
|
|
|
|
The SDK now features a bidirectional bridge with the OpenWebUI **Workspace > Skills** page:
|
|
|
|
- **🔄 Automatic Sync**: Skills created or updated in the OpenWebUI UI are automatically downloaded as `SKILL.md` folders into the SDK's shared cache on every request.
|
|
- **🛠️ `manage_skills` Tool**: The Agent can deterministically manage skills using this tool.
|
|
- `list`: List all installed skills and their descriptions.
|
|
- `install`: Install a skill from a GitHub URL (auto-normalized to archive link) or a direct `.zip`/`.tar.gz`.
|
|
- `create`: Create a new skill directory from context, writing `SKILL.md` and any extra resource files (scripts, templates).
|
|
- `edit`: Update an existing skill folder.
|
|
- `delete`: Atomically delete both the local directory and the linked OpenWebUI DB entry.
|
|
- **📁 Full Folder Support**: Unlike the single-markdown storage in OpenWebUI DB, the SDK loads the **entire folder** for each skill. This allows skills to carry binary scripts, data files, or complex templates alongside the core instructions.
|
|
- **🌐 Shared Persistent Cache**: Skills are stored in `OPENWEBUI_SKILLS_SHARED_DIR/shared/`, which is persistent across sessions and container restarts.
|
|
- **📚 Full Skill Docs (GitHub)**: [manage_skills Tool Guide](https://github.com/Fu-Jie/openwebui-extensions/blob/main/plugins/pipes/github-copilot-sdk/SKILLS_MANAGER.md) | [Skills Best Practices](https://github.com/Fu-Jie/openwebui-extensions/blob/main/plugins/pipes/github-copilot-sdk/SKILLS_BEST_PRACTICES.md)
|
|
|
|
---
|
|
|
|
### 🌊 Fluid UX & Granular Status Feedback
|
|
|
|
Say goodbye to the "stuck" feeling during complex processing:
|
|
|
|
- **🔄 Real-Time Status Bubbles**: Maps internal SDK events (`turn_start`, `compaction`, `subagent_started`) directly to the OpenWebUI status bar.
|
|
- **🧭 Richer Stage Descriptions**: Status text now explicitly reflects phases such as processing, skill invocation, tool execution, tool completion/failure, publishing, and final completion.
|
|
- **⏱️ Long-Task Heartbeat**: During long waits, the status bar emits periodic "still processing" updates (elapsed-time style) to avoid silent stalls.
|
|
- **📈 Tool Progress Tracking**: Long-running tool executions provide live progress percentages and descriptive sub-task updates in the status bar.
|
|
- **⚡ Immediate Feedback**: Response starts with an instant "Assistant is processing" status, eliminating idle wait time before the first token.
|
|
|
|
---
|
|
|
|
### 🛡️ Smart Version Compatibility
|
|
|
|
The plugin automatically adapts its feature set based on your OpenWebUI version:
|
|
|
|
- **v0.8.0+**: Rich UI, live status bubbles, and integrated HTML preview.
|
|
- **Older**: Automatic fallback to standard Markdown blocks for maximum stability.
|
|
|
|
---
|
|
|
|
## 🎯 Use Cases (What can you do?)
|
|
|
|
- **📁 Fully Autonomous DevOps**: Agent analyzes code, runs tests, and applies patches within its isolated sandbox.
|
|
- **📊 Deep Data Auditing**: Directly process raw Excel/CSV data via Python (bypassing RAG) and generate visual reports.
|
|
- **📝 Long-Task Management**: Automatically decomposes complex requests and persists TOD·O progress across sessions.
|
|
|
|
---
|
|
|
|
## ⭐ Support
|
|
|
|
If this plugin has been useful, a **Star** on [OpenWebUI Extensions](https://github.com/Fu-Jie/openwebui-extensions) would be a great motivation for me. Thank you!
|
|
|
|
---
|
|
|
|
## 🚀 Installation & Configuration
|
|
|
|
### 1) Import Function
|
|
|
|
1. Open OpenWebUI, go to **Workspace** -> **Functions**.
|
|
2. Click **+** (Create Function), paste the content of `github_copilot_sdk.py`.
|
|
3. Save and ensure it is enabled.
|
|
|
|
### 2) Get Token
|
|
|
|
1. Visit [GitHub Token Settings](https://github.com/settings/tokens?type=beta).
|
|
2. Create **Fine-grained token**, granting **Account permissions** -> **Copilot Requests** access.
|
|
3. Paste the generated Token into the `GH_TOKEN` field in Valves.
|
|
|
|
### 3) Authentication Requirement (Mandatory)
|
|
|
|
You MUST configure **at least one** credential source:
|
|
|
|
- `GH_TOKEN` (GitHub Copilot subscription route), or
|
|
- `BYOK_API_KEY` (OpenAI/Anthropic route).
|
|
|
|
If neither is configured, the model list will not appear.
|
|
|
|
---
|
|
|
|
## 📋 Troubleshooting & Dependencies
|
|
|
|
- **Agent ignores files?**: Ensure the Files Filter is enabled, otherwise RAG will interfere with raw binaries.
|
|
- **No status updates?**: Status bubbles are emitted for processing/tool phases; TODO progress bars specifically appear when the Agent uses `update_todo`.
|
|
- **Dependencies**: This Pipe automatically manages `github-copilot-sdk` (Python) and utilizes the bundled binary CLI. No manual install required.
|
|
|
|
---
|
|
|
|
## Changelog
|
|
|
|
See the full history on GitHub: [OpenWebUI Extensions](https://github.com/Fu-Jie/openwebui-extensions)
|