Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cold-tips-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Fix Custom Headers are not saved for OpenAI Compatible providers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useCallback } from "react"
import { useState, useCallback, useEffect } from "react"
import { useEvent } from "react-use"
import { Checkbox } from "vscrui"
import { VSCodeButton, VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
Expand Down Expand Up @@ -92,6 +92,15 @@ export const OpenAICompatible = ({ apiConfiguration, setApiConfigurationField }:

useEvent("message", onMessage)

// kilocode_change start
// Update the main configuration whenever custom headers change
useEffect(() => {
// Convert the array of [key, value] pairs to an object, filtering out headers with empty keys
const headersObject = Object.fromEntries(customHeaders.filter(([key]) => key.trim() !== ""))
setApiConfigurationField("openAiHeaders", headersObject)
}, [customHeaders, setApiConfigurationField])
// kilocode_change end

return (
<>
<VSCodeTextField
Expand Down