openclaw-windows-node icon indicating copy to clipboard operation
openclaw-windows-node copied to clipboard

OpenClaw Config: You can't set headers for an embedding provider

Open Stevenic opened this issue 5 months ago β€’ 3 comments

I'm trying to configure an Azure Foundry embeddings provider and I need to be able to add an "api-key" header according to OpenClaw. I'm having to do this manually since OpenClaw isn't allowed to edit it's own settings :(

The problem is the UI treats the header field as a string so you're not able to configure the headers object. Since there's no "raw" mode my only option is to drop out to the terminal and use the CLI:

Image

Also notice that API key field isn't properly left aligned.

Stevenic avatar Jun 02 '26 23:06 Stevenic

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 2, 2026, 8:00 PM ET / 00:00 UTC.

Summary Keep open. Current main still routes object-valued config schema fields without fixed child properties through the scalar editor path, so provider headers can be staged and saved as a string instead of a JSON object.

Reproducibility: yes. from source inspection: an object-valued schema field without fixed properties falls through to the string editor and stages text for save. I did not run the WinUI app or a live Azure Foundry gateway, so this is source-reproducible rather than an executed UI repro.

Next step This is a narrow config editor repair with clear source files and validation commands, and it does not require a new config option or product decision.

Review details

Best possible solution:

Add generic object-map editing for schema fields like headers, preserving JSON object values through validation and save while keeping existing scalar and array behavior intact.

Do we have a high-confidence way to reproduce the issue?

Yes, from source inspection: an object-valued schema field without fixed properties falls through to the string editor and stages text for save. I did not run the WinUI app or a live Azure Foundry gateway, so this is source-reproducible rather than an executed UI repro.

Is this the best way to solve the issue?

Yes, the best fix is in the existing schema config editor: support object/additionalProperties fields as JSON objects or key-value maps instead of adding provider-specific Azure-only UI or relying on the CLI workaround.

AGENTS.md: found and applied where relevant.

Remaining risk / open question:

  • The exact Azure Foundry schema is not checked into this repository, so the repro is source-based against the generic object-schema path plus the issue screenshot rather than a live gateway run.

Codex review notes: model gpt-5.5, reasoning high; reviewed against bfeb3b5c90be.

Label changes

Label changes:

  • add P2: This blocks configuring at least one embedding provider through the supported Config UI, but there is a CLI workaround and limited blast radius.
  • add impact:auth-provider: The affected field is provider authentication/configuration data needed to route embedding requests to Azure Foundry.
  • add issue-rating: 🐚 platinum hermit: Current issue advisory state selects this label.
  • add clawsweeper:needs-live-repro: Current issue advisory state selects this label.
  • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
  • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.

Label justifications:

  • P2: This blocks configuring at least one embedding provider through the supported Config UI, but there is a CLI workaround and limited blast radius.
  • impact:auth-provider: The affected field is provider authentication/configuration data needed to route embedding requests to Azure Foundry.
Evidence reviewed

Acceptance criteria:

  • ./build.ps1
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore

What I checked:

Likely related people:

  • RΓ©gis Brid: git blame and git log --follow attribute the current SchemaConfigEditor, ConfigPage, and ConfigEditorModel implementation to commit 7d9152f427a3007cbe663513ef34c89719473a41. (role: introduced current config editor behavior; confidence: medium; commits: 7d9152f427a3; files: src/OpenClaw.Tray.WinUI/Controls/SchemaConfigEditor.xaml.cs, src/OpenClaw.Tray.WinUI/Pages/ConfigPage.xaml.cs, src/OpenClaw.Tray.WinUI/Services/ConfigEditorModel.cs)
How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

clawsweeper[bot] avatar Jun 02 '26 23:06 clawsweeper[bot]

πŸ€– This is an automated response from Repo Assist.

Thanks for the clear repro, @Stevenic! This is a known limitation in the embedding provider configuration UI β€” the headers field is currently treated as a plain string input instead of a structured key-value editor, so there's no way to set an object like {"api-key": "..."} through the GUI.

Workaround (until the UI is fixed): You've already found the right path β€” use the CLI directly:

openclaw config set embeddings.provider.headers '{"api-key": "YOUR_KEY"}'

For the root cause: the settings form likely needs a dedicated key-value pair editor component for header fields, similar to how environment variable editors work in other tools. A fix would involve updating the embedding provider settings page to detect object-typed fields and render a multi-row editor rather than a single text input.

The API key alignment issue (not left-aligned) appears to be a separate layout bug in the same settings panel and could be fixed alongside this.

This is a good enhancement to have on the backlog β€” the Azure Foundry / OpenAI-compatible embeddings path is increasingly common and headers (for api-key) are required by most providers.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

github-actions[bot] avatar Jun 03 '26 01:06 github-actions[bot]

πŸ€– This is an automated response from Repo Assist.

I've submitted a fix for this in a draft PR. The change adds a RenderJsonObjectField method to SchemaConfigEditor that:

  • Renders a JSON text editor (multi-line, monospaced) for object-typed schema fields without fixed properties
  • Pre-populates with the current value (or {} if not set)
  • Validates JSON on each keystroke and keeps Save disabled until the input is a valid object
  • Shows an inline error when the input is not a valid JSON object

This is the same pattern already used for complex array fields. Once it lands, the headers field in the embedding provider config will render a proper JSON editor instead of a plain text box.

Generated by 🌈 Repo Assist, see workflow run.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

github-actions[bot] avatar Jun 04 '26 01:06 github-actions[bot]