You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[RefImpl] Add a GitHub Copilot CLI host adapter #114
I tested Copilot CLI’s hook API locally. Its session and tool hooks appear sufficient for an ACS adapter:
ACS
Copilot CLI
Session lifecycle
sessionStart, sessionEnd
Tool request
preToolUse
Tool result
postToolUse, postToolUseFailure
Tool decision
permissionDecision
Session ID
sessionId
Workspace
cwd
The adapter would mainly need to translate tool names and payloads, Guardian decisions, tool results, and audit events.
A few details still need to be handled carefully, especially tool-name mapping (bash vs. Bash), non-zero shell exits, hook timeouts, and multiple-hook behavior.
Do you intend to implement this yourself
Yes, I want this assigned to me
Current Priority Scope
This is deferred or out of scope and I am filing it to be tracked
@DvJiang thank you for testing... are you still planning on taking this slice? If so, I'd like to help: the Codex adapter in #162 and I went through Copilot's hooks reference. If you've moved on, I'm happy to take it. Either way, here's what I found:
preToolUse returns permissionDecision plus modifiedArgs, which covers ACS MODIFY. postToolUse can return modifiedResult, so a result gate can replace what the model sees? The CC host's hookmap was built so a second host is "a shim and a hookmap rather than a fork," and Copilot fits reference-implementations/agt/hosts/. One difference: toolArgs arrives as a JSON string, so it needs a parse step.
Needs a decision:
Timeouts fail open. A hook that exceeds timeoutSec (default 30) is treated as allowed. github/copilot-cli#2893 adds that the hook isn't killed, a late deny is discarded, and parallel tool calls queue serially. The adapter needs its own deadlines well under timeoutSec, and the README should say Copilot isn't a fail-closed boundary under load.
Copilot also reads .claude/settings.json. In a repo with the Claude Code shim installed, Copilot may already run it through its Claude-compatible format. The shim requires a hook_event_name field the reference doesn't list for that format, so it may exit 2 and deny every call. With both registered, a call could reach the Guardian twice.
Non-zero exits deny. That's safer than Claude Code, but an adapter bug blocks every tool call.
ask and MODIFY involve the user.ask becomes deny in the cloud agent and autopilot, and #3042 reports two confirmations per ask. updatedInput rewrites prompt on every call (#2643); modifiedArgs needs testing.
Repo hooks also run in the cloud agent, where a Guardian on localhost isn't reachable. ~/.copilot/hooks/ keeps it CLI-only.
I am not entirely sure how to approach the copilot desktop application yet, but I will tackle that when we get there.
Because of @bar-capsule grinding out the cursor/claude code adapters etc. we should know how to tackle these because we have a provider agnostic methodology already.
Activity
Lrd0036 commentedon Oct 13, 2026
@DvJiang thank you for testing... are you still planning on taking this slice? If so, I'd like to help: the Codex adapter in #162 and I went through Copilot's hooks reference. If you've moved on, I'm happy to take it. Either way, here's what I found:
preToolUsereturnspermissionDecisionplusmodifiedArgs, which covers ACS MODIFY.postToolUsecan returnmodifiedResult, so a result gate can replace what the model sees? The CC host's hookmap was built so a second host is "a shim and a hookmap rather than a fork," and Copilot fitsreference-implementations/agt/hosts/. One difference:toolArgsarrives as a JSON string, so it needs a parse step.Needs a decision:
timeoutSec(default 30) is treated as allowed. github/copilot-cli#2893 adds that the hook isn't killed, a latedenyis discarded, and parallel tool calls queue serially. The adapter needs its own deadlines well undertimeoutSec, and the README should say Copilot isn't a fail-closed boundary under load..claude/settings.json. In a repo with the Claude Code shim installed, Copilot may already run it through its Claude-compatible format. The shim requires ahook_event_namefield the reference doesn't list for that format, so it may exit 2 and deny every call. With both registered, a call could reach the Guardian twice.askand MODIFY involve the user.askbecomesdenyin the cloud agent and autopilot, and #3042 reports two confirmations perask.updatedInputrewrites prompt on every call (#2643);modifiedArgsneeds testing.localhostisn't reachable.~/.copilot/hooks/keeps it CLI-only.I am not entirely sure how to approach the copilot desktop application yet, but I will tackle that when we get there.
Because of @bar-capsule grinding out the cursor/claude code adapters etc. we should know how to tackle these because we have a provider agnostic methodology already.