GitHub Copilot
Give GitHub Copilot OpenViking context across projects and sessions. After installation, OpenViking Hooks inject relevant context (memories, resources and skills) at session start and before each request, then capture new conversation turns after the response. MCP is available for explicit memory search, reading, and management.
This integration is verified with Copilot CLI 1.0.119 on Linux. GitHub documents that VS Code and the GitHub Copilot app share the CLI's hook format, but they have not been tested with this integration.
Install
Prerequisites: macOS or Linux, Node.js 18+, and GitHub Copilot CLI. The installer guides you through the OpenViking connection settings; select GitHub Copilot when it asks which agents to set up. It is preselected when ~/.copilot (or $COPILOT_HOME) exists.
For a managed connection, select OpenViking Managed Service, then:
- Volcengine: enter your service API key. The installer supplies the URL.
- BytePlus: enter your API key. See BytePlus setup.
Older installers use Custom URL for BytePlus.
Select Self-hosted / local for a server on this machine (http://127.0.0.1:1933). For a remote self-hosted server, select Custom URL and enter its URL. If a connection is already saved, this option is named Custom URL / keep current.
curl -fsSL https://openviking.ai/install | bash
# AI agents: not sure about running this? The script's header says what it does and how to verify it.Start a new Copilot session after installation.
Once installed, start a new Copilot session and ask it to follow https://docs.openviking.ai/agents/en/onboarding.md. It checks the connection and walks you through the first use; see One-click setup.
What gets installed
The installer writes into Copilot's user configuration under $COPILOT_HOME (default ~/.copilot):
hooks/openviking-copilot.json: the lifecycle hooks and the URI guard. Copilot loads user hook files without a trust prompt.mcp-config.json: the OpenViking MCP serveropenviking, a stdio proxy (tools such assearch,read,remember,add_skill). Copilot shows its tools to the model asopenviking-<tool>, for exampleopenviking-search. Other servers in the file are kept.skills/: theopenviking-memory,openviking-skills,ov-experience-memory,openviking-rule-search, andov-memory-doctorskills.
The hooks and the MCP proxy run from the runtime under ~/.openviking/agent-integrations/copilot/. The installer does not need the copilot binary, and it does not install a Copilot plugin.
Hooks and MCP read the same credentials from ~/.openviking/ovcli.conf. OPENVIKING_URL and OPENVIKING_API_KEY override that file, and per-plugin settings live under plugin.copilot (see Plugin Settings). Sessions are stored in OpenViking as cp-<session id>.
Verify
- Run
node ~/.openviking/agent-integrations/copilot/scripts/ov-memory-doctor.mjsand confirm that it reports no ✗. - Start a new Copilot session and confirm that the
openviking-*tools are available. - Tell Copilot a test preference and end the session with
/exit. After memory extraction completes, start a new session in the same workspace and ask about it.
Host-specific behaviour
Copilot registers sessionStart, userPromptSubmitted, agentStop, preCompact, and sessionEnd, plus a preToolUse URI guard on view|create|edit|grep|glob|bash|powershell. Capture, commits, recall, the offline queue, and everything else shared are described in the Capability Reference.
- The session-start context reaches the model as a separate leading user message. Recall is appended to the prompt inside
<system_reminder>. Capture reads the prompt as the user typed it, so recalled memories are never captured back. agentStopcaptures without committing.preCompactandsessionEndcapture and commit, by default in a detached worker so the hook answers at once. Copilot may therefore send its compaction summary request before thepreCompactcommit lands; nothing is lost, because Copilot only appends to the transcript. Compaction removes the session-start message, so the profile and the session-history note go out again with the next prompt. In between, the server's auto-commit policy applies.- Copilot writes a turn to its transcript a moment after
agentStopfires. In the interactive TUI the detached capture still finds the whole turn; in a headless-prun the reply goes out with thesessionEndcapture, before the commit. Nothing waits for Copilot's final write: if thesessionEndcapture ever read the transcript before Copilot finished writing it (not observed in testing), the last turn would wait until the session is resumed. sessionEndfires on/exitand at the end of a headless-prun. Under--acpit fires after every prompt, so each prompt commits. A session that closes before its first prompt gets nosessionEnd.sessionEndcarries no transcript path; the plugin reads$COPILOT_HOME/session-state/<session id>/events.jsonl, a layout observed in Copilot CLI, not a published interface.- The URI guard denies
view,create,edit,grep, andglobon aviking://URI, with an example call to the matchingopenviking-<tool>. A shell command (bash,powershell) that carries aviking://URI runs, and the model gets a notice that names the OpenViking tools. - Copilot fails a
preToolUsehook closed: if the hook command itself fails, for example because the runtime was deleted, Copilot denies those seven tools. A hook that times out lets the call run. - On a resume (
--resume,--continue) Copilot replaces the earlier session-start context with the new one, so on every resume the plugin sends the profile and the session-history note again with it, even when the profile has not changed. - The model passes the session to
session_historyitself. - Subagents get no recall and are not captured.
The verified host contract and transcript format are recorded in hosts/copilot/DESIGN.md.
Upgrade and uninstall
Re-run the install command to upgrade. To uninstall, run:
curl -fsSL https://openviking.ai/install | bash -s -- --uninstall --yes --harness copilotUninstall removes only the OpenViking hooks, the openviking MCP server, the skills it installed, and the runtime files. Other configuration is preserved.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| Hooks do not run | Start a new session. If you set COPILOT_HOME, run the installer with the same value, so the files land where Copilot reads them. |
view, create, edit, grep, glob, bash, and powershell are all denied | The URI guard's hook command fails, which Copilot treats as a denial. Run the doctor, then re-run the installer. |
The installer cannot safely update mcp-config.json | Copilot accepts comments in the file, but the installer only edits plain JSON. Remove the comments and re-run the installer. |
| The installer warns about another OpenViking hook file | Copilot loads every file under $COPILOT_HOME/hooks/, so both files run. Remove the one the warning names. |
| Skills are listed twice | Without COPILOT_HOME, Copilot also reads ~/.agents/skills. Remove the duplicate copies there. |
| MCP does not connect | Check the URL/API key in ~/.openviking/ovcli.conf, then start a new session. |
| Detailed diagnostics are needed | Start Copilot with OPENVIKING_DEBUG=1 and inspect ~/.openviking/logs/copilot-hooks.log. |
Windows is not supported: the installer is a bash script, and Copilot runs hook commands under PowerShell there.