Skip to content

Port ProviderConfig model/token overrides and client startup cleanup fix from reference implementation#164

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/reference-impl-sync-new-commits
Draft

Port ProviderConfig model/token overrides and client startup cleanup fix from reference implementation#164
Copilot wants to merge 3 commits intomainfrom
copilot/reference-impl-sync-new-commits

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

Resolves #398


Before the change?

  • ProviderConfig had no way to override the model name sent to the provider API or control token limits
  • CopilotClient leaked the CLI process if startup failed after process launch (e.g., protocol version mismatch)
  • BYOK docs contained verbose identity limitation details removed upstream

After the change?

  • ProviderConfig gains modelId, wireModel, maxInputTokens, maxOutputTokens fields:
new ProviderConfig()
    .setType("openai")
    .setBaseUrl("https://api.openai.com/v1")
    .setApiKey("sk-...")
    .setModelId("gpt-4o")              // runtime config lookup
    .setWireModel("my-finetune-v3")    // actual name sent to provider
    .setMaxInputTokens(100_000)        // serialized as "maxPromptTokens"
    .setMaxOutputTokens(4096)
  • CopilotClient.startCoreBody() now destroys the CLI process on partial startup failure, preventing resource leaks
  • BYOK identity limitations section simplified to match upstream

Reference implementation commits ported: 58cf64d, 3c622b9, 100390a

Not ported (intentionally): 1832d0a, 79dc615, 08b486d, c9433c4, c9c3648, ad0a9aa — test infrastructure, .NET-specific, or generated code (version synced via finish script).

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • mvn spotless:apply has been run to format the code
  • mvn clean verify passes locally

Does this introduce a breaking change?

  • Yes
  • No

Copilot AI and others added 2 commits May 5, 2026 23:18
- Add modelId, wireModel, maxInputTokens, maxOutputTokens to ProviderConfig
- Fix client startup cleanup race: properly destroy CLI process on failure
- Add unit tests for new ProviderConfig field serialization
- Add E2E tests for provider wire model forwarding
- Simplify BYOK identity limitations documentation (per reference impl)

Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
…om.xml CLI version, and update scripts/codegen @github/copilot version

Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Copilot AI changed the title [WIP] Sync reference implementation with 9 new commits Port ProviderConfig model/token overrides and client startup cleanup fix from reference implementation May 5, 2026
Copilot finished work on behalf of edburns May 5, 2026 23:27
Copilot AI requested a review from edburns May 5, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[reference-impl-sync] Reference Implementation sync: 9 new commits (2026-05-05)

2 participants