Repository navigation
feat(planner): add the Copilot SDK client - #185
Merged
Merged
Conversation
The planner's client of the Copilot SDK starts the pinned CLI and works out a plan in plan mode on claude-opus-5.5, with the plan's seven tools, no custom instructions and every permission rejected; it keeps the plan that exit_plan_mode brings and ends the turn with exit_only. The CLI's environment drops every COPILOT_* and GH_* variable and GITHUB_TOKEN, since the CLI reads more than tokens from them, such as COPILOT_ALLOW_ALL. mise pins copilot at 1.0.105, the version that SDK v1.0.28 names, lazily so CI doesn't download it, and copilot:check fails when the two differ. Renovate leaves the CLI to the SDK's PRs.
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.
Brief
Goal: the planner's client of the Copilot SDK (
copilot-client, plan §0 and §8.2, decisions 403 and 404). It starts the Copilot CLI and works out a plan in plan mode.Scope
services/planner/internal/copilot:New,Start,StopandPlan.Planopens a session on claude-opus-5.5 with §3's seven tools, plan mode, the empty working folder, no custom instructions and a permission handler that rejects every request. It keeps the plan thatexit_plan_modebrings, and answersexit_only, which ends the turn.COPILOT_*orGH_*variable orGITHUB_TOKEN, plusCOPILOT_GH_HOST.UseLoggedInUseris off, and the token goes asGitHubToken.go.mod. mise'scopilotis pinned at 1.0.105, the version that SDK names, and is lazy.mise run copilot:check, part ofcheck, fails when the two differ.copilot. The SDK's PRs get a note to update the pin.Out of scope
planner-service).Acceptance criteria
exit_plan_moderequests. Its prompt goes in plan mode.exit_plan_modeis answered approved, withexit_only, andContent()returns its plan.COPILOT_*,GH_*orGITHUB_TOKENvariable from the service's environment, and getsCOPILOT_GH_HOST. The caller's slice stays as it was.fs.ErrNotExisterror.mise run copilot:checkpasses with the pins as they are, and fails when they differ.mise run checkpasses.QA
BAKHYARD_E2E_PORT=8480 mise run checkpassed on the merged head. It ran:fmt:check;lint(0 issues);lint:actions;lint:compose;gen:check;copilot:check;cover: 96.5% in total, 96.9% for the package;vuln: thegolang.org/x/cryptoopenpgp module note was already onmain, and nothing calls it;//apps/web:check;main.go test -race -count=3on the package passes.copilot:checkpasses. It fails with:copilotpinned at 1.0.104;package.jsonwithoutcopilotCliVersion;go list -mworks with an empty module cache, as on a fresh runner.mise install --dry-runskipscopilot.mise install copilotinstalls 1.0.105, which runs.renovate.jsonpassesrenovate-config-validator --strict(Renovate 44.198.0). Renovate's mise manager mapscopilottogithub/copilot-clireleases, so the rule applies.Review
No blocking findings. Non-blocking:
latestand CI installs them all. Decision 74's exception, an exactcopilotthat is now lazy, is recorded only in the plan, because AGENTS.md changes only with the user's OK.COPILOT_GH_HOST=.planner-servicemust require the host and the token.Nothing calls the client yet. No credits spent: the tests use a stand-in CLI.