docs(providers): cover Opus 4.7 1M, Mantle Anthropic Messages, Codex device-code/CLI-import removal, Moonshot tool-id sanitization, LM Studio streaming-usage, Tencent bundled plugin

This commit is contained in:
Vincent Koc
2026-04-22 23:29:17 -07:00
parent a3d9c53db2
commit 21a16349f2
6 changed files with 89 additions and 11 deletions

View File

@@ -267,6 +267,13 @@ OpenClaw supports Anthropic's prompt caching feature for API-key auth.
</Warning>
</Accordion>
<Accordion title="Claude Opus 4.7 1M context normalization">
Claude Opus 4.7 (`anthropic/claude-opus-4.7`) and its `claude-cli` variant are normalized to a 1M context window in resolved runtime metadata and active-agent status/context reporting. You do not need `params.context1m: true` for Opus 4.7; it no longer inherits the stale 200k fallback.
Compaction and overflow handling use the 1M window automatically. Other Anthropic models keep their published limits.
</Accordion>
</AccordionGroup>
## Troubleshooting

View File

@@ -13,12 +13,12 @@ the Mantle OpenAI-compatible endpoint. Mantle hosts open-source and
third-party models (GPT-OSS, Qwen, Kimi, GLM, and similar) through a standard
`/v1/chat/completions` surface backed by Bedrock infrastructure.
| Property | Value |
| -------------- | ----------------------------------------------------------------------------------- |
| Provider ID | `amazon-bedrock-mantle` |
| API | `openai-completions` (OpenAI-compatible) |
| Auth | Explicit `AWS_BEARER_TOKEN_BEDROCK` or IAM credential-chain bearer-token generation |
| Default region | `us-east-1` (override with `AWS_REGION` or `AWS_DEFAULT_REGION`) |
| Property | Value |
| -------------- | ------------------------------------------------------------------------------------------- |
| Provider ID | `amazon-bedrock-mantle` |
| API | `openai-completions` (OpenAI-compatible) or `anthropic-messages` (Anthropic Messages route) |
| Auth | Explicit `AWS_BEARER_TOKEN_BEDROCK` or IAM credential-chain bearer-token generation |
| Default region | `us-east-1` (override with `AWS_REGION` or `AWS_DEFAULT_REGION`) |
## Getting started
@@ -147,6 +147,37 @@ If you prefer explicit config instead of auto-discovery:
continue to work normally.
</Accordion>
<Accordion title="Claude Opus 4.7 via the Anthropic Messages route">
Mantle also exposes an Anthropic Messages route that carries Claude models through the same bearer-authenticated streaming path. Claude Opus 4.7 (`amazon-bedrock-mantle/claude-opus-4.7`) is callable through this route with provider-owned streaming, so AWS bearer tokens are not treated like Anthropic API keys.
When you pin an Anthropic Messages model on the Mantle provider, OpenClaw uses the `anthropic-messages` API surface instead of `openai-completions` for that model. Auth still comes from `AWS_BEARER_TOKEN_BEDROCK` (or the minted IAM bearer token).
```json5
{
models: {
providers: {
"amazon-bedrock-mantle": {
models: [
{
id: "claude-opus-4.7",
name: "Claude Opus 4.7",
api: "anthropic-messages",
reasoning: true,
input: ["text", "image"],
contextWindow: 1000000,
maxTokens: 32000,
},
],
},
},
},
}
```
Context-window metadata for discovered Mantle models uses known published limits when available and falls back conservatively for unlisted models, so compaction and overflow handling behave correctly for newer entries without overstating unknown models.
</Accordion>
<Accordion title="Relationship to Amazon Bedrock provider">
Bedrock Mantle is a separate provider from the standard
[Amazon Bedrock](/providers/bedrock) provider. Mantle uses an

View File

@@ -102,6 +102,20 @@ Interactive setup can prompt for an optional preferred load context length and a
## Configuration
### Streaming usage compatibility
OpenClaw marks LM Studio as streaming-usage compatible, so token accounting no longer degrades to unknown or stale totals on streamed completions. OpenClaw also recovers token counts from llama.cpp-style `timings.prompt_n` / `timings.predicted_n` metadata when LM Studio does not emit an OpenAI-shaped `usage` object.
Other OpenAI-compatible local backends covered by the same behavior:
- vLLM
- SGLang
- llama.cpp
- LocalAI
- Jan
- TabbyAPI
- text-generation-webui
### Explicit configuration
```json5

View File

@@ -348,6 +348,26 @@ Config lives under `plugins.entries.moonshot.config.webSearch`:
</Accordion>
<Accordion title="Tool call id sanitization">
Moonshot Kimi serves native tool_call ids shaped like `functions.<name>:<index>` on the OpenAI-compatible transport. OpenClaw no longer strict-sanitizes these ids for Moonshot, so multi-turn agentic flows through Kimi K2.6 keep working past 2-3 tool-calling rounds when the serving layer matches mangled ids against the original tool definitions.
If a custom OpenAI-compatible provider needs the previous behavior, set `sanitizeToolCallIds: true` on the provider entry. The flag lives on the shared `openai-compatible` replay family; Moonshot is wired to the opt-out by default.
```json5
{
models: {
providers: {
"my-kimi-proxy": {
api: "openai-completions",
sanitizeToolCallIds: true,
},
},
},
}
```
</Accordion>
<Accordion title="Streaming usage compatibility">
Native Moonshot endpoints (`https://api.moonshot.ai/v1` and
`https://api.moonshot.cn/v1`) advertise streaming usage compatibility on the

View File

@@ -101,6 +101,12 @@ Choose your preferred auth method and follow the setup steps.
```bash
openclaw models auth login --provider openai-codex
```
For headless or callback-hostile setups, add `--device-code` to sign in with a ChatGPT device-code flow instead of the localhost browser callback:
```bash
openclaw models auth login --provider openai-codex --device-code
```
</Step>
<Step title="Set the default model">
```bash
@@ -133,9 +139,9 @@ Choose your preferred auth method and follow the setup steps.
}
```
<Tip>
If onboarding reuses an existing Codex CLI login, those credentials stay managed by Codex CLI. On expiry, OpenClaw re-reads the external Codex source first and writes the refreshed credential back to Codex storage.
</Tip>
<Note>
Onboarding no longer imports OAuth material from `~/.codex`. Sign in with browser OAuth (default) or the device-code flow above — OpenClaw manages the resulting credentials in its own agent auth store.
</Note>
### Context window cap

View File

@@ -8,8 +8,7 @@ read_when:
# Tencent Cloud (TokenHub)
The Tencent Cloud provider gives access to Tencent Hy models via the TokenHub
endpoint (`tencent-tokenhub`).
Tencent Cloud ships as a **bundled provider plugin** in OpenClaw. It gives access to Tencent Hy models via the TokenHub endpoint (`tencent-tokenhub`).
The provider uses an OpenAI-compatible API.
@@ -45,6 +44,7 @@ openclaw onboard --non-interactive \
## Notes
- TokenHub model refs use `tencent-tokenhub/<modelId>`.
- The plugin ships with tiered Hy3 pricing metadata built in, so cost estimates are populated without manual pricing overrides.
- Override pricing and context metadata in `models.providers` if needed.
## Environment note