Repository navigation
docs(agents): treat catalog data as live behavior - #187458
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR adds catalog compatibility guidance and requires evidence for model-specific exceptions in the existing agent instructions. Example: An editor adds an unknown top-level field to a hosted v2 model row consumed by OpenClaw v2026.10.8.
Review scores
ProductKind: Docs · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR is ready for normal landing consideration: the earlier accuracy finding is resolved, the guidance matches released and current readers, and no actionable defects remain. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherProvider manifests feed the hosted catalog, whose readers supply model capabilities to selection controls and request construction; this PR changes instructions for editors of that flow. flowchart LR
A[Agent instructions] --> B[Catalog editor]
B --> C[Provider manifests]
C --> D[Hosted catalog]
D --> E[Released and main readers]
E --> F[Model controls and requests]
Technical reviewBest possible solution: Land the focused guidance in the existing Model Listing section with the corrected released-reader explanation. Do we have a high-confidence way to reproduce the issue? No runtime reproduction is needed for this instruction-only change; source inspection verifies the central reader-compatibility claims. Is this the best way to solve the issue? The diff is the smallest complete documentation change: it uses the existing policy owner, preserves capability-driven behavior, and adds no parallel mechanism or test scaffolding. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against da8f9079520f. Provenance checked
SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceDocs +3. Total +3 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 29, 2026, 4:06 AM ET / 08:06 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed as 011a170.
|
## What Problem This Solves
Catalog thinking data (`thinkingLevelMap`, reasoning-effort compat) on shipped rows has no recorded proof of what each provider route accepts. Some facts are only knowable by a live request.
## User Impact
No user-visible change. Maintainers can run `pnpm test:live:thinking-probe -- --provider <p> --model <m> [--routes a,b]` and commit a dated record, `extensions/<plugin>/probes/<model>.<provider>.<YYYY-MM-DD>.json` (one file per route, so routes owned by one plugin do not overwrite each other), to support a catalog-data change.
## Why This Change Was Made
- For each route, one real agent turn runs on an isolated in-process Gateway for every level in `MODEL_DATA_THINKING_LEVELS`.
- Each model HTTP request is observed through the transport host's `buildModelFetch` (the same hook the Ultra wire check uses), without changing its bytes. Per turn the record keeps:
- the URL with no query string
- the request params without conversation content (so the effort actually sent shows)
- the HTTP status
- the redacted error body
- the model ID, usage and the reply
- The record holds raw facts only. No error classification.
- **Config-only row.** Provider plugin thinking hooks can narrow a shipped row. For example, `extensions/moonshot/provider-policy-api.ts` offers only `max` for K3, so the Gateway rejects every other level before any request. The probe therefore runs each route as `probe-<route>`: a config-only copy of the shipped manifest row (same `api`, `baseUrl`, headers, limits) that offers every level, each sent as its own value. The record stores that row.
- **Keys.** Keys come only from env vars named in the owning manifest's `setup.providers[].envVars`. The row references the key as `{source: "env"}`.
- The wrapper points `HOME` at an empty temp dir. Without that, shared live setup (`test/test-env.ts`) copies `~/.openclaw` credentials and the auth-profile store into the test home.
- The wrapper resolves the test runtime first and binds the pinned Bun path only for a Bun run, so `OPENCLAW_VITEST_RUNTIME=node` works on machines without Bun.
- The wrapper refuses to run in CI. No CI hydration and no new blocking contract.
- **Writer guards.** The writer refuses a record that contains any of the route's env key values. Errors pass through `redactSensitiveText`, then an account-ID scrub, because Moonshot 429 bodies echo the org ID and the API-key ID.
- **`src/plugins/AGENTS.md`.** The "Catalog data is live behavior" bullet (from #187458) now links the probe command after "change only what a dated live probe of that route supports".
Size: about 520 lines of test tooling, about 100 lines of offline test, 28 lines of docs and guidance, and the 439-line probe record. Production code: 0 lines.
pr-simplify (run before opening this PR):
- Merged the two redaction functions.
- Dropped a speculative `Request`-input body path.
- Dropped the writer's re-checks of data the probe itself produced, and their test.
- Replaced a hand-rolled flag parser with `node:util` `parseArgs`.
- Typed the probe row as `ModelProviderConfig`.
## Evidence
Live run on this head, route `moonshot`, model `kimi-k3`, key `MOONSHOT_API_KEY` from env:
```
[thinking-probe] moonshot/kimi-k3 off: 200
[thinking-probe] moonshot/kimi-k3 minimal: 200
[thinking-probe] moonshot/kimi-k3 low: 200
[thinking-probe] moonshot/kimi-k3 medium: 429,429,429,429,429,429,200
[thinking-probe] moonshot/kimi-k3 high: 200
[thinking-probe] moonshot/kimi-k3 xhigh: 200
[thinking-probe] moonshot/kimi-k3 max: 429,429,429,429,200
Tests 1 passed (1)
```
| level | `reasoning_effort` sent | final status | reasoning tokens | reply |
|---|---|---|---|---|
| off | unset | 200 | 87 | OK |
| minimal | minimal | 200 | 1 | OK |
| low | low | 200 | 17 | OK |
| medium | medium | 200 | not reported | OK |
| high | high | 200 | 2 | OK |
| xhigh | xhigh | 200 | 30 | OK |
| max | max | 200 | not reported | OK |
The 429s come from the account's 3 RPM limit. The runtime retried them. On this date, Moonshot direct returned 200 for every `reasoning_effort` value, and with `off` (no effort sent) K3 still produced reasoning tokens. The record states facts; it does not change the catalog.
Committed probe file checks:
- no match for the full key or its first 12 characters
- no org ID or API-key ID
- no local paths
Earlier runs on this branch found and fixed two problems:
1. Shipped-provider turns were rejected by the plugin hook before any request. This is why the probe uses a config-only row.
2. The org and key IDs leaked through a JSON `<` escape. Fixed by decoding escapes before the scrub, with a regression test.
Offline and static checks:
- `pnpm exec vitest run src/gateway/thinking-probe.test-helpers.test.ts`: 4 passed. Covers one dated file per route for two routes in one plugin, refusing a credential value, manifest route lookup, and account-ID redaction through `<`.
- `pnpm tsgo:core:test` and `pnpm tsgo:scripts` are clean. `oxlint --type-aware` is clean on all changed files.
- `OPENCLAW_VITEST_RUNTIME=node OPENCLAW_BUN_PATH=/nonexistent/bun` reaches the live test (route lookup error), so no Bun is needed for a Node run.
- `CI=1` refuses to run. Missing `--provider` or `--model` prints usage.
Co-authored-by: Ayaan Zaidi <[email protected]>
## What Problem This Solves Catalog data reaches every released install within hours, with no release. Agents treat manifest rows as inert metadata, so per-model facts keep landing as exact-ID code (35 of 37 model launches since July needed code), and data edits can change released behavior without anyone checking. ## User Impact There is no runtime change. Agents that work on models now follow 4 more rules in `src/plugins/AGENTS.md` "Model Listing": - **New model in a known family:** add a manifest row with its thinking data and `input`, not new ID-list entries. - **An exact-ID rule is allowed only** for a fact the catalog cannot express yet, with a comment citing its live probe or vendor source. - **Catalog data is live behavior.** Before changing `thinkingLevelMap`, `compat` or `input` on a shipped row, compare the offered levels and request bodies on the stable, extended-stable and beta readers. Report the result in the PR, and change only what a dated live probe supports. - **Hosted rows parse strictly.** On 2026.10.8 and earlier, one unknown row field rejects the whole refresh; current `main` skips only that row. New facts go inside `compat` or `thinkingLevelMap`. Any other field needs a schema decision first. ## Why This Change Was Made - **Measured on `main`:** 364 exact-ID model matchers exist in code. - **Moonshot's manifest disagrees with its code** for K3: the manifest lists `low`/`high`/`max`, but the code forces `max`. Publishing that row unchanged would change what released installs send. - **Strict readers drop rows with unknown fields.** That is what forced catalog v3 (openclaw#157492). **Decision (models and catalog maintainer):** catalog data safety is enforced through `AGENTS.md` guidance and PR evidence, not a hard CI block on publishing. ## Evidence - `pnpm check:agents-md-size`: all files are within 20000 chars. - `oxfmt --check` and `git diff --check` pass. - I checked the claims on `main`: - Strict rows: v2026.9.35 and v2026.10.8 validate `z.array(modelV2Schema)` as a whole, and `main` skips invalid rows (`packages/model-catalog-core/src/remote-catalog-bundle.ts`). - v2026.9.35 reads `thinkingLevelMap` in `src/auto-reply/thinking.ts`. - The 4-hour publish cron is in `openclaw/catalog` `.github/workflows/publish.yml`. Co-authored-by: Ayaan Zaidi <[email protected]>
## What Problem This Solves
Catalog thinking data (`thinkingLevelMap`, reasoning-effort compat) on shipped rows has no recorded proof of what each provider route accepts. Some facts are only knowable by a live request.
## User Impact
No user-visible change. Maintainers can run `pnpm test:live:thinking-probe -- --provider <p> --model <m> [--routes a,b]` and commit a dated record, `extensions/<plugin>/probes/<model>.<provider>.<YYYY-MM-DD>.json` (one file per route, so routes owned by one plugin do not overwrite each other), to support a catalog-data change.
## Why This Change Was Made
- For each route, one real agent turn runs on an isolated in-process Gateway for every level in `MODEL_DATA_THINKING_LEVELS`.
- Each model HTTP request is observed through the transport host's `buildModelFetch` (the same hook the Ultra wire check uses), without changing its bytes. Per turn the record keeps:
- the URL with no query string
- the request params without conversation content (so the effort actually sent shows)
- the HTTP status
- the redacted error body
- the model ID, usage and the reply
- The record holds raw facts only. No error classification.
- **Config-only row.** Provider plugin thinking hooks can narrow a shipped row. For example, `extensions/moonshot/provider-policy-api.ts` offers only `max` for K3, so the Gateway rejects every other level before any request. The probe therefore runs each route as `probe-<route>`: a config-only copy of the shipped manifest row (same `api`, `baseUrl`, headers, limits) that offers every level, each sent as its own value. The record stores that row.
- **Keys.** Keys come only from env vars named in the owning manifest's `setup.providers[].envVars`. The row references the key as `{source: "env"}`.
- The wrapper points `HOME` at an empty temp dir. Without that, shared live setup (`test/test-env.ts`) copies `~/.openclaw` credentials and the auth-profile store into the test home.
- The wrapper resolves the test runtime first and binds the pinned Bun path only for a Bun run, so `OPENCLAW_VITEST_RUNTIME=node` works on machines without Bun.
- The wrapper refuses to run in CI. No CI hydration and no new blocking contract.
- **Writer guards.** The writer refuses a record that contains any of the route's env key values. Errors pass through `redactSensitiveText`, then an account-ID scrub, because Moonshot 429 bodies echo the org ID and the API-key ID.
- **`src/plugins/AGENTS.md`.** The "Catalog data is live behavior" bullet (from openclaw#187458) now links the probe command after "change only what a dated live probe of that route supports".
Size: about 520 lines of test tooling, about 100 lines of offline test, 28 lines of docs and guidance, and the 439-line probe record. Production code: 0 lines.
pr-simplify (run before opening this PR):
- Merged the two redaction functions.
- Dropped a speculative `Request`-input body path.
- Dropped the writer's re-checks of data the probe itself produced, and their test.
- Replaced a hand-rolled flag parser with `node:util` `parseArgs`.
- Typed the probe row as `ModelProviderConfig`.
## Evidence
Live run on this head, route `moonshot`, model `kimi-k3`, key `MOONSHOT_API_KEY` from env:
```
[thinking-probe] moonshot/kimi-k3 off: 200
[thinking-probe] moonshot/kimi-k3 minimal: 200
[thinking-probe] moonshot/kimi-k3 low: 200
[thinking-probe] moonshot/kimi-k3 medium: 429,429,429,429,429,429,200
[thinking-probe] moonshot/kimi-k3 high: 200
[thinking-probe] moonshot/kimi-k3 xhigh: 200
[thinking-probe] moonshot/kimi-k3 max: 429,429,429,429,200
Tests 1 passed (1)
```
| level | `reasoning_effort` sent | final status | reasoning tokens | reply |
|---|---|---|---|---|
| off | unset | 200 | 87 | OK |
| minimal | minimal | 200 | 1 | OK |
| low | low | 200 | 17 | OK |
| medium | medium | 200 | not reported | OK |
| high | high | 200 | 2 | OK |
| xhigh | xhigh | 200 | 30 | OK |
| max | max | 200 | not reported | OK |
The 429s come from the account's 3 RPM limit. The runtime retried them. On this date, Moonshot direct returned 200 for every `reasoning_effort` value, and with `off` (no effort sent) K3 still produced reasoning tokens. The record states facts; it does not change the catalog.
Committed probe file checks:
- no match for the full key or its first 12 characters
- no org ID or API-key ID
- no local paths
Earlier runs on this branch found and fixed two problems:
1. Shipped-provider turns were rejected by the plugin hook before any request. This is why the probe uses a config-only row.
2. The org and key IDs leaked through a JSON `<` escape. Fixed by decoding escapes before the scrub, with a regression test.
Offline and static checks:
- `pnpm exec vitest run src/gateway/thinking-probe.test-helpers.test.ts`: 4 passed. Covers one dated file per route for two routes in one plugin, refusing a credential value, manifest route lookup, and account-ID redaction through `<`.
- `pnpm tsgo:core:test` and `pnpm tsgo:scripts` are clean. `oxlint --type-aware` is clean on all changed files.
- `OPENCLAW_VITEST_RUNTIME=node OPENCLAW_BUN_PATH=/nonexistent/bun` reaches the live test (route lookup error), so no Bun is needed for a Node run.
- `CI=1` refuses to run. Missing `--provider` or `--model` prints usage.
Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Catalog data reaches every released install within hours, with no release. Agents treat manifest rows as inert metadata, so per-model facts keep landing as exact-ID code (35 of 37 model launches since July needed code), and data edits can change released behavior without anyone checking.
User Impact
There is no runtime change. Agents that work on models now follow 4 more rules in
src/plugins/AGENTS.md"Model Listing":input, not new ID-list entries.thinkingLevelMap,compatorinputon a shipped row, compare the offered levels and request bodies on the stable, extended-stable and beta readers. Report the result in the PR, and change only what a dated live probe supports.mainskips only that row. New facts go insidecompatorthinkingLevelMap. Any other field needs a schema decision first.Why This Change Was Made
main: 364 exact-ID model matchers exist in code.low/high/max, but the code forcesmax. Publishing that row unchanged would change what released installs send.Decision (models and catalog maintainer): catalog data safety is enforced through
AGENTS.mdguidance and PR evidence, not a hard CI block on publishing.Evidence
pnpm check:agents-md-size: all files are within 20000 chars.oxfmt --checkandgit diff --checkpass.main:z.array(modelV2Schema)as a whole, andmainskips invalid rows (packages/model-catalog-core/src/remote-catalog-bundle.ts).thinkingLevelMapinsrc/auto-reply/thinking.ts.openclaw/catalog.github/workflows/publish.yml.