|
| 1 | +--- |
| 2 | +title: "Prefer Copilot CLI and replay over Copilot SDK for beta eval runs" |
| 3 | +module: copilot provider runtime |
| 4 | +date: 2026-07-05 |
| 5 | +problem_type: best_practice |
| 6 | +component: tooling |
| 7 | +severity: medium |
| 8 | +tags: |
| 9 | + - copilot |
| 10 | + - copilot-cli |
| 11 | + - copilot-sdk |
| 12 | + - replay |
| 13 | + - provider-runtime |
| 14 | + - dogfood |
| 15 | +applies_when: |
| 16 | + - Choosing the canonical Copilot target for live coding-agent evals |
| 17 | + - Copilot SDK child-runner starts but returns empty output or hangs |
| 18 | + - Comparing AgentV against Harbor/Entire-style Copilot integrations |
| 19 | +--- |
| 20 | + |
| 21 | +# Prefer Copilot CLI and replay over Copilot SDK for beta eval runs |
| 22 | + |
| 23 | +## Context |
| 24 | + |
| 25 | +AgentV supports coding-agent targets through provider adapters plus normalized run |
| 26 | +artifacts. For Copilot, there are three plausible paths: |
| 27 | + |
| 28 | +- Active execution through `copilot-cli`. |
| 29 | +- Import/replay from recorded Copilot session events. |
| 30 | +- Active execution through `copilot-sdk`. |
| 31 | + |
| 32 | +During `av-t2o5.3`, the SDK child-runner dependency and path issues were fixed and |
| 33 | +live dogfood passed for Pi SDK, Codex SDK, and Claude SDK. Copilot SDK still produced |
| 34 | +an empty result envelope and then hung until timeout, with the full eval reporting a |
| 35 | +`SIGTERM` from the child runner. The earlier TCP transport fix avoided one stdio |
| 36 | +`EPIPE` class, but did not make the SDK path reliable enough to be the canonical beta |
| 37 | +Copilot runtime. |
| 38 | + |
| 39 | +Peer-framework evidence points the same way for eval harnesses: |
| 40 | + |
| 41 | +- Harbor runs Copilot through `copilot --prompt ... --yolo --output-format json` and |
| 42 | + converts the JSONL output into a trajectory. |
| 43 | +- Entire captures Copilot CLI session events and has Copilot-specific token-validation |
| 44 | + handling for `~/.copilot/session-state/<session-id>/events.jsonl`. |
| 45 | +- Promptfoo and DeepEval do not expose a Copilot SDK provider in their local clones. |
| 46 | +- Vercel `next-evals-oss` result bundles provide normalized and raw transcripts, not |
| 47 | + a Copilot SDK execution path. |
| 48 | + |
| 49 | +## Guidance |
| 50 | + |
| 51 | +Use `copilot-cli` and replay/import as the supported Copilot paths for beta evals. |
| 52 | +Keep `copilot-sdk` explicit and experimental until live dogfood shows stable process |
| 53 | +lifecycle, non-empty output, and artifact finalization. |
| 54 | + |
| 55 | +Do not model Copilot replay as a separate `copilot-log` target provider. Record or |
| 56 | +import provider-specific events into AgentV's normalized transcript/cassette format, |
| 57 | +then run graders against that replay source. This avoids one log target per provider |
| 58 | +while preserving raw sidecars for debugging. |
| 59 | + |
| 60 | +## Why This Matters |
| 61 | + |
| 62 | +The eval result is only useful after AgentV writes the normalized transcript, raw |
| 63 | +transcript sidecar, grader artifacts, and run indexes. A provider path that starts but |
| 64 | +hangs after returning an empty envelope can waste live-agent budget and still leave |
| 65 | +unclear artifacts. |
| 66 | + |
| 67 | +CLI plus replay also matches the repo-native model: active runs create filesystem |
| 68 | +artifacts, and later grading can reuse those artifacts without re-running an expensive |
| 69 | +coding agent. |
| 70 | + |
| 71 | +## When to Apply |
| 72 | + |
| 73 | +Prefer this shape for live Copilot evals: |
| 74 | + |
| 75 | +```yaml |
| 76 | +targets: |
| 77 | + - id: copilot-local |
| 78 | + provider: copilot-cli |
| 79 | + config: |
| 80 | + command: ["copilot"] |
| 81 | +``` |
| 82 | +
|
| 83 | +Prefer a provider-neutral replay target for grader iteration: |
| 84 | +
|
| 85 | +```yaml |
| 86 | +targets: |
| 87 | + - id: copilot-replay |
| 88 | + provider: replay |
| 89 | + transcript: .agentv/transcripts/copilot-session.jsonl |
| 90 | +``` |
| 91 | +
|
| 92 | +Use `copilot-sdk` only when the task explicitly exercises that provider: |
| 93 | + |
| 94 | +```yaml |
| 95 | +targets: |
| 96 | + - id: copilot-sdk-experimental |
| 97 | + provider: copilot-sdk |
| 98 | +``` |
| 99 | + |
| 100 | +## Related |
| 101 | + |
| 102 | +- `packages/core/src/evaluation/providers/copilot-sdk.ts` - SDK runtime boundary. |
| 103 | +- `apps/cli/src/commands/import/copilot.ts` - Copilot session import boundary. |
| 104 | +- `docs/solutions/best-practices/prefer-copilot-sdk-tcp-for-owned-runtimes.md` - |
| 105 | + narrower TCP transport lesson. |
| 106 | +- `docs/solutions/best-practices/prefer-isolated-runtime-boundaries-for-agent-sdk-providers.md` |
| 107 | + - child-process boundary for SDK providers. |
0 commit comments