Skip to content

Conversation

@visadb
Copy link
Contributor

@visadb visadb commented Sep 17, 2025

Description

Should fix issue #7047

TL;DR: In openai provider, do not include an empty Authorization: Bearer header if apiKey has not been configured.

This enables using OpenAI-compatible APIs using other authentication methods than Bearer. I'm personally using basic auth with vLLM by configuring Authorization: Basic ... in config.yaml which is thwarted by the openai provider adding an empty Authorization: Bearer even when no apiKey is configured which interferes with my custom Authorization header.

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-general-review or @continue-detailed-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

This is what HTTP headers used to look like for me before this fix:

...
Authorization: Bearer
Authorization: Basic <my-credentials>
...

Tests

None


Summary by cubic

Stop sending an empty Authorization: Bearer header in the OpenAI provider when no apiKey is configured. This lets OpenAI-compatible endpoints use other auth methods (e.g., Basic auth) without their custom Authorization header being overwritten.

Should fix issue continuedev#7047

This enables using OpenAI-compatible APIs using other authentication
methods than Bearer. I'm personally using basic auth with vLLM by
configuring 'Authorization: Basic ...' in config.yaml which is thwarted
by the openai provider adding an empty "Authorization: Bearer" even when
no `apiKey is configured` which interferes with my custom
Authorization header.
@visadb visadb requested a review from a team as a code owner September 17, 2025 08:32
@visadb visadb requested review from RomneyDa and removed request for a team September 17, 2025 08:32
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Sep 17, 2025
@github-actions
Copy link

github-actions bot commented Sep 17, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@visadb
Copy link
Contributor Author

visadb commented Sep 17, 2025

I have read the CLA Document and I hereby sign the CLA

@RomneyDa RomneyDa changed the title fix: openai provider empty Bearer when no apiKey configured fix: HOTFIX openai provider empty Bearer when no apiKey configured Sep 17, 2025
@RomneyDa RomneyDa added the hotfix Should be considered as a hotfix for main releases label Sep 17, 2025
Copy link
Collaborator

@Patrick-Erichsen Patrick-Erichsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix here!

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Sep 17, 2025
@Patrick-Erichsen Patrick-Erichsen merged commit d86a25f into continuedev:main Sep 17, 2025
71 of 75 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Sep 17, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 17, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 17, 2025
@sestinj
Copy link
Contributor

sestinj commented Sep 17, 2025

🎉 This PR is included in version 1.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Sep 17, 2025

🎉 This PR is included in version 1.17.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot deleted the fix-openai-bearer branch November 17, 2025 06:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

hotfix Should be considered as a hotfix for main releases lgtm This PR has been approved by a maintainer released size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants