From 261a7dd50538037795243d82c1eda63babe88962 Mon Sep 17 00:00:00 2001 From: Bee <68532117+abeatrix@users.noreply.github.com> Date: Tue, 4 Nov 2025 07:01:14 +0800 Subject: [PATCH] fix: enable Add Header button in OpenAICompatibleProvider (#7246) * fix: enable Add Header button in OpenAICompatibleProvider Implement functionality for the Add Header button that was previously disabled. The button now: - Enables when headers are not managed by remote configuration - Creates new header entries with auto-incremented keys (header1, header2, etc.) - Updates the API configuration state with the new header This allows users to add custom headers to their OpenAI-compatible provider configuration unless restricted by organization settings. * add changeset --- .changeset/hip-dingos-find.md | 5 +++++ .../settings/providers/OpenAICompatible.tsx | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .changeset/hip-dingos-find.md diff --git a/.changeset/hip-dingos-find.md b/.changeset/hip-dingos-find.md new file mode 100644 index 00000000..420d9ab3 --- /dev/null +++ b/.changeset/hip-dingos-find.md @@ -0,0 +1,5 @@ +--- +"claude-dev": patch +--- + +fix: enable Add Header button in OpenAICompatibleProvider UI diff --git a/webview-ui/src/components/settings/providers/OpenAICompatible.tsx b/webview-ui/src/components/settings/providers/OpenAICompatible.tsx index 98946533..a2c52732 100644 --- a/webview-ui/src/components/settings/providers/OpenAICompatible.tsx +++ b/webview-ui/src/components/settings/providers/OpenAICompatible.tsx @@ -137,7 +137,17 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod This setting is managed by your organization's remote configuration - Add Header + { + const currentHeaders = { ...(apiConfiguration?.openAiHeaders || {}) } + const headerCount = Object.keys(currentHeaders).length + const newKey = `header${headerCount + 1}` + currentHeaders[newKey] = "" + handleFieldChange("openAiHeaders", currentHeaders) + }}> + Add Header +