Skip to content

docs(agents): record model, provider and usage invariants - #187141

Merged
obviyus merged 5 commits into
mainfrom
docs/agents-model-listing
Oct 29, 2026
Merged

obviyus merged 5 commits into
mainfrom
docs/agents-model-listing

Conversation

@obviyus

@obviyus obviyus commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The repo has no written rules for agents that work on model listing, provider plugins or usage/cost. So the same classes of bugs keep coming back across providers and on the Models and Usage pages.

User Impact

There is no user-visible change. Agents that work in these areas now get short rules from the scoped guide they already read.

Why This Change Was Made

Each rule records a lesson that came back 2 or more times in merged work. Each rule is one line, in the guide that owns the area:

  • src/plugins/AGENTS.md "Model Listing":
    • The hot path has no network request.
    • models.list has p99 under 300 ms. Rows and prices publish as one snapshot, and removals apply at once.
    • The authenticated listing decides which models show.
    • List with the credential and runtime that will execute the turn, with one row per model per provider.
    • Failed and empty listings each have defined semantics.
    • Capabilities come from the listing, not from model-ID rules.
    • One core admission rule.
  • extensions/AGENTS.md:
    • Host policy that every provider shares stays core.
    • Sign-in goes through the Models page and /login. Setup saves the connection only.
    • Native CLIs own their login and model menu.
    • Refusals are classified by cause.
    • Attribution headers come from one helper.
  • src/agents/AGENTS.md "Run Authority":
    • One model resolver for every entry path.
    • No silent fallback to another runtime or billing.
    • Native-runtime consent is asked once.
  • src/gateway/AGENTS.md "Usage And Cost" (new section):
    • Measured, unpriced, partial and unknown usage stay distinct.
    • Each route is priced from the provider that bills it.
    • Reports are complete or flagged as partial.
  • ui/AGENTS.md:
    • A route waits only for its first-paint data.
    • New "Layout Stability" section: zero layout shift, how to prove it, and a 200 ms load budget for Models and Usage.
  • Root AGENTS.md: one line in "Read when relevant" that points to these sections.

Examples of the incidents behind the rules: #140139, #158000, #167444, #167658, #168033, #172608, #172773, #173792, #174641, #176404, #180838, #184066.

Evidence

  • pnpm check:agents-md-size: all 27 files are within 20000 chars.
  • oxfmt --check passes on each of the 6 changed files.
  • I checked the cited names on current main: buildLiveModelProviderConfig, readModelId and modelPricing.providers.<id>.priceAs.

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added the clawsweeper:intake:docs Preliminary submission classification; full source review pending. label Oct 29, 2026
@obviyus obviyus changed the title docs(agents): record model listing invariants docs(agents): record model, provider and usage invariants Oct 29, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling labels Oct 29, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:docs Preliminary submission classification; full source review pending. labels Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR adds scoped instructions for model discovery, provider setup, runtime selection, usage reporting, and UI loading.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful documentation with verified contract references, the prior finding resolved, clean whitespace validation, and no remaining actionable defects.
Proof confidence 🐚 platinum hermit (4/6) This PR changes repository instructions only, so shipped runtime proof is not required.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Docs · Worth it: Yes · Fix scope: Complete
User problem: Coding agents lack concise, consistently routed guidance for recurring model, provider, usage, and loading failures.
Reason: The maintainer-authored direction records useful lessons in existing subsystem guides without introducing runtime machinery.

Merge readiness

✅ Ready for maintainer review

Keep this PR open for merging: the previous admission-rule finding is resolved, and no actionable defects remain in the maintainer-authored guidance.

Priority: P3
Reviewed head: 97910c6555f50ffd765ca8a623f729e9c4ed4f50

Before merge

None.

Findings

None.

Agent review details

How this fits together

Root instructions direct coding agents to subsystem guides, which define ownership and validation expectations for provider catalogs, agent execution, Gateway reports, and the Control UI.

flowchart TD
  A[Root instructions] --> B[Plugin guide]
  A --> C[Provider guide]
  A --> D[Agent guide]
  A --> E[Gateway guide]
  A --> F[UI guide]
Loading

Technical review

Best possible solution:

Merge the scoped guidance with the documented provider capability gates preserved.

Do we have a high-confidence way to reproduce the issue?

No runtime reproduction applies; source inspection verifies that the previously reported documentation contradiction is corrected.

Is this the best way to solve the issue?

Scoped guidance is an appropriate, small solution that uses existing owners and preserves the exceptions in the public provider catalog contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f996c1c487a0.

