Sending x-api-key instead of api-key as header for azure hosted anthropic service#11517
Sending x-api-key instead of api-key as header for azure hosted anthropic service#11517sresam89 wants to merge 2 commits intocontinuedev:mainfrom
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/openai-adapters/src/apis/AnthropicUtils.ts">
<violation number="1" location="packages/openai-adapters/src/apis/AnthropicUtils.ts:82">
P2: Case-sensitive `apiBase.includes` check can cause Azure Cognitive Services URLs with mixed-case hostnames to fall back to `x-api-key`, despite `isAzure` being true, leading to incorrect auth header selection.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
I have read the CLA Document and I hereby sign the CLA |
…e hosted anthropic service
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
d70661c to
9178f87
Compare
|
@sestinj awaiting your inputs |
RomneyDa
left a comment
There was a problem hiding this comment.
@sresam89 is there a more deterministic way to check if it's an anthropic endpoint? Right now anything not cognitive... will now do x-api-key, which might break other azure endpoints. Any way to specifically set x-api-key if anthropic?
this change is focused only on anthropic end points, when the provider selection is anthropic, does not affect other providers, to the extent of my testing knowledge |
RomneyDa
left a comment
There was a problem hiding this comment.
Ah that makes sense, I somehow missed that this is within AnthropicUtils.
|
@sestinj awaiting for your review |
Thanks for your approval |
Sending x-api-key instead of api-key as header for azure hosted anthropic service
Description
Sending x-api-key instead of api-key as header for azure hosted anthropic service
AI Code Review
@continue-reviewChecklist
[yes] I've read the contributing guide
[yes] The relevant docs, if any, have been updated or created
[yes] The relevant tests, if any, have been updated or created
Screen recording or screenshot
Tests
compiled the plugin and ran the changes using android studio
Summary by cubic
Send
x-api-keyby default for Azure-hosted Anthropic; useapi-keyonly whenapiBasecontainscognitiveservices.azure.com(case-insensitive) to prevent auth failures on newer Azure deployments.apiBase?.toLowerCase().includes("cognitiveservices.azure.com")to choose betweenapi-keyandx-api-key.Written for commit 9178f87. Summary will update on new commits.