Skip to content

Add authentication.<configKey>.customHeaders settings#13664

Merged
samclark2015 merged 5 commits into
mainfrom
sclark/assistant-customHeaders-schema
May 21, 2026
Merged

Add authentication.<configKey>.customHeaders settings#13664
samclark2015 merged 5 commits into
mainfrom
sclark/assistant-customHeaders-schema

Conversation

@samclark2015

@samclark2015 samclark2015 commented May 20, 2026

Copy link
Copy Markdown
Contributor

Addresses posit-dev/assistant#1066.

Summary

Mirrors the existing authentication.<configKey>.baseUrl schema with a companion authentication.<configKey>.customHeaders setting for each provider whose auth lives in this extension:

  • authentication.anthropic.customHeaders
  • authentication.foundry.customHeaders
  • authentication.openai-api.customHeaders
  • authentication.google.customHeaders
  • authentication.openai-compatible.customHeaders
  • authentication.snowflake.customHeaders

This lets users attach extra HTTP headers (e.g. enterprise gateway requirements such as x-databricks-use-coding-agent-mode) to every request a provider makes.

Contribution metadata only — no runtime changes in this extension. Posit Assistant reads authentication.<configKey>.customHeaders directly via the VS Code config API; the schema here just gives the setting defaults and Settings-UI intellisense.

Release Notes

New Features

  • Added authentication.<configKey>.customHeaders settings to attach extra HTTP headers to provider requests (posit-dev/assistant#1066)

Bug Fixes

  • N/A

Validation Steps

@:posit-assistant

  1. Open Settings, search "customHeaders", and confirm six new entries appear (one per provider: anthropic, foundry, openai-api, google, openai-compatible, snowflake) with their descriptions under Authentication.
  2. In settings.json, set e.g. "authentication.openai-api.customHeaders": { "x-foo": "bar" } — confirm JSON intellisense and validation accept the object/string-value shape.
  3. With a corresponding Posit Assistant build, send an OpenAI request and confirm x-foo: bar is on the outgoing HTTP request.
  4. Repeat step 3 for Snowflake Cortex with "authentication.snowflake.customHeaders": { "x-foo": "bar" }.

samclark2015 and others added 3 commits May 20, 2026 12:59
Mirror the existing authentication.<configKey>.baseUrl pattern so users
can attach extra HTTP headers to every request for each provider whose
auth lives in this extension (anthropic, foundry, openai-api, google,
openai-compatible).

Posit Assistant reads these directly via the VS Code config API; this
extension's role here is contribution metadata only (schema, defaults,
and Settings-UI intellisense).

Addresses posit-dev/positron-assistant#1066.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The runtime read path (Posit Assistant) already supports Snowflake
customHeaders end-to-end; this exposes it in the Settings UI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…omHeaders-schema

# Conflicts:
#	extensions/authentication/package.nls.json
@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:posit-assistant

readme  valid tags

@samclark2015

Copy link
Copy Markdown
Contributor Author

/recheck-tests

@github-actions

Copy link
Copy Markdown

PETE's assessment 🧪

Verdict: Not applicable -- the PR adds only VS Code contribution-point schema (package.json) and NLS description strings (package.nls.json); there is no runtime logic in this repo to test.

What changed

  • extensions/authentication/package.json:111-188 -- declares six new authentication.<provider>.customHeaders settings (type object, additionalProperties: string, default {}) mirroring existing baseUrl entries
  • extensions/authentication/package.nls.json:5-15 -- adds six description strings for the new settings

Tests in this PR

None. No test files were added or modified.

Existing coverage

Not applicable. The changes are pure VS Code extension manifest metadata: they tell VS Code what settings exist, their JSON Schema shape, and their Settings-UI descriptions. No runtime code was added or changed in this extension. The actual logic that reads authentication.<configKey>.customHeaders and injects headers into HTTP requests lives in posit-dev/assistant (a separate repo, validated manually per the PR's step 3–4).

Suggested additions

None. VS Code contribution point declarations and NLS translation strings are not testable with unit, extension-host, or e2e tests in the normal sense -- correctness is verified by VS Code's own manifest loader and by the manual Settings UI checks described in the PR's validation steps.


PETE (Positron Extreme Test Experiment) - LLM-based test-coverage advisor, in pilot. Triggers on PR open and on /recheck-tests comments. Wrong verdict? Add a /recheck-tests comment to this PR to re-run, or ping @jonvanausdeln. Please share feedback on how PETE performed here.

Comment thread extensions/authentication/package.nls.json Outdated
Per review feedback: every customHeaders entry now uses the same
two-sentence description, with only the provider name varying. Drops
the per-provider SDK-managed header lists and the additive-vs-clobber
implementation detail — both noise for a settings.json reader.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@melissa-barca melissa-barca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@samclark2015 samclark2015 merged commit 96d5f24 into main May 21, 2026
24 checks passed
@samclark2015 samclark2015 deleted the sclark/assistant-customHeaders-schema branch May 21, 2026 14:49
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants