feat: BYOK onboarding, provider commands, docs, and polish#135
Merged
feat: BYOK onboarding, provider commands, docs, and polish#135
Conversation
…test - / list configured BYOK providers with detailsprovider - /provider test < test provider connectivity (HTTP + model validation)name> - /provider add| guide users to config.json workflowremove - BYOK error context: connection refused, auth failure, model not found get clear messages - Provider switch failure reverts prefs to avoid broken channel state - Added /provider to /help all Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- docs/byok. full guide: config, examples, commands, resolution, troubleshootingmd - README. BYOK in features, /provider commands in table, doc linkmd - AGENTS. updated model matching, added BYOK providers sectionmd Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- 11 tests covering /provider list, test, add/remove guidance, unknown subcommand - 552 total tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- New 'providers' topic in fetch_copilot_bridge_documentation with full BYOK config schema, commands, resolution, and session behavior docs - Admin variant includes provider add/remove/validate instructions - /provider add|remove now mentions admin bot can help - Updated overview, commands, and config topics with BYOK references - Added provider management section to admin agent template - 3 new tests (555 total) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move wireApi from provider-only to per-model configurable. Model-level wireApi overrides the provider default, allowing mixed endpoints (e.g., GPT-4o with chat + Codex with responses on the same Azure provider). - Add wireApi to ProviderModelEntry type - resolveProviderConfig accepts modelId, applies model-level override - Config validation for model-level wireApi - Updated all docs, config sample, and admin template - 3 new tests (559 total) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When a BYOK provider is active, current' marker now only appearsthe ' on the provider-prefixed model entry, not on the Copilot model with the same bare name. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ame-provider wireApi switch - Fix all docs to say 'completions' instead of 'chat' (matches SDK and validation) - Force new session when switching models within same provider if wireApi differs - Add wireApiChanged() helper to detect per-model wireApi mismatches Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Completes the BYOK provider feature series by adding user-facing /provider onboarding commands, richer BYOK documentation surfaced via bridge docs, model-level wireApi overrides, and improved session behavior/error messaging when working with external providers.
Changes:
- Added
/providercommand (list +test) and admin-aware guidance for adding/removing providers. - Implemented model-level
wireApioverrides (config validation + provider resolution) and session recreation whenwireApichanges within the same provider. - Added BYOK documentation (
docs/byok.md) and a newproviderstopic infetch_copilot_bridge_documentation, plus supporting README/agent docs updates.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/admin/AGENTS.md | Admin runbook updates for BYOK provider management |
| src/types.ts | Adds model-level wireApi to provider model entries |
| src/index.ts | Adds provider connectivity test helper + provider_test action handling |
| src/core/session-manager.ts | Applies model-level wireApi during session (re)create; recreates session on same-provider wireApi change; improves BYOK error messaging; adds docs topic enum |
| src/core/command-handler.ts | Implements /provider(s) command UX + help updates; fixes “current model” indicator for BYOK models |
| src/core/byok-providers.test.ts | Adds tests for model-level wireApi validation + resolution |
| src/core/byok-onboarding.test.ts | New tests covering /provider UX behaviors |
| src/core/bridge-docs.ts | Adds providers documentation topic with admin/non-admin variants |
| src/core/bridge-docs.test.ts | Extends docs tests to cover new topic |
| src/config.ts | Validates model-level wireApi; resolves provider config with per-model override |
| docs/byok.md | New comprehensive BYOK guide |
| config.sample.json | Updates sample BYOK config to demonstrate per-model wireApi |
| README.md | Adds BYOK to feature list + links to BYOK docs |
| AGENTS.md | Updates internal agent guidance to include BYOK behaviors and commands |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Wrap provider examples in top-level 'providers' key for copy-paste clarity - Add inline bearerToken to /provider auth display - Fix type field: optional, includes 'anthropic' option Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Document SDK Azure URL construction pattern (baseUrl + /openai/deployments/{model})
- Add common 404 causes: baseUrl format, deployment name mismatch, apiVersion
- Clarify auth header differences by provider type (api-key vs Bearer vs x-api-key)
- Add non-standard Azure gateway notes
- Add tools-not-executing troubleshooting for models without structured function calling
- Update both docs/byok.md and bridge-docs.ts providers topic
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/index.ts:843
testProviderConnectivity()always sendsAuthorization: Bearer ...regardless of provider type. Azure OpenAI expectsapi-key, and Anthropic expectsx-api-key(plus required version headers), so/provider testwill give false negatives even when the provider config is correct. Suggest setting auth headers based onprovider.type(reusing the same logic as the SDK/provider resolution where possible).
const headers: Record<string, string> = { 'Accept': 'application/json' };
if (apiKey) headers['Authorization'] = `Bearer ${apiKey}`;
else if (bearerToken) headers['Authorization'] = `Bearer ${bearerToken}`;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…t doc
- Only apply BYOK-specific error messages when provider actually resolved
(prevents misattributing Copilot errors as provider issues)
- Fix AGENTS.md: /provider test hits ${baseUrl}/models, not /v1/models
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
PR 3 of 3 in the BYOK provider series. Adds user-facing onboarding commands, documentation, error handling, and polish discovered during live testing.
What it does
/providercommand with list, test, and add/remove subcommands/provider test <name>)wireApioverride (mixcompletionsandresponsesmodels on one provider)providerstopic infetch_copilot_bridge_documentationtool (admin/non-admin variants)/provider adddetects admin role)docs/byok.mdKey changes
src/core/command-handler.ts:/providercommands, admin-aware add/remove, isCurrent fixsrc/core/session-manager.ts: BYOK error wrapping, wireApi change detection in switchModelsrc/index.ts:testProviderConnectivity(),provider_testaction handlersrc/config.ts: Model-level wireApi validation and resolutionsrc/core/bridge-docs.ts: Newproviderstopic with full BYOK docsdocs/byok.md: Comprehensive BYOK guideKnown limitations (follow-up)
/provider testuses simplified connectivity check, not full SDK resolution pathPrior PRs