Repository navigation
docs(agents): record model, provider and usage invariants - #187141
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 scoped instructions for model discovery, provider setup, runtime selection, usage reporting, and UI loading. Review scores
ProductKind: Docs · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherRoot 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]
Technical reviewBest 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
SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceDocs +29. Total +29 across 6 files. 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 28, 2026, 10:36 PM ET / October 29, 2026, 02:36 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed as 0aced8c.
|
…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]>
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":models.listhas p99 under 300 ms. Rows and prices publish as one snapshot, and removals apply at once.extensions/AGENTS.md:/login. Setup saves the connection only.src/agents/AGENTS.md"Run Authority":src/gateway/AGENTS.md"Usage And Cost" (new section):ui/AGENTS.md: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 --checkpasses on each of the 6 changed files.main:buildLiveModelProviderConfig,readModelIdandmodelPricing.providers.<id>.priceAs.