Skip to content

feat: send x-grok-user-id from the source's quirks - #40

Merged
TheGreatAxios merged 1 commit into
mainfrom
feat/user-id-quirk
Oct 29, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
feat/user-id-quirk

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #39

What changed

  • createXaiResponsesAdapter parses per-source quirks as { userId? } (visible ASCII only) and sends userId as the x-grok-user-id static header. Without one, the adapter is built from the module-level factory as before.
  • providerOptions[XAI_USER_ID_OPTION] still overrides it per call.
  • Behaviour change: unknown quirk keys, previously ignored, are now rejected at construction.
  • README documents the quirk as the path for Interchange catalog sources and that it must match the credential's account.

Verification

  • bun run check (typecheck, lint, format, 5 unit tests) passes.
  • New tests pin the header from the quirk, the option override, and rejection of a header-splitting value.
  • Independent review findings addressed (stricter value check, parse-once factory, test matcher, docs).

An Interchange catalog source carries no providerOptions, so a deployment can now state the user id as quirks.userId. A per-call option still overrides it. Unknown quirk keys, previously ignored, are now rejected.
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review October 29, 2026 19:41
@corbits-triage

corbits-triage Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

Triage will approve, request review.

@TheGreatAxios
TheGreatAxios merged commit 596cb8c into main Oct 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send x-grok-user-id from the source's quirks

1 participant