Skip to content

fix(qa): restore failed-tool recovery scenarios - #126971

Merged
steipete merged 3 commits into
mainfrom
fix/cron-qa-failed-tool-honesty
Aug 21, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/cron-qa-failed-tool-honesty

Conversation

@steipete

@steipete steipete commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a QA contract drift where cron, qa-channel, and OTEL failed-tool terminal-finalization coverage still required retired wording after the production recovery prompt adopted the canonical failure-honesty instruction.

Why This Change Was Made

Synchronizes every located consumer of the shared mock-provider gate with the canonical production instruction: If a tool failed, say so; never claim completion or success. The cron and qa-channel scenarios exercise the same embedded-agent settled-tool recovery contract, and the OTEL assertion observes that contract through the real Gateway path.

This is QA-only and does not change cron, channel, or Gateway behavior.

User Impact

No product behavior changes. Maintainers regain reliable coverage proving cron and direct qa-channel turns with a failed terminal tool send one honest final reply rather than claiming success, including the OTEL runtime boundary.

Exact-Head Evidence

Reviewed and exercised head: d1f093e97bc6bd5bb3cc098699ffe79efcfe92f8.

  • Retired phrase search: zero repository matches.
  • Direct OTEL Gateway runtime E2E: 1/1 passed.
  • Exact cron scenario: 1/1 passed with ENOENT ... calls=1 failed=1 finalizations=1.
  • Exact qa-channel scenario: 1/1 passed with ENOENT ... calls=1 failed=1 finalizations=1.
  • Mock-compatible scheduling pack: 8/8 passed.
  • Qa-channel-compatible channel pack: 26/28 passed, including the repaired failed-tool scenario. The two failures are unrelated existing diagnostic-flow issues and reproduce individually: message-tool-stranded-final-retry-failure and provider-http-503-visible-failure receive their expected sanitized error replies, which waitForOutboundMessage classifies as failures before their assertions.
  • Mock-provider suite: 271/271 tests passed.
  • Full five-file check-changed gate passed formatting, guards, plugin doctor (5/5), all core/UI/extensions/scripts/root typechecks, lint (0 warnings/errors), and import-cycle checks (0 cycles).
  • Cron Control UI unit suite: 221/221 tests passed.
  • Mocked-Gateway cron browser suite: 19/19 tests passed.
  • Native scheduling contracts: 23/23 tests passed.
  • Independent read-only source review of the exact head found no actionable in-scope findings and confirmed the prior ClawSweeper OTEL P2 is resolved.
  • TruffleHog preflight passed.

The required repository autoreview was attempted on the exact branch diff. TruffleHog passed, but the official Codex CLI's available OpenAI credential returned HTTP 401. No local Codex result is claimed; the independent exact-head source review is retained instead.

No screenshot is attached because the patch changes QA expectations only. DOM/accessibility coverage remains represented by the passing 221-test Control UI unit suite and 19-test mocked-Gateway browser suite; no UI DOM changed in this patch.

Scope

Five QA/test files, each +1/-1: total +5/-5, production LOC +0/-0.

Known outside this explicitly authorized scope: the two channel diagnostic flows above need owner follow-up. They are not caused by this wording-only patch.

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 4:21 AM ET / 08:21 UTC.

ClawSweeper review

What this changes

The PR updates a mock-provider gate, its unit test, cron and qa-channel scenarios, and an OTEL Gateway E2E assertion to use the canonical failed-tool recovery instruction.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this maintainer-owned draft open: current main’s production recovery instruction is canonical, while five QA consumers still assert retired wording; the branch synchronizes those consumers and introduces no actionable defect.

Priority: P2
Reviewed head: d1f093e97bc6bd5bb3cc098699ffe79efcfe92f8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-aligned QA repair with reported exact-head runtime coverage and no actionable patch finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this maintainer-owned PR; its body nevertheless records exact-head Gateway and scenario results.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this maintainer-owned PR; its body nevertheless records exact-head Gateway and scenario results.
Evidence reviewed 7 items Current-main production contract: Current main defines the canonical instruction and appends it only when the exact settled batch contains a failed tool.
Current-main drift: Current main’s canonical production string differs from the retired string retained by the mock gate, both scenarios, and the OTEL assertion.
Exact branch change: The branch changes exactly the five stale QA consumers from the retired text to the production instruction; no production runtime behavior changes.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs extensions/qa-lab/src/providers/mock-openai/server.test.ts --testNamePattern "scripts one failure-honest Code Mode terminal-tool continuation"

