docs: refresh auth probe reason-code refs

This commit is contained in:
Peter Steinberger
2026-04-04 20:51:43 +01:00
parent 136a5ad2eb
commit 59a6bf7569
6 changed files with 79 additions and 1 deletions

View File

@@ -17,13 +17,15 @@ This document defines the canonical credential eligibility and resolution semant
The goal is to keep selection-time and runtime behavior aligned.
## Stable Reason Codes
## Stable Probe Reason Codes
- `ok`
- `excluded_by_auth_order`
- `missing_credential`
- `invalid_expires`
- `expired`
- `unresolved_ref`
- `no_model`
## Token Credentials
@@ -44,6 +46,24 @@ Token credentials (`type: "token"`) support inline `token` and/or `tokenRef`.
2. For eligible profiles, token material may be resolved from inline value or `tokenRef`.
3. Unresolvable refs produce `unresolved_ref` in `models status --probe` output.
## Explicit Auth Order Filtering
- When `auth.order.<provider>` or the auth-store order override is set for a
provider, `models status --probe` only probes profile ids that remain in the
resolved auth order for that provider.
- A stored profile for that provider that is omitted from the explicit order is
not silently tried later. Probe output reports it with
`reasonCode: excluded_by_auth_order` and the detail
`Excluded by auth.order for this provider.`
## Probe Target Resolution
- Probe targets can come from auth profiles, environment credentials, or
`models.json`.
- If a provider has credentials but OpenClaw cannot resolve a probeable model
candidate for it, `models status --probe` reports `status: no_model` with
`reasonCode: no_model`.
## OAuth SecretRef Policy Guard
- SecretRef input is for static credentials only.

View File

@@ -1532,9 +1532,15 @@ Options:
- `--probe-timeout <ms>`
- `--probe-concurrency <n>`
- `--probe-max-tokens <n>`
- `--agent <id>`
Always includes the auth overview and OAuth expiry status for profiles in the auth store.
`--probe` runs live requests (may consume tokens and trigger rate limits).
Probe rows can come from auth profiles, env credentials, or `models.json`.
Expect probe statuses like `ok`, `auth`, `rate_limit`, `billing`, `timeout`,
`format`, `unknown`, and `no_model`.
When an explicit `auth.order.<provider>` omits a stored profile, probe reports
`excluded_by_auth_order` instead of silently trying that profile.
### `models set <model>`

View File

@@ -36,6 +36,7 @@ Probes are real requests (may consume tokens and trigger rate limits).
Use `--agent <id>` to inspect a configured agents model/auth state. When omitted,
the command uses `OPENCLAW_AGENT_DIR`/`PI_CODING_AGENT_DIR` if set, otherwise the
configured default agent.
Probe rows can come from auth profiles, env credentials, or `models.json`.
Notes:
@@ -64,6 +65,27 @@ Options:
- `--probe-max-tokens <n>`
- `--agent <id>` (configured agent id; overrides `OPENCLAW_AGENT_DIR`/`PI_CODING_AGENT_DIR`)
Probe status buckets:
- `ok`
- `auth`
- `rate_limit`
- `billing`
- `timeout`
- `format`
- `unknown`
- `no_model`
Probe detail/reason-code cases to expect:
- `excluded_by_auth_order`: a stored profile exists, but explicit
`auth.order.<provider>` omitted it, so probe reports the exclusion instead of
trying it.
- `missing_credential`, `invalid_expires`, `expired`, `unresolved_ref`:
profile is present but not eligible/resolvable.
- `no_model`: provider auth exists, but OpenClaw could not resolve a probeable
model candidate for that provider.
## Aliases + fallbacks
```bash

View File

@@ -177,6 +177,11 @@ provider has no credentials, `models status` prints a **Missing auth** section.
JSON includes `auth.oauth` (warn window + profiles) and `auth.providers`
(effective auth per provider).
Use `--check` for automation (exit `1` when missing/expired, `2` when expiring).
Use `--probe` for live auth checks; probe rows can come from auth profiles, env
credentials, or `models.json`.
If explicit `auth.order.<provider>` omits a stored profile, probe reports
`excluded_by_auth_order` instead of trying it. If auth exists but no probeable
model can be resolved for that provider, probe reports `status: no_model`.
Auth choice is provider/account dependent. For always-on gateway hosts, API
keys are usually the most predictable; Claude CLI reuse and existing legacy

View File

@@ -86,6 +86,20 @@ Automation-friendly check (exit `1` when expired/missing, `2` when expiring):
openclaw models status --check
```
Live auth probes:
```bash
openclaw models status --probe
```
Notes:
- Probe rows can come from auth profiles, env credentials, or `models.json`.
- If explicit `auth.order.<provider>` omits a stored profile, probe reports
`excluded_by_auth_order` for that profile instead of trying it.
- If auth exists but OpenClaw cannot resolve a probeable model candidate for
that provider, probe reports `status: no_model`.
Optional ops scripts (systemd/Termux) are documented here:
[Auth monitoring scripts](/help/scripts#auth-monitoring-scripts)
@@ -169,6 +183,8 @@ openclaw models auth order clear --provider anthropic
```
Use `--agent <id>` to target a specific agent; omit it to use the configured default agent.
When you debug order issues, `openclaw models status --probe` shows omitted
stored profiles as `excluded_by_auth_order` instead of silently skipping them.
## Troubleshooting

View File

@@ -2612,6 +2612,15 @@ Related: [/concepts/oauth](/concepts/oauth) (OAuth flows, token storage, multi-a
openclaw models auth order set --provider anthropic --agent main anthropic:default
```
To verify what will actually be tried, use:
```bash
openclaw models status --probe
```
If a stored profile is omitted from the explicit order, probe reports
`excluded_by_auth_order` for that profile instead of trying it silently.
</Accordion>
<Accordion title="OAuth vs API key - what is the difference?">