Repository navigation
feat: OpenRouter app attribution on every harness - #1235
Merged
Merged
Conversation
Every OpenRouter inference request now carries HTTP-Referer, X-OpenRouter-Title, the legacy X-Title and X-OpenRouter-Categories, from one shared helper (harness-adapter/lib/openrouter-attribution.sh). The referer stays the apex https://aeon.fun, which is what aeon's existing OpenRouter app is keyed on. - claude via the openrouter gateway: ANTHROPIC_CUSTOM_HEADERS gains the two new headers - codex: model_providers.openrouter.http_headers - kimi: providers.openrouter.custom_headers - vibe: providers extra_headers - pi: models.json headers on its built-in openrouter provider (merged, not overwritten) - hermes: model.default_headers in the adapter's scratch HOME config.yaml OPENROUTER_SITE_URL / OPENROUTER_APP_TITLE still override, now on every harness; OPENROUTER_APP_CATEGORIES is new. Unit tests cover each config and the CLI smoke checks every call to the fake upstream carried the headers.
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every OpenRouter inference request aeon makes now carries the app attribution headers, so usage counts on aeon's OpenRouter app page (openrouter.ai/apps?url=https://aeon.fun).
Headers (one shared helper,
harness-adapter/lib/openrouter-attribution.sh):HTTP-Referer: https://aeon.fun(apex on purpose: the existing app page is keyed on it, a www referer would start a second, empty app)X-OpenRouter-Title: Aeonplus the legacyX-Title: AeonX-OpenRouter-Categories: personal-agent,cloud-agentOPENROUTER_SITE_URL/OPENROUTER_APP_TITLEstill override (now on every harness, not only Claude);OPENROUTER_APP_CATEGORIESis new.Call sites covered
gateway: openrouter(scripts/llm-gateway.sh)ANTHROPIC_CUSTOM_HEADERSgains X-OpenRouter-Title + Categoriesinstall-harness.sh)model_providers.openrouter.http_headersmodel-provider-infoinstall-harness.sh)providers.openrouter.custom_headersinstall-harness.sh)[[providers]] extra_headersProviderConfig+ agent loopinstall-harness.sh)models.jsonproviders.openrouter.headers(headers-only entry keeps built-in models; merged into an existing file)model-config.ts,provider-attribution.ts(config headers override pi's own pi.dev ones)adapters/hermes.sh)model.default_headersin the scratch-HOMEconfig.yaml, OpenRouter mode onlyclient_lifecycle.py/auxiliary_client.py(user headers win over its "Hermes Agent" ones)Hermes is done in the adapter, not install-harness, because it runs under a fresh scratch HOME per call.
Not covered, and why
vars.OPENROUTER_SITE_URL/vars.OPENROUTER_APP_TITLEinto the run env, so in CI the overrides only work if set some other way. Left as is.Tests
test_llm_gateway.sh: the exact ANTHROPIC_CUSTOM_HEADERS set, and that the overrides still worktest_install_harness.sh: codex/kimi/vibe TOML lines, the pi models.json merge, and pi native-key staging no models.jsontest_hermes_adapter.sh: the staged config.yaml in OpenRouter mode (parsed as YAML), and none with a Nous loginharness_cli_smoke.sh(ci-harness-cli): codex, kimi, vibe and pi now check that every POST the real pinned CLI sent to the fake upstream carried all four headersNeed help on this PR? Tag
@codesmith-botwith what you need.