Repository navigation
fix: stop automations posting a bare "Tool Call failed" after repeating their result - #202142
Conversation
…ng their result OpenClaw-Publication: 2b8f6c43-3881-8898-88b6-b473810ac89d
|
🦞👀 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. What this changesAccepts 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherAutomation 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]
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +14, Tests +63, Docs +2. Total +79 across 7 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 19, 2026, 7:34 PM ET / November 20, 2026, 00:34 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…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
…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)
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 failedbubble 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:
⚠️ Automations failed, not the genericTool Call.Why This Change Was Made
record_resultagain with the same outcome and summary returns the result that was already accepted. Recording a different second result is still rejected.How this was introduced:
⚠️ <tool> failedwarning unconditional.dispatch_action(fix: Tool Search uses one dispatcher name across providers #169552).no_changeruns. That is why the duplicate reached an unattended run.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→automationsrecord_resulttwice through Tool Search, then ends withNO_REPLY. The harness reads the session'schat.history. The proof harness is not part of the PR.record_resultcallede5c7d55d744999no_change)⚠️ Tool Call failedno_change)⚠️ Tool Call failed: record_result already accepted for this automation runprogress)⚠️ Tool Call failed⚠️ Automations failedprogress)⚠️ Tool Call failed: record_result already accepted for this automation run⚠️ Automations failed: record_result already accepted for this automation runWhat this shows:
full.All 8 cron runs finished with status
ok. Tool Search offereddispatch_action, andautomationswas reached only through it.Unit-level coverage:
dispatch_actioncall through the real agent loop and builds the final reply. Onmainit produces["⚠️ Tool Call failed"]. With this change it produces["⚠️ Automations failed"], and at full verbosity it adds the reason.record_resultresolves with the result that was already accepted. Onmainit threwrecord_result already accepted. A conflicting second result is still rejected.Commands and run details
--provider local-container, imagenode:24.22.1-trixie(sha256:f1e034976f948cf212ef1f659c12e5dd58ac7eab947831813e81a62401ca38be). Both leases stopped (leaseStopped: true).cbx_96216514bddc, HEADede5c7d5fa5f0da8ff6dfc71404b1c3d00839525, exit 0, 6m24s.cbx_2bdc14e90d7b, HEAD5d74499942247aa0fbc0482da765888e46721e44, 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:coreandpnpm tsgo:core:test: passed.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