Skip to content

fix(ui): preserve autonomous tool failures#100514

Merged
steipete merged 2 commits into
mainfrom
codex/pr-98888-autonomous-tool-errors
Jul 6, 2026
Merged

fix(ui): preserve autonomous tool failures#100514
steipete merged 2 commits into
mainfrom
codex/pr-98888-autonomous-tool-errors

Conversation

@steipete

@steipete steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

When two autonomous agent turns are adjacent in Control UI history, a successful reply in the later turn could make a failed tool from the earlier turn render as Tool output instead of Tool error.

Fixes #97849. Supersedes #98888 after its contributor fork could not retain the reviewed rebase ancestry; contributor credit is preserved through co-authorship and the maintainer release-note batch.

Why This Change Was Made

Gateway chat-history projection preserves sessions_send input provenance while displaying those messages as assistant-side forwarded groups. The Control UI now treats only groups with kind: inter_session and sourceTool: sessions_send as autonomous-turn boundaries before annotating tool outcomes.

The implementation deliberately does not use senderLabel alone: ordinary relay-labeled assistant replies still count as replies to the current turn. Existing non-text assistant content behavior is unchanged.

User Impact

Earlier autonomous tool failures remain visibly failed when a later autonomous turn recovers, while normal labeled assistant replies continue to mark their own tool turn as successful.

Evidence

  • Blacksmith Testbox: 136 focused Control UI tests plus the Chromium end-to-end regression passed.
  • Red proof: reverting the production hunk made the Chromium regression fail with both labels rendered as Tool output instead of Tool error followed by Tool output.
  • In-app browser: the exact projected transcript rendered ["Tool error", "Tool output"] before and after history reload.
  • Source-blind behavior contract: all four clauses passed, including reload reconstruction.
  • pnpm check:changed passed on the reviewed source tree.
  • Fresh takeover-branch autoreview: clean, overall patch correctness 0.93.
  • git diff --check passed.

The replacement keeps the focused implementation in one maintainer commit with Co-authored-by: qingminlong <[email protected]>. The contributor thank-you is queued in the maintainer-owned release-note batch.

