feat: add GitHub Copilot CLI host adapter#27
Conversation
Synthesized from dev — see docs/release.md on dev for the blocklist.
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: archcore-ai#24
|
CI approval needed: the fresh Plugin Tests run for commit |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (641.0K + 19.2M cached) input tokens, 94.1K output tokens, $29.805555 cost 🤖 Models used:
📎 Log file uploaded as Gist (6369KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
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>
Summary
.plugin/plugin.jsonmanifest and camelCase hooks configurationarchcore-*MCP tool names without changing the behavior pinned for existing hosts0.4.23version bumpReproduction and root cause
The prepared adapter still encoded provisional Copilot payload assumptions. Live captures showed that native
create/editcalls put the file in an absolutepathfield rather thanfile_path, and Copilot exposes the Archcore MCP update tool asarchcore-update_documentrather than the shared canonical name. In addition, hooks without an explicit project-relativecwdexecute 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 passmake test-codex-smoke— all 5 Codex marketplace/install/runtime smoke tests pass.archcore/*.mdcreate is denied and no target is writtenadditionalContextreaches the model in an empty projectarchcore-update_documentnormalization regressionUpstream dependencies found during live testing
Two end-to-end acceptance gaps are outside this plugin adapter and now have focused upstream reports:
hookSpecificOutputenvelope forarchcore hooks copilot session-start; Copilot requires top-leveladditionalContextThe 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-
devhead cannot be reopened after the prepared branch was rebased onto the requested base.Fixes #24