* 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>