feat(openrouter): expand app attribution categories · openclaw/openclaw@f1340be
vincentkoc
·
2026-05-04
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -26,6 +26,7 @@ Docs: https://docs.openclaw.ai
|
26 | 26 | - Plugins/CLI: include package dependency install state in `openclaw plugins list --json` so scripts can spot missing plugin dependencies without runtime-loading plugins. |
27 | 27 | - Discord/status: add degraded Discord transport and gateway event-loop starvation signals to `openclaw channels status`, `openclaw status --deep`, and fetch-timeout logs so intermittent socket resets do not look like a healthy running channel. (#76327) Thanks @joshavant. |
28 | 28 | - Providers/OpenRouter: add opt-in response caching params that send OpenRouter's `X-OpenRouter-Cache`, `X-OpenRouter-Cache-TTL`, and cache-clear headers only on verified OpenRouter routes. Thanks @vincentkoc. |
| 29 | +- Providers/OpenRouter: expand app-attribution categories so OpenClaw advertises coding, programming, writing, chat, and personal-agent usage on verified OpenRouter routes. Thanks @vincentkoc. |
29 | 30 | - Plugins/update: on the beta OpenClaw update channel, default-line npm and ClawHub plugin updates try `@beta` first and fall back to default/latest when no plugin beta release exists. |
30 | 31 | - Channels/WhatsApp: support explicit WhatsApp Channel/Newsletter `@newsletter` outbound message targets with channel session metadata instead of DM routing. Fixes #13417; carries forward the narrow outbound target idea from #13424. Thanks @vincentkoc and @agentz-manfred. |
31 | 32 | - Exec approvals: add a tree-sitter-backed shell command explainer for future approval and command-review surfaces. (#75004) Thanks @jesse-merhi. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -139,11 +139,11 @@ OpenRouter uses a Bearer token with your API key under the hood.
|
139 | 139 | On real OpenRouter requests (`https://openrouter.ai/api/v1`), OpenClaw also adds |
140 | 140 | OpenRouter's documented app-attribution headers: |
141 | 141 | |
142 | | -| Header | Value | |
143 | | -| ------------------------- | --------------------- | |
144 | | -| `HTTP-Referer` | `https://openclaw.ai` | |
145 | | -| `X-OpenRouter-Title` | `OpenClaw` | |
146 | | -| `X-OpenRouter-Categories` | `cli-agent` | |
| 142 | +| Header | Value | |
| 143 | +| ------------------------- | ------------------------------------------------------------------------------------------------------ | |
| 144 | +| `HTTP-Referer` | `https://openclaw.ai` | |
| 145 | +| `X-OpenRouter-Title` | `OpenClaw` | |
| 146 | +| `X-OpenRouter-Categories` | `cli-agent,cloud-agent,programming-app,creative-writing,writing-assistant,general-chat,personal-agent` | |
147 | 147 | |
148 | 148 | <Warning> |
149 | 149 | If you repoint the OpenRouter provider at some other proxy or base URL, OpenClaw |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -56,7 +56,8 @@ describe("proxy stream wrappers", () => {
|
56 | 56 | headers: { |
57 | 57 | "HTTP-Referer": "https://openclaw.ai", |
58 | 58 | "X-OpenRouter-Title": "OpenClaw", |
59 | | -"X-OpenRouter-Categories": "cli-agent", |
| 59 | +"X-OpenRouter-Categories": |
| 60 | +"cli-agent,cloud-agent,programming-app,creative-writing,writing-assistant,general-chat,personal-agent", |
60 | 61 | "X-Custom": "1", |
61 | 62 | }, |
62 | 63 | }, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -115,7 +115,8 @@ describe("provider attribution", () => {
|
115 | 115 | headers: { |
116 | 116 | "HTTP-Referer": "https://openclaw.ai", |
117 | 117 | "X-OpenRouter-Title": "OpenClaw", |
118 | | -"X-OpenRouter-Categories": "cli-agent", |
| 118 | +"X-OpenRouter-Categories": |
| 119 | +"cli-agent,cloud-agent,programming-app,creative-writing,writing-assistant,general-chat,personal-agent", |
119 | 120 | }, |
120 | 121 | }); |
121 | 122 | }); |
@@ -128,7 +129,8 @@ describe("provider attribution", () => {
|
128 | 129 | ).toEqual({ |
129 | 130 | "HTTP-Referer": "https://openclaw.ai", |
130 | 131 | "X-OpenRouter-Title": "OpenClaw", |
131 | | -"X-OpenRouter-Categories": "cli-agent", |
| 132 | +"X-OpenRouter-Categories": |
| 133 | +"cli-agent,cloud-agent,programming-app,creative-writing,writing-assistant,general-chat,personal-agent", |
132 | 134 | }); |
133 | 135 | }); |
134 | 136 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -123,6 +123,8 @@ function readCompatBoolean(
|
123 | 123 | |
124 | 124 | const OPENCLAW_ATTRIBUTION_PRODUCT = "OpenClaw"; |
125 | 125 | const OPENCLAW_ATTRIBUTION_ORIGINATOR = "openclaw"; |
| 126 | +const OPENROUTER_ATTRIBUTION_CATEGORIES = |
| 127 | +"cli-agent,cloud-agent,programming-app,creative-writing,writing-assistant,general-chat,personal-agent"; |
126 | 128 | |
127 | 129 | const LOCAL_ENDPOINT_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]); |
128 | 130 | const OPENAI_RESPONSES_APIS = new Set([ |
@@ -473,7 +475,7 @@ function buildOpenRouterAttributionPolicy(
|
473 | 475 | headers: { |
474 | 476 | "HTTP-Referer": "https://openclaw.ai", |
475 | 477 | "X-OpenRouter-Title": identity.product, |
476 | | -"X-OpenRouter-Categories": "cli-agent", |
| 478 | +"X-OpenRouter-Categories": OPENROUTER_ATTRIBUTION_CATEGORIES, |
477 | 479 | }, |
478 | 480 | }; |
479 | 481 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -457,7 +457,8 @@ describe("provider request config", () => {
|
457 | 457 | expect(resolved).toEqual({ |
458 | 458 | "HTTP-Referer": "https://openclaw.ai", |
459 | 459 | "X-OpenRouter-Title": "OpenClaw", |
460 | | -"X-OpenRouter-Categories": "cli-agent", |
| 460 | +"X-OpenRouter-Categories": |
| 461 | +"cli-agent,cloud-agent,programming-app,creative-writing,writing-assistant,general-chat,personal-agent", |
461 | 462 | "X-Custom": "1", |
462 | 463 | }); |
463 | 464 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。