Result: PASS (completed)

node scripts/run-vitest.mjs extensions/qa-lab/src/providers/mock-openai/server.test.ts --testNamePattern "scripts one failure-honest Code Mode terminal-tool con
tinuation"
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126971-TyICgL/target$ node scripts/run-vitest.mjs extensions/qa-lab/src/providers/mock-openai/server.test.ts --
testNamePattern "scripts one failure-honest Code Mode terminal-tool continuation"
node scripts/run-vitest.mjs extensions/qa-lab/src/providers/mock-openai/server.test.ts --testNamePattern "scripts one failure-honest Code Mode terminal-tool con
tinuation"
[test] starting test/vitest/vitest.extension-qa.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-126971-TyICgL/target

 ✓  extension-qa  extensions/qa-lab/src/providers/mock-openai/server.test.ts (271 tests | 270 skipped) 140ms

 Test Files  1 passed (1)
      Tests  1 passed | 270 skipped (271)
   Start at  08:22:26
   Duration  2.62s (transform 1.94s, setup 931ms, import 1.20s, tests 140ms, environment 0ms)

[test] passed 1 Vitest shard in 8.53s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126971-TyICgL/target$ node scripts/run-vitest.mjs extensions/qa-lab/src/providers/mock-openai/server.test.ts --
testNamePattern "scripts one failure-honest Code Mode terminal-tool continuation"































Assertions:

  • PASS expect_output: scripts one failure-honest Code Mode terminal-tool continuation

How this fits together

The embedded-agent runner appends an honesty instruction when a settled failed tool needs a user-visible final reply. QA Lab’s mock provider, channel/cron scenarios, and OTEL Gateway E2E test verify that recovery and delivery contract.

flowchart LR
A[Failed tool result] --> B[Embedded-agent recovery]
B --> C[Failure-honesty instruction]
C --> D[Final user reply]
D --> E[QA channel and cron scenarios]
D --> F[OTEL Gateway E2E]
C --> G[Mock provider contract]
Loading

Before merge

  • Resolve merge risk (P1) - The read-only checkout could not replay tests or retrieve complete history because the environment has no GitHub DNS access; retain the PR’s exact-head runtime proof and GitHub mergeability gate before landing.
  • Complete next step (P2) - No repair lane is needed: the patch has no actionable defect, but its maintainer ownership, protected label, and draft state require maintainer disposition.
Agent review details

Security

None.

PR surface

Source 0, Tests 0, Other 0. Total 0 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 2 2 2 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 2 2 0
Total 5 5 5 0

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; test and QA-support +5/-5 All five edits restore test-contract alignment; the shipped recovery path is unchanged.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Preserve the canonical production wording and merge the synchronized QA expectations once the owning maintainer takes this draft through the normal exact-head merge gate.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Preserve the canonical production wording and merge the synchronized QA expectations once the owning maintainer takes this draft through the normal exact-head merge gate.

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

Yes—source-reproducible with high confidence: current main emits the canonical instruction while the affected mock and scenario assertions still require the retired text.

Is this the best way to solve the issue?

Yes. Updating every located QA consumer to the production-owned canonical instruction is narrower and safer than changing the recovery behavior back to satisfy stale fixtures.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0a0d343cf299.

Labels

Label changes:

  • remove merge-risk: 🚨 automation: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This restores bounded QA coverage for an existing failed-tool recovery and delivery invariant across cron, channel, and Gateway paths.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this maintainer-owned PR; its body nevertheless records exact-head Gateway and scenario results.

Evidence

What I checked:

