Skip to content

ENG-1784: Tag CLI harness traffic with X-Requesty-Client - #35

Open
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
feat/eng-1784-inject-cli-client-header
Open

devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
feat/eng-1784-inject-cli-client-header

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Right now nothing tells a harness the CLI set up apart from one set up by hand: X-Title / HTTP-Referer carry the same values our docs tell people to paste in. This PR makes every harness the CLI configures or launches send

X-Requesty-Client: requesty-cli
X-Requesty-Client-Version: 0.4.0   // requestyClientVersion(): version.Version without goreleaser's "v"; "dev" for local builds

The router already copies X-Requesty-* headers into chat_interactions.extra with the prefix removed (Client, Client-Version). So no backend change is needed, and CLI adoption becomes:

SELECT JSONExtractString(extra, 'Client-Version') AS version, uniqExact(organization_id) AS orgs
FROM olap.chat_interactions
WHERE JSONExtractString(extra, 'Client') = 'requesty-cli' AND created_at >= now() - INTERVAL 30 DAY
GROUP BY version

Where each harness gets them (configure + launch):

Harness Location
Codex model_providers.requesty.http_headers (config, and -c overrides on launch)
OpenCode provider.requesty.options.headers
Pi / DeepSeek Harness provider headers; Pi launch passes REQUESTY_CLIENT_VERSION to the embedded extension
Claude Code ANTHROPIC_CUSTOM_HEADERS (Name: Value lines) in settings.json env and the launch env. withRequestyClientHeaders keeps any headers the user already has and replaces older client/version lines
Hermes custom_providers[requesty].extra_headers

Hermes fix. The CLI used to write model.default_headers, but Hermes skips those when api_mode: anthropic_messages (client_lifecycle.py). That is the mode we configure, so those headers were never sent. Provider extra_headers is applied on that route too (anthropic_adapter.py, docs). The title header was also X-Origin-Title, which the router doesn't read. It is now X-Title: Hermes Agent, matching the backend's types.TitleHermes.

 model:
   default: ...
   provider: requesty
-  default_headers: {HTTP-Referer: ..., X-Origin-Title: Hermes}
 custom_providers:
   - name: requesty
     api_mode: anthropic_messages
+    extra_headers:
+      HTTP-Referer: https://hermes-agent.nousresearch.com
+      X-Title: Hermes Agent
+      X-Requesty-Client: requesty-cli
+      X-Requesty-Client-Version: <version>

When merging into an existing Hermes config, an old model.default_headers block is left alone. It has no effect in anthropic_messages mode.

Known gaps

  • requesty hermes (launch without configure) is not tagged. It uses --provider custom plus CUSTOM_BASE_URL, and Hermes has no environment variable for headers.
  • Claude Code only sends ANTHROPIC_CUSTOM_HEADERS on versions that support it. Older versions ignore the variable, so nothing breaks.

Checks: gofmt -l . (clean), go vet ./..., go test ./..., go build.

Link to Devin session: https://app.devin.ai/sessions/70942c1e50ba4f32803b5988575ced4a
Open in Devin Desktop: https://app.devin.ai/desktop/session/70942c1e50ba4f32803b5988575ced4a?variant=devin
Requested by: @Thibault00

Every harness the CLI configures or launches now sends
X-Requesty-Client: requesty-cli/<version>, which the router stores in
chat_interactions.extra as Client. Hermes headers move from
model.default_headers, which Hermes skips in anthropic_messages mode, to
the provider's extra_headers, and use X-Title instead of X-Origin-Title.

Co-Authored-By: thibault <thibault.jaigu@gmail.com>
@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

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

AI Cost

No spend detected for branch feat/eng-1784-inject-cli-client-header in the last 30 days.

Updated 2026-09-30T10:17Z · last 30 days · data from Requesty

@github-actions github-actions Bot added the cost:$0.00 AI cost for this branch label Sep 30, 2026
@lavicosa

Copy link
Copy Markdown
Collaborator

Let's break up the headers into something like:
X-Requesty-Client: requesty-cli
X-Requesty-Client-Version: 0.4.0

…sion

Co-Authored-By: thibault <thibault.jaigu@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@lavicosa Done in 91c96ee. Every harness now sends X-Requesty-Client: requesty-cli and X-Requesty-Client-Version: 0.4.0. The version is version.Version without the leading v that goreleaser adds, and dev for local builds. In ClickHouse these show up as extra.Client and extra.Client-Version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cost:$0.00 AI cost for this branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant