Skip to content

Comments

feat(api): send X-KiloCode-Mode header#5649

Merged
iscekic merged 3 commits intomainfrom
send-x-kilocode-mode-header
Feb 4, 2026
Merged

feat(api): send X-KiloCode-Mode header#5649
iscekic merged 3 commits intomainfrom
send-x-kilocode-mode-header

Conversation

@iscekic
Copy link
Collaborator

@iscekic iscekic commented Feb 4, 2026

No description provided.

Add X-KiloCode-Mode header constant and include it on OpenRouter
requests when metadata.mode is provided.
@iscekic iscekic requested review from Copilot and markijbema February 4, 2026 12:32
@iscekic iscekic self-assigned this Feb 4, 2026
@changeset-bot
Copy link

changeset-bot bot commented Feb 4, 2026

🦋 Changeset detected

Latest commit: 151466e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kiloconnect
Copy link
Contributor

kiloconnect bot commented Feb 4, 2026

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
src/shared/kilocode/headers.ts 7 Header constant casing is inconsistent (X_KILOCODE_TESTER value is "X-KILOCODE-TESTER" while other headers use "X-KiloCode-*")
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
src/api/providers/kilocode-openrouter.ts 63-65 Existing review note: metadata.mode is forwarded into an HTTP header. Ensure mode remains constrained to known values to avoid log/header injection surprises.
Files Reviewed (4 files)
  • .changeset/light-birds-admire.md - 0 issues
  • src/shared/kilocode/headers.ts - 1 issue
  • src/api/providers/kilocode-openrouter.ts - 0 new issues (see existing inline comment)
  • src/api/providers/__tests__/kilocode-openrouter.spec.ts - 0 issues

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for sending the mode information to the KiloCode backend via the X-KiloCode-Mode HTTP header when making API requests.

Changes:

  • Added a new X_KILOCODE_MODE header constant
  • Updated KilocodeOpenrouterHandler to include the mode header when metadata.mode is provided

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/shared/kilocode/headers.ts Added X_KILOCODE_MODE constant definition following the existing naming convention for KiloCode headers
src/api/providers/kilocode-openrouter.ts Imported the new mode header constant and added conditional logic to include it in request headers when mode is present in metadata

Update all test cases in kilocode-openrouter spec to include the X_KILOCODE_MODE header with value "code" in expected results, aligning with the feature implementation that sends this header in API requests.
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.

2 participants