Repository navigation
fix(cli): preserve explicit read-only agent targets - #123868
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 14, 2026, 6:37 PM ET / 22:37 UTC. ClawSweeper reviewWhat this changesThe PR carries an explicitly selected agent through read-only model listing, sandbox explanation, and hook-status reads, including compatible Gateway fallback behavior. Merge readinessKeep this PR open: current main still forces a default agent before these reads, so the core repair remains necessary, but the updated models CLI reference makes an incorrect environment-variable claim. Priority: P2 Review scores
Verification
How this fits togetherRead-only CLI commands choose an agent, then read that agent’s workspace, auth store, provider catalog, sandbox policy, or hooks. Results are returned either by the Gateway or by a local compatibility fallback. flowchart LR
A[CLI command and --agent] --> B[Agent selection]
B --> C[Models, sandbox, or hooks read]
C --> D{Gateway supports request?}
D -->|Yes| E[Gateway response]
D -->|No or unavailable| F[Local read-only fallback]
E --> G[Operator output]
F --> G
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +90, Tests +178, Docs +3. Total +271 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Correct the models reference so omitted Do we have a high-confidence way to reproduce the issue? Yes, from source: on current main an ownerless explicit fleet reaches Is this the best way to solve the issue? Mostly yes: resolving one explicit owner at the read boundary is the narrowest repair, but the updated documentation must not claim that omitted Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3ef7f590a75d. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* fix(cli): preserve explicit read-only agent targets * chore: leave release changelog to release flow
What Problem This Solves
Fixes an issue where read-only CLI commands could ignore an explicit agent or require an ambient default before reading it in multi-agent configurations. This affected
models list,sandbox explain, and hook status reads, especially when no implicit fleet owner existed or the Gateway was unavailable/older.Why This Change Was Made
Each command now resolves one explicit owner before any compatibility/default fallback and carries that owner through its workspace, auth, catalog, sandbox, or hook-status read. Hooks pass the selected agent to modern Gateways, retain it for local compatibility fallback, and no longer replace authoritative Gateway ownership errors with a local report.
The hook
--agentoption is intentionally read-only. Parent-scoped use with mutation subcommands is rejected rather than silently implying an agent-scoped config write.User Impact
Operators can safely inspect a named agent in an explicit multi-agent fleet:
openclaw models list --agent <id>openclaw sandbox explain --agent <id>openclaw hooks list|info|check --agent <id>No protocol, config, storage, or migration surface changes.
Evidence
--agentand hooks did not accept it: https://github.com/openclaw/openclaw/actions/runs/31845069265tbx_01m014t8w8j5gwnwmqm5cb5te0.oxfmt.git diff --check: clean.Production LOC: +124/-34 (net +90) | Tests: +182/-4. The production growth establishes the missing explicit-owner boundary and narrows compatibility fallback so semantic Gateway errors remain authoritative.
The broader changed gate was attempted on the reused Testbox, but its stale base classified unrelated main drift and lacked the base
pnpm-lock.yaml; exact-head native PR prepare/CI remains the authoritative broad gate.