feat(copilot): add BYOK provider parity#96345
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 5:09 AM ET / 09:09 UTC. Summary PR surface: Source +1162, Tests +1434, Docs +59, Generated 0. Total +2655 across 26 files. Reproducibility: not applicable. this is a PR for a new Copilot BYOK capability rather than a bug report with a current-main reproduction path. Review metrics: 3 noteworthy metrics.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land only after owner review accepts the plugin SDK/provider-session compatibility surface and current-head validation is green or explicitly waived. Do we have a high-confidence way to reproduce the issue? Not applicable; this is a PR for a new Copilot BYOK capability rather than a bug report with a current-main reproduction path. Is this the best way to solve the issue? Yes with maintainer acceptance: the PR uses the Copilot SDK provider contract plus OpenClaw guarded fetch and provider ownership checks instead of duplicating provider runtime policy in core. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f65aca64fc37. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1162, Tests +1434, Docs +59, Generated 0. Total +2655 across 26 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
1b94b50 to
76595ab
Compare
What Problem This Solves
Copilot was still behind the Codex harness path for BYOK and runtime-session parity: custom provider routing could not safely use the Copilot SDK session-level provider contract, native compaction did not carry the resolved runtime model/API key consistently, and harness selection could not distinguish unowned custom providers from provider ids owned by another plugin/runtime.
Why This Change Was Made
User Impact
Copilot can now run explicit
agentRuntime.id: "copilot"custom BYOK provider entries for supported OpenAI-compatible, Azure OpenAI Responses, Ollama-compatible completions, and Anthropic Messages shapes. Native provider ids such asopenai,anthropic,google, andollamaremain owned by their native runtimes; Copilot only claims unowned custom provider ids.Compaction and session reuse are keyed against the actual runtime model, endpoint, headers, credential fingerprint, and token limits, so rotated BYOK configuration gets a fresh Copilot SDK session instead of reusing an incompatible one.
Evidence
OPENCLAW_LIVE_TEST=1 OPENCLAW_COPILOT_AGENT_LIVE_TEST=1 ... attempt.live.test.tspassed earlier in this branch with the local GitHub token path.tbx_01kvwhn813hxy2q7b3ef3fkfvq, GitHub Actions run28091101470, passednode scripts/run-vitest.mjs extensions/copilot/src/provider-bridge.test.ts extensions/copilot/src/byok-proxy.test.ts extensions/copilot/harness.test.ts src/agents/harness/selection.test.ts src/plugins/providers.test.ts src/plugin-sdk/agent-harness-runtime.test.ts test/scripts/plugin-sdk-surface-report.test.ts.env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 corepack pnpm check:changed.76595ab5f9returned clean: no accepted/actionable findings.scripts/pr prepare-run 96345reached full localpnpm test; broad local suite exposed unrelated baseline failures plus the now-fixed plugin SDK surface-budget drift. The focused surface test above validates the PR-owned fix.