Likely related people:

  • steipete: The available current-main blame boundary and sampled history attribute the canonical instruction and affected QA paths to commit 3cf3358; deeper introduction history is unavailable in this shallow checkout. (role: recent current-main area contributor; confidence: medium; commits: 3cf33583db0e; files: src/agents/tool-outcome-instructions.ts, extensions/qa-lab/src/providers/mock-openai/server.ts, qa/scenarios/channels/qa-channel-failed-tool-terminal-finalization.yaml)

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 (4 earlier review cycles)
  • reviewed 2026-08-21T03:38:09.028Z sha 78fb00c :: needs changes before merge. :: [P2] Synchronize the remaining failed-tool recovery assertions
  • reviewed 2026-08-21T03:49:12.904Z sha 78fb00c :: found issues before merge. :: [P2] Update the remaining failed-tool recovery assertions
  • reviewed 2026-08-21T04:53:12.612Z sha 4d2741b :: found issues before merge. :: [P2] Update the OTEL failed-tool assertion
  • reviewed 2026-08-21T06:23:53.987Z sha d1f093e :: needs maintainer review before merge. :: none

@steipete steipete changed the title fix(qa): restore cron failed-tool recovery scenario fix(qa): restore failed-tool recovery scenarios Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 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 removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 21, 2026
@RomneyDa

Copy link
Copy Markdown
Member

@clawsweeper re-review

Addressed the remaining OTEL rank-up finding on d1f093e97bc: the real-Gateway OTEL assertion now requires the same canonical failure-honesty sentence as the recovery producer and mock-provider gate. Production LOC remains unchanged; test delta is +1/-1. git diff --check passed. Remote exact-head CI owns the focused runtime proof because this isolated worktree intentionally has no dependencies.

@clawsweeper

clawsweeper Bot commented Aug 21, 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 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 Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Exact-head focused proof for d1f093e97bc6bd5bb3cc098699ffe79efcfe92f8 is now attached to the PR body: direct OTEL E2E 1/1, cron 1/1, qa-channel 1/1, scheduling pack 8/8, mock-provider 271/271, and the full five-file check-changed gate all pass. The repaired scenario also passes in the 26/28 channel pack; its two remaining failures are unrelated existing diagnostic-classification issues. Retired wording has zero repository matches. Independent exact-head source review found no actionable findings. Local Codex autoreview remains unavailable due HTTP 401, reported without claiming a result.

@clawsweeper

clawsweeper Bot commented Aug 21, 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 removed the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Aug 21, 2026
@steipete steipete self-assigned this Aug 21, 2026
@steipete
steipete marked this pull request as ready for review August 21, 2026 09:10

Copy link
Copy Markdown
Contributor Author

Land-ready evidence for immutable head d1f093e97bc6bd5bb3cc098699ffe79efcfe92f8:

  • Exact local proof: real-Gateway OTEL 1/1; isolated cron 1/1; isolated qa-channel 1/1; scheduling pack 8/8; mock provider 271/271; full five-file changed gate passed; retired wording has zero matches.
  • Hosted exact-head CI run 32466650171 completed successfully with no failed jobs; openclaw/ci-gate is green on this SHA.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 126971 completed at 2026-08-21T09:19:35Z in hosted_exact_or_recent_parent mode, reusing that exact-head hosted gate; no separate Testbox lease was needed. Remote PR and prep heads remain byte-identical.
  • Independent exact-head verification accepted the patch. Hosted ClawSweeper/Codex found no findings and its focused live assertion passed 1/1. The local repo autoreview's TruffleHog preflight was clean, but its Codex credential returned HTTP 401; no local Codex result is claimed.
  • Production LOC: +0/-0. QA/test support: +5/-5. GitHub reports the PR mergeable with a clean current-main merge tree.

The broader channel pack's two existing diagnostic-classification failures were not selected by, and did not fail, any required exact-head gate. They remain follow-up work outside this wording-only repair.

@steipete
steipete merged commit 9c3335a into main Aug 21, 2026
308 checks passed
@steipete
steipete deleted the fix/cron-qa-failed-tool-honesty branch August 21, 2026 09:20

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 22, 2026
* fix(qa): sync cron failed-tool honesty fixture

* fix(qa): sync channel failed-tool honesty fixture

Amp-Thread-ID: https://ampcode.com/threads/T-01a02218-492f-73b8-8514-ef342917e129

* test(qa): sync OTEL failed-tool assertion

---------

Co-authored-by: Amp <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

3 participants