Skip to content

feat(harness): attribute OpenRouter requests to CodeWork - #69

Merged
sanchitrk merged 1 commit into
canaryfrom
claude/openrouter-app-identification-1782ee
Oct 11, 2026
Merged

sanchitrk merged 1 commit into
canaryfrom
claude/openrouter-app-identification-1782ee

Conversation

@sanchitrk

Copy link
Copy Markdown
Contributor

OpenRouter showed requests from the app as "Unknown" because no app-attribution headers were sent.

  • New packages/harness/src/runner/attribution.ts adds default headers for OpenRouter models (provider openrouter or a base URL on openrouter.ai):
    • HTTP-Referer: https://codework.sh
    • X-OpenRouter-Title: CodeWork
    • X-OpenRouter-Categories: cli-agent,personal-agent
  • Defaults sit under the model's own headers, so a configured header with the same name wins.
  • Applied in runner/llm.ts before each request.
  • Test helper referer aligned to https://codework.sh, so test traffic attributes to the same app.

No visibility header is sent, so the app is public.

Verified: harness typecheck passes; OpenRouter stream E2E (28 tests) passed and the dashboard shows CodeWork.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sanchitrk
sanchitrk merged commit 2dc8bd7 into canary Oct 11, 2026
@sanchitrk
sanchitrk deleted the claude/openrouter-app-identification-1782ee branch October 11, 2026 19:16
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