continue-custom/packages
Aaron Lippold 63abf6b43d
fix(openai-adapters): extend auth header override to support x-api-key (#8779)
* fix(openai-adapters): extend auth header override to support x-api-key

Extends the fix from PR #8684 to handle x-api-key header in addition to
Authorization header.

Background:
- Continue sends duplicate auth headers where the first is malformed
- PR #8684 fixed this for Authorization header
- Same issue affects x-api-key header used by some OpenAI-compatible APIs

Changes:
- Rename function to letRequestOptionsOverrideAuthHeaders (more generic)
- Check for both Authorization AND x-api-key in requestOptions.headers
- Remove default headers if custom ones are provided
- Handles Headers object, array, and plain object formats

Impact:
- Fixes authentication with APIs that use x-api-key header
- Enables use of MITRE AIP and similar enterprise endpoints
- Maintains backward compatibility with existing configs

Related: #7047 (duplicate headers bug)
Extends: #8684 (Authorization header fix)

Tested-with: MITRE AIP endpoints using x-api-key authentication

Authored by: Aaron Lippold <lippold@gmail.com>

* test(openai-adapters): add tests for auth header override fix

Add comprehensive tests for the customFetch auth header override functionality:
- Test Authorization header override
- Test x-api-key header override
- Test Headers object handling
- Test array of tuples handling
- Test case-insensitive matching
- Test no override when requestOptions empty

All tests pass.

Related: #7047, #8684

Authored by: Aaron Lippold <lippold@gmail.com>

* test: update to structural tests per reviewer feedback

Changed from integration tests to structural/smoke tests that verify
the customFetch function behavior without complex fetch stack mocking.

Tests now verify:
- Function exports and structure
- Returns callable functions
- Handles all requestOptions variations
- Doesn't throw on edge cases
- Case-insensitive header handling

Per reviewer feedback, this avoids false confidence from incomplete
integration tests while still validating the function works correctly.

Related: Reviewer feedback on PR #8779

* ci: add GitHub Actions to publish MITRE CLI package

Automates building and publishing the patched Continue CLI:
- Builds on push to mitre branch
- Publishes to GitHub Package Registry as @mitre/continue-cli
- Creates release artifacts
- Uploads distribution tarball

Team can install via:
  npm install -g @mitre/continue-cli --registry=https://npm.pkg.github.com

Or download tarball from releases.

Authored by: Aaron Lippold <lippold@gmail.com>

* chore: remove MITRE-specific workflow from upstream PR

This workflow is for MITRE fork only, not needed in upstream.

Authored by: Aaron Lippold <lippold@gmail.com>

* fix(openai-adapters): correct Responses API model detection regex

The RESPONSES_MODEL_REGEX was too broad, matching any model starting
with "o" (e.g., "openai/gpt-oss-120b"). This caused Continue to
incorrectly use the Responses API for non-reasoning models.

Changed regex from /^(?:gpt-5|gpt-5-codex|o)/i
to /^(?:gpt-5|gpt-5-codex|o[0-9])/i to only match:
- gpt-5, gpt-5-codex (GPT-5 series)
- o1, o3, o4, etc. (OpenAI O-series reasoning models)

This prevents false positives for model names like:
- openai/gpt-oss-120b (Cloudflare Workers AI model)
- ollama/... (Ollama models)
- Any other model with provider prefix starting with "o"

Tested with openai/gpt-oss-120b - now correctly uses
/v1/chat/completions instead of /v1/responses.

Authored by: Aaron Lippold <lippold@gmail.com>
2025-11-19 14:33:55 -08:00
..
config-types fix: upgrade zod from 3.24.2 to 3.25.76 2025-11-04 07:18:35 +00:00
config-yaml Merge pull request #8776 from continuedev/dallin/super-snyk 2025-11-18 17:09:55 -08:00
continue-sdk fix: packages/continue-sdk/package.json & packages/continue-sdk/package-lock.json to reduce vulnerabilities 2025-11-18 23:43:26 +00:00
fetch fix: remove keepAliveMsecs from fetch agent (#8378) 2025-10-21 15:49:20 -07:00
hub merge: main 2025-11-18 16:32:54 -08:00
llm-info feat(cohere): add support from Reasoning/Vision/Translate models 2025-11-04 20:25:44 -03:00
openai-adapters fix(openai-adapters): extend auth header override to support x-api-key (#8779) 2025-11-19 14:33:55 -08:00
terminal-security build(deps-dev): bump vite in /packages/terminal-security 2025-09-11 01:41:52 +00:00
shared-release.config.js fix prettier 2025-07-18 19:20:13 +02:00