feat: GitHub Copilot CLI adapter#70
Open
arielbk wants to merge 7 commits into
Open
Conversation
arielbk
marked this pull request as ready for review
July 16, 2026 14:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add GitHub Copilot CLI as the fourth session tool (
copilot), alongside Claude, Codex, and Cursor.events.jsonltranscripts under~/.copilot/session-state/<uuid>/(honoringCOPILOT_HOME) into the common transcript shape: title, model, message head/tail, and token totals.session-state/<uuid>/inuse.<pid>.lockfiles, since Copilot exposes no session-id environment variable.sessionStart/agentStop/subagentStop) with their camelCase payloads, keyed on thesessionIdcarried in stdin.copilot plugin install ./plugin(documented in the README).Why
Trace already captures Claude, Codex, and Cursor sessions; Copilot CLI sessions were invisible. This brings task binding, transcript rendering, state-freshness checks, and re-entry to Copilot with no manual setup beyond the plugin install.
Implementation details
packages/core/src/copilot-adapter.ts): reads the append-onlyevents.jsonl, tolerating bothdata-nested and top-level event fields, and skipping malformed lines. Token totals are output-only — Copilot records no input or cache tokens (outputTokensperassistant.message).apps/cli/src/copilot-session.ts): core stays fs/process-free via an injectedresolveCopilotSessioncallback (same pattern as Cursor), wired once in the CLI identity composition root. Copilot identity takes precedence over Cursor cwd-guessing only when Claude/Codex identities are absent.sessionId+cwd. Copilot ignores command-hook stdout atsessionStart, so the binding nudge rides the prompt-type hook (auto-submitted text).agentStopfeeds the payload id intostate check's explicit-binding gate.subagentStopis accepted but intentionally a no-op — no parent/child linkage was observed in the event stream. To be probed empirically during dogfood; a stable relation would enable nested subagent sessions later.toolcolumn is unconstrained text; theSessionToolenum is TS-only.Cut from this PR: Windows VDI support (follow-up task),
session scan --copilotbackfill (Cursor precedent: live capture only), and reading thesession-store.dbSQLite mirror.Testing
COPILOT_HOME.Remaining before undraft
The end-to-end macOS dogfood (the task's done condition) is still to run: install the plugin per README, bind a task from a real Copilot session, verify board rendering and re-entry, probe subagent linkage, and record the resume invocation + prompt-hook dynamism findings. The full QA runbook lives in the task's
copilot-cli-adapter.qa.md.🤖 Generated with Claude Code