Provenance checked

  • Scoped ownership and root routing keeps the original intent (6c8db8f: Consolidate guidance around existing responsibility owners and complete caller cutovers.)
  • Provider policy placement keeps the original intent (050ea4d: Keep subsystem instructions current and remove duplicated or conflicting rules; vendor behavior remains plugin-owned.)
  • Provider capability admission keeps the original intent (b340251: Preserve capability-aware projections and public admission gates so unknown listed models receive valid request shapes.)
  • Root instruction size keeps the original intent (b2e85fa: Keep root instructions below the bootstrap cap and put detailed rules in their scoped owners.)

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 050ea4d adds src/plugins/AGENTS.md:39 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 050ea4d27043; files: src/plugins/AGENTS.md)
  • Peter Steinberger: Raw commit 9ec974a adds src/plugins/AGENTS.md:35 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9ec974a4837e; files: src/plugins/AGENTS.md)

PR surface

Docs +29. Total +29 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 6 31 2 +29
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 31 2 +29

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is repository instruction documentation with no immediate runtime change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-29T01:31:23.751Z sha 2520358 :: needs changes before merge. :: [P2] Preserve supported provider capability gates in the admission rule

Reviewed October 28, 2026, 10:36 PM ET / October 29, 2026, 02:36 UTC (Revision 2).

@obviyus

obviyus commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:docs Preliminary submission classification; full source review pending. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:docs Preliminary submission classification; full source review pending. labels Oct 29, 2026
@obviyus
obviyus merged commit 0aced8c into main Oct 29, 2026
103 checks passed
@obviyus
obviyus deleted the docs/agents-model-listing branch October 29, 2026 02:39
@obviyus

obviyus commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as 0aced8c.

  • Problem: the same model-listing, provider and usage bugs kept coming back, because agents had no written rules for these areas.
  • Fix: short rules in the scoped guides that own each area: src/plugins Model Listing, extensions, src/agents Run Authority, src/gateway Usage And Cost and ui Layout Stability. Also one root pointer that fires before the first edit to a provider or model.
  • Proof: docs only. The AGENTS.md size check and oxfmt pass, CI is green, and ClawSweeper says ready on 97910c6. The admission rule keeps the provider capability gates, as ClawSweeper asked.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 29, 2026
…87141)

## What Problem This Solves

The repo has no written rules for agents that work on model listing, provider plugins or usage/cost. So the same classes of bugs keep coming back across providers and on the Models and Usage pages.

## User Impact

There is no user-visible change. Agents that work in these areas now get short rules from the scoped guide they already read.

## Why This Change Was Made

Each rule records a lesson that came back 2 or more times in merged work. Each rule is one line, in the guide that owns the area:

- **`src/plugins/AGENTS.md` "Model Listing":**
  - The hot path has no network request.
  - `models.list` has p99 under 300 ms. Rows and prices publish as one snapshot, and removals apply at once.
  - The authenticated listing decides which models show.
  - List with the credential and runtime that will execute the turn, with one row per model per provider.
  - Failed and empty listings each have defined semantics.
  - Capabilities come from the listing, not from model-ID rules.
  - One core admission rule.
- **`extensions/AGENTS.md`:**
  - Host policy that every provider shares stays core.
  - Sign-in goes through the Models page and `/login`. Setup saves the connection only.
  - Native CLIs own their login and model menu.
  - Refusals are classified by cause.
  - Attribution headers come from one helper.
- **`src/agents/AGENTS.md` "Run Authority":**
  - One model resolver for every entry path.
  - No silent fallback to another runtime or billing.
  - Native-runtime consent is asked once.
- **`src/gateway/AGENTS.md` "Usage And Cost" (new section):**
  - Measured, unpriced, partial and unknown usage stay distinct.
  - Each route is priced from the provider that bills it.
  - Reports are complete or flagged as partial.
- **`ui/AGENTS.md`:**
  - A route waits only for its first-paint data.
  - New "Layout Stability" section: zero layout shift, how to prove it, and a 200 ms load budget for Models and Usage.
- **Root `AGENTS.md`:** one line in "Read when relevant" that points to these sections.

Examples of the incidents behind the rules: openclaw#140139, openclaw#158000, openclaw#167444, openclaw#167658, openclaw#168033, openclaw#172608, openclaw#172773, openclaw#173792, openclaw#174641, openclaw#176404, openclaw#180838, openclaw#184066.

## Evidence

- `pnpm check:agents-md-size`: all 27 files are within 20000 chars.
- `oxfmt --check` passes on each of the 6 changed files.
- I checked the cited names on current `main`: `buildLiveModelProviderConfig`, `readModelId` and `modelPricing.providers.<id>.priceAs`.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant