Skip to content

feat: add GitHub Copilot CLI host adapter#27

Open
konard wants to merge 16 commits into
archcore-ai:devfrom
konard:issue-24-1f2c5a6a3cbb
Open

feat: add GitHub Copilot CLI host adapter#27
konard wants to merge 16 commits into
archcore-ai:devfrom
konard:issue-24-1f2c5a6a3cbb

Conversation

@konard

@konard konard commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • add the native GitHub Copilot CLI .plugin/plugin.json manifest and camelCase hooks configuration
  • route all Copilot hooks through the shared Archcore scripts from the user project root
  • normalize captured native file-tool paths and archcore-* MCP tool names without changing the behavior pinned for existing hosts
  • add real redacted Copilot CLI 1.0.73 payload fixtures, structural/unit regressions, release documentation, and the four-manifest 0.4.23 version bump

Reproduction and root cause

The prepared adapter still encoded provisional Copilot payload assumptions. Live captures showed that native create/edit calls put the file in an absolute path field rather than file_path, and Copilot exposes the Archcore MCP update tool as archcore-update_document rather than the shared canonical name. In addition, hooks without an explicit project-relative cwd execute from the installed plugin directory.

The normalizer now maps those native payloads into the existing internal contract, and the Copilot hook file pins cwd: ".", ARCHCORE_HOST=copilot, native lifecycle keys, mutation-tool matchers, and bounded pre/post hook execution.

Verification

  • make all — JSON, permissions, ShellCheck, and all 385 Bats tests pass
  • make test-codex-smoke — all 5 Codex marketplace/install/runtime smoke tests pass
  • live Copilot CLI 1.0.73 smoke: a direct .archcore/*.md create is denied and no target is written
  • live Copilot CLI 1.0.73 smoke: project-root post-tool cascade context reaches the model
  • live Copilot CLI 1.0.73 smoke: top-level session additionalContext reaches the model in an empty project
  • live native MCP payload capture verifies the archcore-update_document normalization regression

Upstream dependencies found during live testing

Two end-to-end acceptance gaps are outside this plugin adapter and now have focused upstream reports:

The adapter and its independently testable protections are ready for review; initialized-project session context and project-correct MCP operation remain gated by those upstream fixes.

Addresses #24

Supersedes closed PR #26, whose frozen pre-dev head cannot be reopened after the prepared branch was rebased onto the requested base.

Fixes #24

@konard

konard commented Jul 23, 2026

Copy link
Copy Markdown
Author

CI approval needed: the fresh Plugin Tests run for commit 8bce7fd460cfd2b49e8cbcc2c39718df67cc74cb is gated as action_required before any jobs are created: https://github.com/archcore-ai/plugin/actions/runs/30019746799\n\nI verified the run SHA and timestamp, attempted to download its log (GitHub reports log not found because there are zero jobs), and attempted the fork-run approval endpoint; the available credentials receive HTTP 403 (repository admin rights required). Please approve the workflow run so the already-green local suite can execute in CI.

@konard

konard commented Jul 23, 2026

Copy link
Copy Markdown
Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $29.805555

📊 Context and tokens usage:

  • 641.0K / 200K (320%) input tokens, 94.1K / 128K (73%) output tokens

Total: (641.0K + 19.2M cached) input tokens, 94.1K output tokens, $29.805555 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT-5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (6369KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

ivklgn and others added 2 commits July 26, 2026 21:26
Resolve four conflicts against the host-wiring-parity work on dev:

- plugin.json x3 (.claude-plugin/.codex-plugin/.cursor-plugin) — version
  only; take dev's 0.5.1.
- component-registry.doc.md — one conflicting hunk (the bin/session-start
  plugin-install guard paragraph). Keep dev's text: it is a superset,
  already listing `.plugin/` alongside the other manifests and adding the
  install-cache fragment layer plus the guard-before-CLI-check ordering.
  All Copilot content from this branch merged cleanly and is preserved.

Also align the new .plugin/plugin.json (Copilot manifest) to 0.5.1 — git
reports no conflict on it since it is a new file, but
test/structure/copilot-plugin.bats asserts version parity with the Claude
manifest.

make verify: 438/438 pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The Copilot adapter landed without touching the init contour, so
/archcore:init could not resolve a Copilot session at all.

bin/detect-host has no Copilot branch and gets none: Copilot CLI exports
no marker into the shell commands it runs for the agent — every
documented COPILOT_* var is read FROM the user environment, and adding a
detection variable is an open upstream request
(microsoft/vscode#311734). COPILOT_PLUGIN_ROOT exists only inside hook
processes; detect-host runs from a skill's Bash call. A Copilot session
therefore resolves to __UNKNOWN__ by design.

That makes the skill's ask-fallback the only path to a correct agent id
on this host — and it offered just the three detectable hosts, leaving a
Copilot user with no right answer. Step -1 now offers GitHub Copilot CLI
and maps it to `copilot`, and states why the probe can never return it.

Host wiring stays unlisted for copilot: `archcore init --agent copilot`
currently writes .vscode/mcp.json, which Copilot CLI does not read
(project-level MCP is .github/mcp.json or .mcp.json). Rather than
promise a file list the CLI cannot deliver, init omits the wiring line
on this host and seeds content only — a plugin-installed Copilot session
already carries MCP and hooks from the plugin itself. The row lands once
the CLI writes the right path, together with the version-gate bump.

Agent allow-lists gain the third MCP naming. Claude/Cursor see
mcp__archcore__* or mcp__plugin_archcore_archcore__*; Copilot flattens
to archcore-<tool>, verified against Copilot CLI 1.0.73 in
normalize-stdin.sh. `tools:` is an allow-list and unrecognized names are
ignored, so the missing twin silently stripped both sub-agents of every
archcore tool under Copilot.

Tests pin each gap so it cannot regress: COPILOT_* is not a detection
signal and never outranks a real host; SKILL.md and detect-host agree on
the emitted token set (and the ask-fallback note must go if Copilot ever
becomes detectable); allow-lists carry all three namings in both
directions.

README promotes Copilot CLI from Planned to Implemented with the subdir
install spec.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants