Repository navigation
fix(exec): complex commands trigger human approval fallback due to reviewer token truncation - #144587
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 September 12, 2026, 7:49 PM ET / 23:49 UTC (Revision 11). ClawSweeper reviewWhat this changesRaises automatic command review output to 1,024 tokens, respects smaller model limits, and adds regression coverage while preserving human escalation for incomplete responses. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main and v2026.9.4 retain the 360-token limit. No actionable defects remain, and the supplied live-provider evidence supports the change. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s automatic reviewer evaluates pending commands using a configured model before execution. Its validated response determines whether the command may run once, is denied, or needs human approval; dashboard widget approvals also share this reviewer. flowchart TD
A[Pending command or widget request] --> B[Input safety checks]
B --> C[Configured reviewer model]
D[Model output limit] --> E[Bounded completion budget]
E --> C
C --> F[Validate complete response]
F --> G[Allow once or deny]
F --> H[Human approval or widget rejection]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +12, Tests -19. Total -7 across 2 files. View PR surface stats
Review metrics
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: Keep the bounded budget in the existing reviewer while retaining strict completion validation and the current approval policy. Do we have a high-confidence way to reproduce the issue? Yes, at the source boundary: current main caps completion at 360 tokens and routes length-stopped responses to human approval. The reported pre-fix regression supports that mechanism; no target code was executed during this read-only review. Is this the best way to solve the issue? Yes. Adjusting the existing reviewer’s bounded budget is a narrow repair that preserves strict response validation, model selection, and stored settings. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 11c9589dc10b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
8004878 to
1a5638c
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
1a5638c to
f1377fe
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
f1377fe to
b7c6cda
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
b7c6cda to
56be619
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
openclaw#144476) Raise the automatic command reviewer completion budget from 360 to a bounded 1,024-token default, clamped downward to the selected model's advertised maximum output token limit (floored to integer to prevent provider 400 Bad Request errors). Preserves the incomplete-verdict safety contract: non-stop completions (such as length-stopped responses) continue to fail closed to human approval (decision: ask, risk: unknown) so truncated evaluations are never mistakenly parsed as allow decisions. Closes openclaw#144476
56be619 to
79bd841
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Protect clean TLS-enabled Gateway shutdown by covering registration of certificate renewal with the Gateway lifetime owner through real startup and close. #146267 added TLS renewal registration using an array; #146275 changed sidecar registration to variadic handles and missed that caller. Passing the renewal handle directly prevents failed production typechecks and shutdown errors (sidecar.stop is not a function). Current main already carries the one-line correction; this landing preserves the integrated regression that detects the caller-contract mismatch. The test uses isolated synthetic TLS material, closes the real Gateway, and observes the real renewal cleanup. The recorded regression failed before the repair and passed afterward; focused sibling coverage passed 22 tests. Exact-head CI and lead Codex review passed. No configuration, storage, or protocol changes. Refs #146267, #146275, #144587, #146246.
|
Merged via squash.
|
…146585) Exclude automatic squash co-author credit backed only by tree-identical refresh commits. Pass commit-tree comparisons from the existing Git-history producer into the credit composer, preserving PR-author credit, explicit human credit, source trailers, and queue refusal when a preview requires correction. No runtime user-visible change. Native regression coverage and the exact-head CI gate passed; the independent maintainer review and ClawSweeper review found no actionable findings. Refs #144587 and #142167.
…46504) Protect clean TLS-enabled Gateway shutdown by covering registration of certificate renewal with the Gateway lifetime owner through real startup and close. openclaw#146267 added TLS renewal registration using an array; openclaw#146275 changed sidecar registration to variadic handles and missed that caller. Passing the renewal handle directly prevents failed production typechecks and shutdown errors (sidecar.stop is not a function). Current main already carries the one-line correction; this landing preserves the integrated regression that detects the caller-contract mismatch. The test uses isolated synthetic TLS material, closes the real Gateway, and observes the real renewal cleanup. The recorded regression failed before the repair and passed afterward; focused sibling coverage passed 22 tests. Exact-head CI and lead Codex review passed. No configuration, storage, or protocol changes. Refs openclaw#146267, openclaw#146275, openclaw#144587, openclaw#146246.
…viewer token truncation (openclaw#144587) Under tools.exec.mode: auto, give the existing command reviewer a bounded 1,024-token completion budget, clamped to smaller positive model limits. This reduces human approval fallback when routine complex command reviews run out of completion budget. Non-stop completions still fail closed. Proof: both budget regressions fail against pre-fix production; all 85 reviewer/resource tests pass after the repair. Exact-head CI run 34725087843 is green. Mechanical rebase and empty CI refreshes preserve the reviewed fix. Closes openclaw#144476 Co-authored-by: MasterSwords1 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…penclaw#146585) Exclude automatic squash co-author credit backed only by tree-identical refresh commits. Pass commit-tree comparisons from the existing Git-history producer into the credit composer, preserving PR-author credit, explicit human credit, source trailers, and queue refusal when a preview requires correction. No runtime user-visible change. Native regression coverage and the exact-head CI gate passed; the independent maintainer review and ClawSweeper review found no actionable findings. Refs openclaw#144587 and openclaw#142167.
Closes #144476
What Problem This Solves
Fixes an issue where users running shell commands under
tools.exec.mode: "auto"would experience unexpected deferral to human approval when executing routine, complex commands (such as recursive directory searches, dense file listings, or multi-file inspections).When a reviewer model generates a thorough explanation or reasoning rationale for a complex command, verbose evaluations exceed the review completion budget and fail closed to human approval with
risk=unknown, causing approval fatigue and defeating automated approval for harmless operations.Why This Change Was Made
Raises the exec reviewer completion budget to a bounded 1,024-token default clamped downward to the selected model's advertised maximum output limits (floored to integer to prevent provider 400 Bad Request errors), while strictly preserving the incomplete-verdict safety contract so non-stop completions continue to fail closed to human approval.
Following maintainer review feedback, this patch is intentionally narrowed to the bounded default alone without expanding the configuration surface.
User Impact
Users and developers running diagnostic and multi-step shell commands will no longer encounter repetitive, false-positive human approval prompts for benign operations. Reviewer completions will reliably finish without hitting artificial token ceilings, eliminating approval fatigue while preserving strict human escalation for incomplete or genuinely risky executions.
Evidence
1. Real Provider Live Execution Proof
Executed directly against a live local LLM provider endpoint (
freellmapi/autovia Anthropic Messages protocol):2. Runtime Budget Resolution & Safety Contract Invariant Verification
Executed against real auto-reviewer runtime:
3. Focused Tests & Changed Gates
src/agents/exec-auto-reviewer.test.ts: 85/85 passed (100%)node scripts/check-changed.mjs:conflict markers: OKmax-lines suppression ratchet: OKassertion SAFETY comment ratchet: OKchangelog attributions: OKdoctor deprecation registry: OKguarded extension wildcard re-exports: OKplugin-sdk wildcard re-exports: OKduplicate scan target coverage: OKdependency pin guard: OKformat changed files(oxfmt): OKplugin boundaries: OKwrapper shadowing: OKpackage patch guard: OKcore tsgo graph boundary: OKtypecheck core: OKMaintainer rebase validation
The mechanical rebase preserves the reviewed 1,024-token default, smaller-model clamp, and rejection of incomplete responses. Its only conflict was the test-fixture migration to asynchronous disposal. Subsequent CI refresh commits are empty; current head is
02b263703d14d99a0b85733831a4b2da8f11607a.node scripts/run-vitest.mjs src/agents/exec-auto-reviewer.test.ts -t 'completion token budget'failed both budget regressions because the provider received 360 rather than 1,024/500 tokens.node scripts/run-vitest.mjs src/agents/exec-auto-reviewer.test.ts src/agents/exec-auto-reviewer.resources.test.tspassed all 85 tests, including after refreshing frozen dependencies.ClawSweeper review
The latest completed review, at
02b263703d14d99a0b85733831a4b2da8f11607a, has no actionable findings or before-merge work. No Rank-up moves require fixups or skips. The single requested re-review and subsequent automatic refreshes preserve the original review history.