Skip to content

improve(config): retire messages.suppressToolErrors so tool failures never end a run silently - #137775

Merged
steipete merged 4 commits into
mainfrom
retire-suppress-tool-errors
Sep 4, 2026
Merged

steipete merged 4 commits into
mainfrom
retire-suppress-tool-errors

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Related: #39406

What Problem This Solves

Resolves a problem where operators who set messages.suppressToolErrors: true to quiet noisy tool-failure bubbles also switched off the one warning that protects them from silent failures: when a run ends with a failed tool and the agent produces no reply at all, the user got nothing. The option had been added in February when tool-failure warnings were still delivered after successful replies; since July that warning only fires when a run would otherwise end silently, so the option's remaining effect was to allow exactly the silent-failure case. #39406 asked for finer-grained suppression on top of it.

Why This Change Was Made

The "tool error warning" is not a feature to configure, it is the no-reply guard: one ⚠️ <tool> failed line delivered only when a run ends with a tool failure and no user-facing reply. That guard is now unconditional. messages.suppressToolErrors is removed from the config contract, and openclaw doctor --fix deletes it from existing configs with the note Removed messages.suppressToolErrors (tool failure warnings now appear only when a run ends without a reply).; openclaw doctor without --fix reports the retired key with the same hint. The internal suppressToolErrorWarnings reply option (heartbeats already forced it off; only the skill-workshop review run still set it) is removed with it, together with the dispatch gate that dropped failed tool-result progress under the option. Mid-turn visibility of failed tools stays owned by the per-channel streaming settings (for Slack, recovered failures now settle as Recovered: … per #137523).

User Impact

  • A run that ends with a failed tool and no reply always produces the one-line warning; a user-facing reply, including one already sent through a messaging tool, still suppresses it.
  • messages.suppressToolErrors is no longer accepted. Existing configs are migrated by openclaw doctor --fix; config validation names the retired key until then.
  • No change for operators who never set the key.

Evidence

  • Doctor migration tests (legacy-config-migrations.runtime.retired.test.ts): the key is flagged with the doctor hint, --fix removes it and reports the message, configs without it are untouched. dead-config-keys.test.ts now lists messages.suppressToolErrors as schema-rejected.
  • Runtime tests: tool-error-warning.test.ts / payloads.test.ts keep the guard firing when no reply exists and silent when a reply exists; the suppression-only cases were removed. Dispatch and heartbeat tests no longer carry the flag.
  • Local: full requested scope 7,828 passed (384 files); pnpm check:changed passed; Codex autoreview (branch vs origin/main, P0/P1) scoped-clean. Production LOC net −14, tests net −136.
  • Live (isolated OPENCLAW_STATE_DIR, real build of this branch):
    • openclaw doctor on a config containing messages.suppressToolErrors: true reports under "Legacy config keys detected": messages.suppressToolErrors is retired; tool failure warnings now appear only when a run ends without a reply. Run "openclaw doctor --fix"., and the change preview lists Removed messages.suppressToolErrors (…). openclaw doctor --fix applies it and the key is gone from the written config. Until then config validation reports messages: Unrecognized key: "suppressToolErrors".
    • openclaw agent --local (anthropic/claude-sonnet-4-6, exec full): a turn that runs a failing tool and then replies done delivers exactly done with no warning payload.
    • A turn that runs a failing tool and answers NO_REPLY does not end silently: the embedded runtime's settled-turn finalization delivers its fallback reply ("The tool run finished, but no final summary was produced…"). Note for reviewers: in the embedded runtime both a nonzero exec exit and a missing-file read are returned as normal tool results (successfulToolNames lists them), so lastToolError is unset and the ⚠️ guard is not reachable from those inputs; it is the layer below finalization for thrown tool errors and aborted runs, which the unit tests in tool-error-warning.test.ts / payloads.test.ts cover. No live path exercised the removed suppression branch, which is the point of removing it.

Also in this PR

  • SDK compatibility (ClawSweeper P1): GetReplyOptions is exported from openclaw/plugin-sdk/reply-runtime in the v2026.8.2 and v2026.9.1 stable tags and carried suppressToolErrorWarnings, so the member stays as a @deprecated, ignored field with a named removal window (first stable release after 2026.10) and an SDK contract test; the runtime no longer reads it.
  • Shared CI (security-fast) breakage: the npm bulk advisory endpoint timeouts that turned this PR red were repaired on main (41f1b40, 3d30b3a) while this PR was open; this branch drops its own duplicate retry commit and rebases onto that fix.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review September 4, 2026 01:41
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes commands Command implementations agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 3, 2026, 11:55 PM ET / September 4, 2026, 03:55 UTC.

ClawSweeper review

What this changes

The branch retires messages.suppressToolErrors, migrates existing configurations with Doctor, and preserves external SDK type compatibility while making terminal no-reply tool-failure warnings unconditional.

Merge readiness

⛔ Blocked before merge - 5 items remain

No introduced functional or security defect was found. Current main still permits the suppression path, so this branch remains necessary rather than obsolete.

Priority: P1
Reviewed head: 382a940cefed2eff811a4ebf586d7a3c685decee

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, net-reducing owner-boundary repair with migration and public SDK compatibility coverage.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; source and focused test coverage exercise the changed warning and migration boundaries.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; source and focused test coverage exercise the changed warning and migration boundaries.
Evidence reviewed 7 items Terminal warning owner: The changed warning builder now suppresses only when a user-facing reply exists; its caller appends the warning whenever a terminal tool failure remains otherwise unrepresented.
Visible-reply boundary: Source replies delivered through the message tool are explicitly treated as completed user-facing delivery, preserving the no-duplicate-warning invariant.
Migration and strict-schema coverage: Doctor removes the retired key before validation, while the strict config schema no longer accepts it; focused tests cover true/false values, sibling preservation, diagnostics, and absent-key no-ops.
Findings None None.
Security None None.

How this fits together

The embedded agent runner collects tool outcomes and builds final channel payloads. When a failed tool would otherwise leave no user-facing reply, this path emits a fallback warning; Doctor repairs configurations that use the retired control.

flowchart LR
  A[Tool execution] --> B[Terminal tool outcome]
  B --> C[Embedded agent runner]
  C --> D{User-facing reply?}
  D -->|Yes| E[No fallback warning]
  D -->|No| F[Failure warning]
  G[Legacy configuration] --> H[Doctor migration]
  H --> I[Retired key removed]
Loading

Before merge

  • Resolve merge risk (P1) - Configurations that are not eligible for automatic startup repair must run openclaw doctor --fix before the retired strict key will validate.
  • Complete next step (P2) - Resolve or rerun the failing openclaw/ci-gate check on the exact PR head before merge.
  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -8, Tests -129, Docs -1, Generated -1. Total -139 across 33 files.

View PR surface stats
Area Files Added Removed Net
Source 16 29 37 -8
Tests 12 75 204 -129
Docs 2 1 2 -1
Config 0 0 0 0
Generated 3 3 4 -1
Other 0 0 0 0
Total 33 108 247 -139

Review metrics

Metric Value Why it matters
Production vs test delta production +29/-37 (net -8); tests +75/-204 (net -129) The repair reduces production surface while retaining coverage for the migration and public SDK compatibility contract.
Configuration surface 1 key removed; 1 Doctor migration added The supplied migration is the upgrade path for configurations that contain the retired key.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor/shared/legacy-config-migrations.runtime.retired.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Merge with the upgrade repair (recommended)
    Accept the deliberate behavior retirement with its existing automatic and Doctor-backed migration path.
  2. Pause the retirement
    Do not merge if maintainers decide existing configurations must retain control over terminal warning delivery.

Technical review

Best possible solution:

Keep the canonical no-reply warning, the Doctor migration, and the ignored deprecated SDK field through its stated removal window.

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

Yes, source-reproducible: on current main, a terminal tool failure with no user-facing reply and either suppression setting reaches the warning builder and returns no warning.

Is this the best way to solve the issue?

Yes: the embedded runner owns the final no-reply decision, and the branch removes the suppression there while providing the required config migration and SDK compatibility window.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8b7a1bba2bd2.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P1: The change protects a terminal failed-tool path that could otherwise leave a user with no visible outcome.
  • merge-risk: 🚨 compatibility: Strict configurations containing messages.suppressToolErrors need automatic repair or Doctor before they validate after upgrade.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; source and focused test coverage exercise the changed warning and migration boundaries.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The terminal warning is channel-visible, including to Telegram users, so Telegram E2E evidence would directly demonstrate the changed outcome.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vai-oro: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Moeed Ahmed: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-04T02:01:59.448Z sha 2dd8537 :: blocked before merge. :: [P1] Preserve the public reply option as a deprecated no-op
  • reviewed 2026-09-04T02:56:38.464Z sha eea6c1b :: blocked before merge. :: none

@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

The ClawSweeper before-merge items are addressed. Commit eea6c1b addresses P1/P2 by retaining GetReplyOptions.suppressToolErrorWarnings as a deprecated, ignored SDK field until the first stable release after 2026.10, with coverage in src/plugin-sdk/reply-runtime.contract.test.ts. The lead verified that the field shipped through openclaw/plugin-sdk/reply-runtime in v2026.8.2 and v2026.9.1. Runtime warnings remain unconditional when no visible reply exists.

The config compatibility item is covered by the Doctor migration already in this PR: both reporting the retired key and removing it with openclaw doctor --fix were verified live, as recorded in the PR body.

@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. 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. labels Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 4, 2026
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

The security-fast failures were a shared CI breakage: npm's bulk advisory endpoint timed out across unrelated branches. Commit f5101d2 adds bounded retry handling (three attempts with backoff, limited to timeouts, transport failures, HTTP 5xx, and HTTP 429), with tests and a test lint fix. The landing PR carries this CI repair per repository policy. Local pnpm check:changed and the audit tests pass, as verified by the lead.

The tool-failure warning is the no-reply guard: when a run ends with a
failed tool and no user-facing reply, one "⚠️ <tool> failed" line is
delivered instead of silence. messages.suppressToolErrors could silence
that guard (and hide failed tool progress), which allowed silent
failures. The guard is now unconditional, the key is removed, and
"openclaw doctor --fix" deletes it from existing configs with a note.
The internal suppressToolErrorWarnings reply option is removed with it.
Mid-turn failure visibility stays owned by channel streaming settings.

Refs #39406
…no-op

GetReplyOptions is exported from openclaw/plugin-sdk/reply-runtime in the
v2026.8.2 and v2026.9.1 stable tags and carried this option, so removing
the member would break external plugins at compile time. Keep it as an
ignored, deprecated field with a named removal window (first stable
release after 2026.10) and a contract test; the runtime no longer reads it.
@steipete
steipete force-pushed the retire-suppress-tool-errors branch from f5101d2 to 382a940 Compare September 4, 2026 03:25
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main's advisory retry fix and dropped the duplicate CI commit f5101d26e85d987aa0877d8167573e8904b3c2f7 entirely; main's retry policy, including its HTTP 429 behavior, stands. New head: 382a940cefed2eff811a4ebf586d7a3c685decee. The branch has exactly four commits and no diff under scripts/pre-commit or test/scripts. All 369 tests passed across the four requested Doctor, tool-error warning, dead-key, and reply-runtime contract test files.

@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Sep 4, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 4, 2026
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready at 382a940. Native review artifacts validated with no outstanding findings; prepare-run passed without changing the head.

Post-rebase local proof: pnpm test src/commands/doctor/shared/legacy-config-migrations.runtime.retired.test.ts src/agents/embedded-agent-runner/run/tool-error-warning.test.ts src/config/dead-config-keys.test.ts src/plugin-sdk/reply-runtime.contract.test.ts — 369 tests passed. Exact-head CI run 33833129038 completed successfully on attempt 3 after the npm advisory endpoint recovered.

The accepted evidence in the PR body includes live Doctor reporting and --fix removal of the retired config key. The terminal no-reply guard is unconditional; the shipped SDK option remains a deprecated ignored field until the first stable release after 2026.10, protected by its contract test. The branch uses main's advisory retry fix and carries no duplicate retry policy.

Known proof gap: the live agent probes exercised ordinary reply and NO_REPLY paths but did not reach the thrown-tool-error warning branch; focused warning/payload tests cover that branch, as already disclosed and accepted.

@steipete
steipete merged commit c6ea391 into main Sep 4, 2026
435 of 441 checks passed
@steipete
steipete deleted the retire-suppress-tool-errors branch September 4, 2026 04:40
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…never end a run silently (openclaw#137775)

* improve(config): retire messages.suppressToolErrors

The tool-failure warning is the no-reply guard: when a run ends with a
failed tool and no user-facing reply, one "⚠️ <tool> failed" line is
delivered instead of silence. messages.suppressToolErrors could silence
that guard (and hide failed tool progress), which allowed silent
failures. The guard is now unconditional, the key is removed, and
"openclaw doctor --fix" deletes it from existing configs with a note.
The internal suppressToolErrorWarnings reply option is removed with it.
Mid-turn failure visibility stays owned by channel streaming settings.

Refs openclaw#39406

* test(config): keep retired tool-error keys in the dead-key contract

* fix(config): refresh baseline after retiring tool error suppression

* refactor(plugin-sdk): keep suppressToolErrorWarnings as a deprecated no-op

GetReplyOptions is exported from openclaw/plugin-sdk/reply-runtime in the
v2026.8.2 and v2026.9.1 stable tags and carried this option, so removing
the member would break external plugins at compile time. Keep it as an
ignored, deprecated field with a named removal window (first stable
release after 2026.10) and a contract test; the runtime no longer reads it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M 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