Skip to content

fix: stop automations posting a bare "Tool Call failed" after repeating their result - #202142

Merged
jalehman merged 2 commits into
mainfrom
openclaw/glow-shrimp-2
Nov 20, 2026
Merged

jalehman merged 2 commits into
mainfrom
openclaw/glow-shrimp-2

Conversation

@jalehman

@jalehman jalehman commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #202140

What Problem This Solves

Sometimes an automation records its result through Tool Search, then records the same result again. When that happens, the run posts a standalone ⚠️ Tool Call failed bubble to the chat. Nothing actually failed, because the first result was saved. But the bubble doesn't name a tool or give a reason, so people can't tell whether something broke.

User Impact

User impact:

  • If an automation records the same result twice, the run stays quiet as intended.
  • Tool failures called through Tool Search now name the real tool, for example ⚠️ Automations failed, not the generic Tool Call.

Why This Change Was Made

How this was introduced:

Not changed: the warning includes the error text only when verbose is set to full. Existing tests deliberately keep raw tool errors out of the default notice.

Evidence

End-to-end, real Gateway, base vs. this PR. I ran this on the Mac Studio in Crabbox Linux containers. Each scenario starts a real Gateway and force-runs a cron automation on a session. A scripted OpenAI Responses model calls dispatch_action → automations record_result twice through Tool Search, then ends with NO_REPLY. The harness reads the session's chat.history. The proof harness is not part of the PR.

Second record_result call Verbose Base ede5c7d5 This PR 5d744999
Identical (no_change) off ⚠️ Tool Call failed no bubble (second call returns the saved result)
Identical (no_change) full ⚠️ Tool Call failed: record_result already accepted for this automation run no bubble
Different (progress) off ⚠️ Tool Call failed ⚠️ Automations failed
Different (progress) full ⚠️ Tool Call failed: record_result already accepted for this automation run ⚠️ Automations failed: record_result already accepted for this automation run

What this shows:

  • Base reproduces the reported bubble exactly.
  • With this PR, an identical repeat stays silent.
  • A real rejection names the real tool.
  • The reason appears only when verbose is full.

All 8 cron runs finished with status ok. Tool Search offered dispatch_action, and automations was reached only through it.

Unit-level coverage:

  • Reproduced first, before changing any code. A new subscription-level test sends a failing dispatch_action call through the real agent loop and builds the final reply. On main it produces ["⚠️ Tool Call failed"]. With this change it produces ["⚠️ Automations failed"], and at full verbosity it adds the reason.
  • New test for the repeated call. An identical second record_result resolves with the result that was already accepted. On main it threw record_result already accepted. A conflicting second result is still rejected.
  • Existing suites pass: the warning, payload-error and tool-terminal-outcome suites.
  • Independent review: no P0–P2 findings.
Commands and run details
  • Crabbox runs: --provider local-container, image node:24.22.1-trixie (sha256:f1e034976f948cf212ef1f659c12e5dd58ac7eab947831813e81a62401ca38be). Both leases stopped (leaseStopped: true).
    • Base: lease cbx_96216514bddc, HEAD ede5c7d5fa5f0da8ff6dfc71404b1c3d00839525, exit 0, 6m24s.
    • Fix: lease cbx_2bdc14e90d7b, HEAD 5d74499942247aa0fbc0482da765888e46721e44, exit 0, 6m02s.
  • node scripts/run-vitest.mjs run src/agents/tool-terminal-outcome.test.ts src/agents/tools/cron-tool.automation.test.ts src/agents/embedded-agent-runner/run/tool-error-warning.test.ts src/agents/embedded-agent-runner/run/payloads.errors.test.ts: 4 shards passed.
  • pnpm tsgo:core and pnpm tsgo:core:test: passed.
  • oxlint on the changed files: no problems.
  • node scripts/run-format.mts --check: clean.
  • pnpm check:test-lines-ratchet: OK, +63 lines against an allowance of 400.

Gap: the end-to-end proof uses a scripted model, not a live LLM.

🦞 Made with OpenClaw

@clawsweeper

clawsweeper Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: S labels Nov 20, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 20, 2026
@clawsweeper

clawsweeper Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Accepts identical repeated automation results and names the called tool in Tool Search failure warnings.