AI-assisted: Yes (Codex).

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Jul 6, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1bff2b0e9f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CHANGELOG.md Outdated
- **Managed browser cookie persistence:** initialize new isolated macOS headless profiles with a non-interactive encryption key while preserving existing profile keys, and close Chromium through CDP before bounded signal fallback so persistent logins survive graceful browser and Gateway restarts. (#96704, #98284) Thanks @TurboTheTurtle.
- **MCP OAuth response bounds:** reject body-less foreign error bodies without calling their inherently unbounded `text()` fallback, while preserving HTTP status and headers for safe SDK diagnostics. (#98143) Thanks @Pick-cat.
- **Control UI approval prompts:** keep stale resolve failures and busy-state cleanup from leaking across newer approvals or Gateway reconnects. (#98394) Thanks @haruaiclone-droid.
- **Control UI autonomous tool failures:** keep an earlier failed turn's Tool error visible when a later autonomous turn recovers without an intervening user message. (#98888) Thanks @qingminglong.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the hand-written changelog entry

When this non-release fix lands as-is, it directly edits CHANGELOG.md even though the root AGENTS.md Docs / Changelog rule says the changelog is release-only and normal fixes/direct main commits should put release-note context in the PR body, squash message, or direct commit. Please drop this line so release generation remains the sole owner of the changelog and does not have to reconcile a hand-maintained entry/credit.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the codex/pr-98888-autonomous-tool-errors branch from 1bff2b0 to 7680336 Compare July 6, 2026 01:08
@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 9:12 PM ET / 01:12 UTC.

Summary
This PR teaches Control UI chat item annotation to treat preserved sessions_send inter-session provenance as an autonomous-turn boundary and adds unit plus Chromium E2E regression coverage.

PR surface: Source +11, Tests +133. Total +144 across 3 files.

Reproducibility: yes. Current main's shared chat annotation only resets at user groups, and Gateway source shows sessions_send forwarded turns arrive as assistant display groups with preserved provenance; I did not run tests because this review was read-only.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: ui/src/e2e/chat-tool-turn-outcome.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #97849
Summary: This PR is the focused candidate fix for the canonical adjacent autonomous-turn tool-error rendering regression.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Next step before merge

  • No ClawSweeper repair job is needed; maintainers can handle this as a normal merge candidate after protected-label and exact-head gate checks.

Security
Cleared: No concrete security or supply-chain concern found; the current diff is limited to Control UI runtime logic and tests with no dependency, workflow, secret, or package-resolution change.

Review details

Best possible solution:

Land this focused provenance-boundary fix after exact-head gates and maintainer handling pass, then let the linked issue close through the merged PR and release-note generation path.

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

Yes. Current main's shared chat annotation only resets at user groups, and Gateway source shows sessions_send forwarded turns arrive as assistant display groups with preserved provenance; I did not run tests because this review was read-only.

Is this the best way to solve the issue?

Yes. The PR uses the durable sessions_send provenance boundary instead of senderLabel or a naive assistant-boundary reset, and the added tests cover forwarded, ordinary labeled, empty, and non-text assistant cases.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 60cf7eaa005b.

Label changes

Label changes:

  • add P2: This PR fixes a contained but user-visible Control UI correctness regression that can make a failed autonomous turn look successful.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports after-fix Blacksmith Testbox runs, red-proof, in-app browser output showing ["Tool error", "Tool output"] before and after reload, and GitHub's Real behavior proof check passed.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body reports after-fix Blacksmith Testbox runs, red-proof, in-app browser output showing ["Tool error", "Tool output"] before and after reload, and GitHub's Real behavior proof check passed.

Label justifications:

  • P2: This PR fixes a contained but user-visible Control UI correctness regression that can make a failed autonomous turn look successful.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body reports after-fix Blacksmith Testbox runs, red-proof, in-app browser output showing ["Tool error", "Tool output"] before and after reload, and GitHub's Real behavior proof check passed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports after-fix Blacksmith Testbox runs, red-proof, in-app browser output showing ["Tool error", "Tool output"] before and after reload, and GitHub's Real behavior proof check passed.
Evidence reviewed

PR surface:

Source +11, Tests +133. Total +144 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 12 1 +11
Tests 2 133 0 +133
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 145 1 +144

What I checked:

Likely related people:

  • steipete: Current-main blame on the affected helper points to Peter Steinberger's recent chat-thread work, and the focused replacement PR is authored from the OpenClaw repo branch. (role: recent area contributor and replacement owner; confidence: high; commits: 3d4db8b10c6b, 83d0d9302696, 76803368e662; files: ui/src/pages/chat/chat-thread.ts, ui/src/pages/chat/chat-thread.test.ts, ui/src/e2e/chat-tool-turn-outcome.e2e.test.ts)
  • harjothkhara: Git history and PR metadata tie the original turnSucceeded annotation behavior to the merged Control UI fix in fix(ui): collapse non-terminal internal tool errors #90122. (role: introduced related behavior; confidence: high; commits: 355c43fe0c9e; files: ui/src/ui/chat/build-chat-items.ts, ui/src/ui/chat/grouped-render.ts, ui/src/ui/types/chat-types.ts)
  • altaywtf: Live PR metadata for the earlier merged Control UI fix records this user as the merger of the behavior now being refined. (role: merger of related behavior; confidence: medium; commits: 355c43fe0c9e; files: ui/src/ui/chat/build-chat-items.ts, ui/src/ui/chat/grouped-render.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 6, 2026
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready maintainer pass complete on 76803368e662a7c0f9f1a317623607b108ffba3f.

Verification:

No known proof gaps for the touched Control UI history surface.

@steipete
steipete merged commit 286c020 into main Jul 6, 2026
107 of 113 checks passed
@steipete
steipete deleted the codex/pr-98888-autonomous-tool-errors branch July 6, 2026 01:23
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 6, 2026
* fix(ui): preserve autonomous tool failures

Co-authored-by: qingminlong <[email protected]>

* chore: defer release note to maintainer batch

---------

Co-authored-by: qingminlong <[email protected]>
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
* fix(ui): preserve autonomous tool failures

Co-authored-by: qingminlong <[email protected]>

* chore: defer release note to maintainer batch

---------

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

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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.

Failed cron/autonomous turn shown as succeeded: cross-turn tool-error banner suppression (regression of #90122)

1 participant