mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:50:43 +00:00
feat(openrouter): expand app attribution categories
This commit is contained in:
@@ -26,6 +26,7 @@ Docs: https://docs.openclaw.ai
|
||||
- Plugins/CLI: include package dependency install state in `openclaw plugins list --json` so scripts can spot missing plugin dependencies without runtime-loading plugins.
|
||||
- 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.
|
||||
- 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.
|
||||
- Providers/OpenRouter: expand app-attribution categories so OpenClaw advertises coding, programming, writing, chat, and personal-agent usage on verified OpenRouter routes. Thanks @vincentkoc.
|
||||
- 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.
|
||||
- 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.
|
||||
- Exec approvals: add a tree-sitter-backed shell command explainer for future approval and command-review surfaces. (#75004) Thanks @jesse-merhi.
|
||||
|
||||
@@ -139,11 +139,11 @@ OpenRouter uses a Bearer token with your API key under the hood.
|
||||
On real OpenRouter requests (`https://openrouter.ai/api/v1`), OpenClaw also adds
|
||||
OpenRouter's documented app-attribution headers:
|
||||
|
||||
| Header | Value |
|
||||
| ------------------------- | --------------------- |
|
||||
| `HTTP-Referer` | `https://openclaw.ai` |
|
||||
| `X-OpenRouter-Title` | `OpenClaw` |
|
||||
| `X-OpenRouter-Categories` | `cli-agent` |
|
||||
| Header | Value |
|
||||
| ------------------------- | ------------------------------------------------------------------------------------------------------ |
|
||||
| `HTTP-Referer` | `https://openclaw.ai` |
|
||||
| `X-OpenRouter-Title` | `OpenClaw` |
|
||||
| `X-OpenRouter-Categories` | `cli-agent,cloud-agent,programming-app,creative-writing,writing-assistant,general-chat,personal-agent` |
|
||||
|
||||
<Warning>
|
||||
If you repoint the OpenRouter provider at some other proxy or base URL, OpenClaw
|
||||
|
||||
@@ -56,7 +56,8 @@ describe("proxy stream wrappers", () => {
|
||||
headers: {
|
||||
"HTTP-Referer": "https://openclaw.ai",
|
||||
"X-OpenRouter-Title": "OpenClaw",
|
||||
"X-OpenRouter-Categories": "cli-agent",
|
||||
"X-OpenRouter-Categories":
|
||||
"cli-agent,cloud-agent,programming-app,creative-writing,writing-assistant,general-chat,personal-agent",
|
||||
"X-Custom": "1",
|
||||
},
|
||||
},
|
||||
|
||||
@@ -115,7 +115,8 @@ describe("provider attribution", () => {
|
||||
headers: {
|
||||
"HTTP-Referer": "https://openclaw.ai",
|
||||
"X-OpenRouter-Title": "OpenClaw",
|
||||
"X-OpenRouter-Categories": "cli-agent",
|
||||
"X-OpenRouter-Categories":
|
||||
"cli-agent,cloud-agent,programming-app,creative-writing,writing-assistant,general-chat,personal-agent",
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -128,7 +129,8 @@ describe("provider attribution", () => {
|
||||
).toEqual({
|
||||
"HTTP-Referer": "https://openclaw.ai",
|
||||
"X-OpenRouter-Title": "OpenClaw",
|
||||
"X-OpenRouter-Categories": "cli-agent",
|
||||
"X-OpenRouter-Categories":
|
||||
"cli-agent,cloud-agent,programming-app,creative-writing,writing-assistant,general-chat,personal-agent",
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -123,6 +123,8 @@ function readCompatBoolean(
|
||||
|
||||
const OPENCLAW_ATTRIBUTION_PRODUCT = "OpenClaw";
|
||||
const OPENCLAW_ATTRIBUTION_ORIGINATOR = "openclaw";
|
||||
const OPENROUTER_ATTRIBUTION_CATEGORIES =
|
||||
"cli-agent,cloud-agent,programming-app,creative-writing,writing-assistant,general-chat,personal-agent";
|
||||
|
||||
const LOCAL_ENDPOINT_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
||||
const OPENAI_RESPONSES_APIS = new Set([
|
||||
@@ -473,7 +475,7 @@ function buildOpenRouterAttributionPolicy(
|
||||
headers: {
|
||||
"HTTP-Referer": "https://openclaw.ai",
|
||||
"X-OpenRouter-Title": identity.product,
|
||||
"X-OpenRouter-Categories": "cli-agent",
|
||||
"X-OpenRouter-Categories": OPENROUTER_ATTRIBUTION_CATEGORIES,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -457,7 +457,8 @@ describe("provider request config", () => {
|
||||
expect(resolved).toEqual({
|
||||
"HTTP-Referer": "https://openclaw.ai",
|
||||
"X-OpenRouter-Title": "OpenClaw",
|
||||
"X-OpenRouter-Categories": "cli-agent",
|
||||
"X-OpenRouter-Categories":
|
||||
"cli-agent,cloud-agent,programming-app,creative-writing,writing-assistant,general-chat,personal-agent",
|
||||
"X-Custom": "1",
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user