Repository navigation
fix(models): fallbacks add, remove and clear accept --agent but edit global defaults - #163077
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. Reviewed October 1, 2026, 7:08 PM ET / 23:08 UTC. ClawSweeper reviewWhat this changesThe PR rejects --agent on text and image fallback mutations, consolidates global-command guards, and updates CLI documentation and regression coverage. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main still permits agent-qualified fallback mutations to change global defaults. No actionable introduced defect was found. Likely related people: Peter Steinberger and Teddy Tennant (low-confidence routing candidates). Priority: P2 Review scores
Verification
How this fits togetherThe models CLI receives model-management commands and routes them to configuration owners. Fallback mutations change defaults inherited by agents, so misleading agent-qualified writes must stop before configuration access. flowchart TD
A[Models CLI input] --> B[Fallback mutation]
B --> C{Agent option supplied}
C -->|Yes| D[Error with scope guidance]
C -->|No| E[Global fallback owner]
E --> F[Updated agent defaults]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +2, Tests +19, Docs 0. Total +21 across 4 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Use the existing global-command admission consistently while preserving ordinary fallback writes and agent-specific configuration. Do we have a high-confidence way to reproduce the issue? Yes: current main sends models --agent worker fallbacks clear to a global-only writer without admission. The contributor reports a real before/after CLI run; this review established the path from source without executing it. Is this the best way to solve the issue? Yes: applying the existing rejection contract to the remaining mutation leaves is the narrow repair requested by the linked issue, and the consolidation preserves existing command behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dc794c04818e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…law#163077) Co-authored-by: Eric Curtin <[email protected]>
Closes #127617
What Problem This Solves
Fixes:
openclaw models --agent worker fallbacks clearexits 0 and edits the global defaults, not the worker.User Impact
User impact:
--agenton fallbackadd,removeandclearnow fails with the same error assetandaliases. Config is left unchanged.Why This Change Was Made
The six fallback leaves skipped the existing
--agentguard. They now use it. All global-only commands share one small helper, so the guard is no longer repeated per command.Evidence
models --agent worker fallbacks clearprinted "Fallback list cleared." and emptiedagents.defaults.model.fallbacks.pnpm test src/cli/models-cli.test.ts src/cli/models-cli.lazy.test.ts: 86 passed. The 6 new cases fail without the fix. About 4s wall at--maxWorkers=1.pnpm tsgo:core, core test typecheck forsrc/cli, oxlint and oxfmt are clean.