Add GitHub Copilot CLI as a coding agent#455
Merged
Merged
Conversation
95404c8 to
a130df7
Compare
Add Copilot CLI ("Copilot CLI") to the SkillAgent integration system
alongside Claude Code, Codex, Kiro, OpenCode, and Pi.
Copilot CLI auto-loads any JSON hook file under ~/.copilot/hooks/, so the
integration writes and owns ~/.copilot/hooks/supacode.json (the Pi/OpenCode
own-file model) rather than merging into a shared settings object. Hooks emit
the OSC 3008 presence signals every other agent uses, mapped to Copilot's
lifecycle events (verified against GitHub's hooks docs):
sessionStart -> session_start
userPromptSubmitted -> busy
pre/postToolUse -> busy
agentStop -> idle
sessionEnd -> session_end
notification -> rich alert for every Copilot notification; also flips
the badge to awaiting_input for permission_prompt /
elicitation_dialog ("needs you") types.
Done/permission notifications route through Copilot's `notification` event
(carries message/title), so they're richer than agentStop (whose payload has
no assistant text).
- SkillAgent: new .copilot case (.copilot dir, "Copilot CLI", copilot-mark)
- CopilotHookSettings: builds the {version,hooks} JSON; notification hook reads
stdin once and branches on notification_type
- AgentPresenceOSC.emitNotifyShell gains readsStdin (emit notify from a payload
already captured by a branching hook)
- CopilotHooksInstaller: own-file install/uninstall/state, sentinel ownership,
only ever touches supacode.json (never sibling user hook files)
- AgentIntegrationFactory / CLISkillInstaller / DeveloperSettingsView wired up
- copilot-mark asset + CopilotHooksInstaller tests
a130df7 to
27a734f
Compare
Insert Copilot in alphabetical position in SkillAgent so it surfaces in order in Settings and the sidebar card instead of trailing the list. Make CopilotHookSettings.source() throw rather than returning an empty string, so an encode failure can never write a marker-less hook file the installer can no longer recognize or remove. Backfill the sidebar-card mode fixtures with the new case (a missing case read as still-checking and hid the card) and add coverage for the notify shell stdin capture, notification prompt gating, non-UTF8 install state, and the alphabetical ordering invariant.
sbertix
approved these changes
Jun 22, 2026
sbertix
left a comment
Collaborator
There was a problem hiding this comment.
Thank you 🙇♂️ just sorted the agents cases (so they read alphabetically) and adding some missing tests
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.
Summary
Adds GitHub Copilot CLI (displayed as "Copilot CLI") to the
SkillAgentagent-integration system, alongside Claude Code, Codex, Kiro, OpenCode, and Pi. Installing the integration wires up sidebar/tab agent-presence badges and notifications for Copilot, the same as the other agents.How it works
Copilot CLI auto-loads every JSON hook file under
~/.copilot/hooks/, so Supacode writes and owns its own~/.copilot/hooks/supacode.json(the Pi/OpenCode "own-file" model) rather than merging into a shared settings object — no prune/append, no feature flag. The hooks emit the shared OSC 3008 presence signals, mapped to Copilot's lifecycle events (per GitHub's hooks docs):sessionStartuserPromptSubmitted/preToolUse/postToolUseagentStopsessionEndnotification(permission_prompt/elicitation_dialog)pre/postToolUsealso recover the badge to busy after a permission prompt flips it to awaiting_input. Thenotificationhook reads the payload and only acts on the "needs you" types so the done-notification (owned byagentStop) isn't duplicated.Changes
SkillAgent: new.copilotcase (.copilotdir, "Copilot CLI",copilot-mark)CopilotHookSettings/CopilotHooksInstaller: build + install/uninstall the ownedsupacode.json(sentinel ownership; only ever touchessupacode.json, never sibling user hook files)AgentPresenceOSC.emitNotifyShellgainsreadsStdinso the branchingnotificationhook can emit a notify from an already-captured payloadAgentIntegrationFactory,CLISkillInstaller/CLISkillContent, and the Developer settings rowcopilot-markasset (template-rendered, works in light + dark) +CopilotHooksInstallerTestsTesting
CopilotHooksInstallerTests,AgentPresenceOSCTests,SettingsFeatureAgentIntegrationTests.SUPACODE_SURFACE_IDetc.) and the commands emit valid OSC 3008 to the surface tty (write_to_tty=OK). Presence events (sessionStart/userPromptSubmitted/preToolUse/agentStop) all fire.I could not verify the rendered badge or notifications locally, because that requires a
GhosttyKit.xcframeworkbuilt with the OSC 3008 context-signal support (added June 2026). The local framework is from March and lacks the callback, and rebuilding it isn't possible on my machine:make build-ghostty-xcframeworkrequires zig 0.15.2 (ghostty'srequireZigenforces this exact version), but zig 0.15.2 fails to link against the current macOS 26.5 SDK — a handful of re-exported libc symbols (_sigaction,_waitpid,_realpath$DARWIN_EXTSN,_malloc_size,_posix_memalign,_sysctlbyname,_sigemptyset) come back undefined (a known zig.tbdre-export bug). Same failure on the 15.4 / 26.4 / 26.5 SDKs.processhas noEnvMap) and is rejected byrequireZig.So the presence-badge and notification rendering needs to be confirmed in CI / a build environment with a current GhosttyKit. The agent side (hooks fire, valid OSC emitted) and all unit tests are verified.
Open question for review
Copilot's
notificationevent did not fire for an in-CLI elicitation in my testing, so the permission/"needs you" alert depends on Copilot actually emittingnotificationevents (its own setting). The presence states (busy/idle via the other hooks) are independent of that.