Example: An automation calls record_result with outcome no_change twice through dispatch_action, then finishes silently.

  • Before: The second call throws and chat receives “⚠️ Tool Call failed”.
  • After: The second call returns the accepted result without generating a failure warning.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and has no identified defect, but required behavior proof is absent and the failed CI job remains unattributed.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An unattended automation appears to fail after harmlessly repeating an already accepted result, and its warning hides the actual tool name.
Reason: The focused repair addresses a concrete reported workflow, preserves conflicting-result rejection, and follows the established Tool Search presentation contract.

Merge readiness

✅ Ready for maintainer review

This PR addresses a current, source-verifiable automation bug with a focused change; no introduced correctness or security defect was found.

Priority: P2
Reviewed head: 5d74499942247aa0fbc0482da765888e46721e44

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The PR owner should provide redacted Gateway logs or terminal screenshots showing identical repeated no_change calls finishing quietly, a conflicting result remaining rejected, and a genuine dispatched failure naming Automations.
Agent review details

How this fits together

Automation tools record invocation results in the run registry; the shared terminal observer tracks tool failures, and the payload builder converts unresolved failures into chat warnings.

flowchart TD
  A[Scheduled agent turn] --> B[Tool Search dispatcher]
  B --> C[Automation result recorder]
  B --> D[Terminal outcome observer]
  D --> E[Failure warning formatter]
  C --> F[Final payload builder]
  E --> F
  F --> G[Conversation]
Loading

Technical review

Best possible solution:

Keep normalized duplicate acceptance in the existing recorder and reuse the shared display projection while preserving genuine failure warnings.

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

Current source establishes the duplicate rejection, no_change warning eligibility, and dispatcher label; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch is the smallest complete owner-level repair: it accepts identical normalized results and carries presentation identity through the existing failure summary without changing recovery matching.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0b4d5d08b689.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +14, Tests +63, Docs +2. Total +79 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 19 5 +14
Tests 2 63 0 +63
Docs 1 5 3 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 87 8 +79

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: A bounded automation workflow emits a misleading failure notice despite having accepted its result.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A bounded automation workflow emits a misleading failure notice despite having accepted its result.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide the Gateway behavior evidence described in the proof assessment.
  • Attribute the failed automation read-boundary check using a matching base failure or a head-versus-revert comparison.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 19, 2026, 7:34 PM ET / November 20, 2026, 00:34 UTC.

@jalehman
jalehman merged commit 3ecec13 into main Nov 20, 2026
148 of 153 checks passed
@jalehman
jalehman deleted the openclaw/glow-shrimp-2 branch November 20, 2026 02:35
@jalehman

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 20, 2026
…ng their result (openclaw#202142)

* fix: name the called tool in automation failure notices and accept repeated results

* fix: stop automations posting a bare "Tool Call failed" after repeating their result

OpenClaw-Publication: 2b8f6c43-3881-8898-88b6-b473810ac89d
tideclaw-bot pushed a commit that referenced this pull request Nov 23, 2026
…202142)

Return the already-accepted normalized result for identical retries and render
the dispatched catalog tool in terminal failure warnings, without changing
invocation custody or tool recovery identity.

Release closure: audited recorder -> invocation tool -> cron run/finalize and
subscriber -> terminal observer -> payload warning. Later ccc83c7 changes
successful-empty one-shot deletion (held row 14), not this invariant; no later
source PR/SHA follow-up was found through c29f72b.
No production adaptation from the reviewed source carrier.

Regression-only baseline: repeated result threw; dispatched warning regressions
rendered Tool Call at both tested verbosity levels. Focused green proof covers
six files/four Vitest shards, including the existing lifecycle/recovery tests.

OpenClaw-Publication: 2b8f6c43-3881-8898-88b6-b473810ac89d
(cherry picked from commit 3ecec13)
(cherry picked from commit 5c4fc7b96c589517b9cf95c2571352837c4426e5)
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit b6064dcdf8672d4e8604299d8a82d83f5052b6d0)
(cherry picked from commit d4472732bdea9e5b2001bba106db2a6ae77a2551)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S 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.

Automation runs post a bare "⚠️ Tool Call failed" when record_result is repeated through Tool Search

1 participant