Skip to content

[RefImpl] Add a GitHub Copilot CLI host adapter #114

Open

Description

@DvJiang

Target runtime or language

Github Copilot CLI

What this proves

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

Activity

  1. added
    type:refimplReference implementation or adapter work
    status:needs-triageNot yet triaged. Applied by the issue forms
    on Sep 13, 2026
  2. added
    scope:in-focusFeeds the ninety-day committed outcome. Maintainers only
    status:acceptedIn the backlog. Maintainers only
    and removed
    status:needs-triageNot yet triaged. Applied by the issue forms
    on Oct 5, 2026
  3. Lrd0036 commented on Oct 13, 2026

    @Lrd0036
    Collaborator

    @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:

    1. 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.
    2. 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.
    3. Non-zero exits deny. That's safer than Claude Code, but an adapter bug blocks every tool call.
    4. 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.
    5. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope:in-focusFeeds the ninety-day committed outcome. Maintainers onlystatus:acceptedIn the backlog. Maintainers onlytype:refimplReference implementation or adapter work

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions