Skip to content

feat(llm): send app attribution headers to Vercel AI Gateway - #1603

Merged
0xallam merged 1 commit into
mainfrom
feat/str-1721-vercel-ai-gateway-attribution
Oct 28, 2026
Merged

0xallam merged 1 commit into
mainfrom
feat/str-1721-vercel-ai-gateway-attribution

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Vercel AI Gateway reads the same HTTP-Referer and X-Title headers as OpenRouter for app attribution. Strix only sent them for openrouter/ models, so vercel_ai_gateway/... requests went out unattributed.

APP_ATTRIBUTION_HEADERS = {"HTTP-Referer": "https://strix.ai", "X-Title": "Strix"}
OPENROUTER_ATTRIBUTION_HEADERS = {**APP_ATTRIBUTION_HEADERS, "X-OpenRouter-Categories": "cli-agent"}

attribution_headers("openrouter/...")         # referer, title, categories (unchanged)
attribution_headers("vercel_ai_gateway/...")  # referer, title
attribution_headers("openai/...")             # {}

attribution_headers feeds both litellm.headers and the per-request headers. LLM_EXTRA_HEADERS still overrides.

Closes STR-1721

Link to Devin session: https://app.devin.ai/sessions/fbffcc99b0064fdc8a53e151e75e369a
Open in Devin Desktop: https://app.devin.ai/desktop/session/fbffcc99b0064fdc8a53e151e75e369a?variant=devin

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects outbound LLM requests using Vercel AI Gateway.

The PR appears safe to merge, with a non-blocking gap for Vercel models using the explicit litellm/ prefix.

Findings

  1. P2 Explicit prefix skips attribution ▶
Fix with agent prompt
### Issue 1
strix/config/models.py:903
`is_vercel_ai_gateway_model` misses the supported `litellm/vercel_ai_gateway/...` form. `StrixProvider` accepts the explicit `litellm/` prefix, but both header paths check the original model name. Those requests still lack `HTTP-Referer` and `X-Title`, leaving the attribution fix incomplete. Strip the optional `litellm/` prefix before matching, and test both forms.

```suggestion
    name = (model_name or "").strip().lower().removeprefix("litellm/")
    return name.startswith("vercel_ai_gateway/")
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds shared app attribution headers for Vercel AI Gateway while keeping OpenRouter's category header.

  • Vercel AI Gateway requests identify Strix with app headers.

Reviews (1) · Last reviewed commit: "feat(llm): send app attribution headers ..." · Reviewed by Greptile

Comment thread strix/config/models.py
@0xallam
0xallam merged commit 98e3df1 into main Oct 28, 2026
12 of 15 checks passed
@0xallam
0xallam deleted the feat/str-1721-vercel-ai-gateway-attribution branch October 28, 2026 03:04
samirhvbr added a commit to samirhvbr/strix that referenced this pull request Oct 29, 2026
…box image delivery blocker

Second pass over the review branch, with both remotes fetched. Upstream main did not move (still 6b7ae2e, the
synchronized base), so no code checkpoint advances.

Known items: all 530 upstream ledger records and the 44 fork PRs were compared with the live API on state, updated
date and head SHA. Only usestrix#1393 changed (rebased onto 6b7ae2e with four commits of its own); it is re-reviewed in depth
and stays deferred, with the reasons recorded. Open inventory is unchanged at 320 PRs + 203 issues.

Discovery: the 48-hour-overlap update query returned 29 items. Four closed items were not in the ledger and now are:
PRs usestrix#1616, usestrix#1617 and usestrix#1603, merged upstream and already ancestors of the branch through the base synchronization, and
issue usestrix#1529, a usage question. The ledger has 574 records; coverage totals are recomputed from it.

Version and releases rechecked and unchanged: 1.2.43 equals the tag, the Latest Release and remote master; upstream's
latest release is still v1.7.0.

New delivery blocker: the synchronized source defaults to ghcr.io/usestrix/strix-sandbox:1.3.1, which is not
published (manifest 404; 1.3.0 answers 200 as the control). master pins the published 1.3.0. Recorded in
release-audit.json, the checkpoints, the round report, the continuity guide and version.md. No tag, release, mirror or
master change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TavwVMH7PvrD68JTDfd6Hb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant