fix(ui): keep failed agent turns visibly failed [AI-assisted]#97860
fix(ui): keep failed agent turns visibly failed [AI-assisted]#97860harjothkhara wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 29, 2026, 12:19 PM ET / 16:19 UTC. Summary PR surface: Source +43, Tests +14. Total +57 across 2 files. Reproducibility: yes. source-reproducible: current live tool messages carry Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Repair the turn-key contract so live tool messages and terminal assistant messages share the same boundary signal, cover the mixed-key regression, and then add redacted real Control UI/WebChat proof. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current live tool messages carry Is this the best way to solve the issue? No, not as written. The projection boundary is the right layer, but the key contract is incomplete unless terminal assistant messages are keyed too or keyed tools can still use a safe same-run fallback. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6de357ad4772. Label changesLabel justifications:
Evidence reviewedPR surface: Source +43, Tests +14. Total +57 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
Closes #97849
What Problem This Solves
Fixes an issue where users reviewing cron, scheduled, or autonomous Control UI/WebChat sessions could see a genuinely failed earlier agent-initiated turn as successful when a later adjacent run produced an assistant reply.
Why This Change Was Made
The shared chat item projection now scopes tool-error success suppression to explicit run/turn metadata (
runId,agentRunId,turnId, and the same keys under__openclaw). Adjacent assistant/tool display groups split when that metadata changes, while legacy transcripts without run metadata keep the existing user-boundary fallback from #90122.User Impact
Failed autonomous turns stay visibly failed instead of silently collapsing their red tool-error banner. The prior behavior for a failed internal tool followed by a same-run assistant reply is preserved.
Evidence
Behavior addressed: a genuinely failed agent-initiated turn was marked as succeeded when a later adjacent agent turn produced an assistant reply.
Real environment tested: local OpenClaw source checkout on current
mainfast-forwarded to6de357ad47, using the exportedbuildChatItemsprojection and the grouped renderer unit coverage.Exact steps or command run after this patch:
Evidence after fix:
build-chat-items.test.ts: 48 tests passed, including the new adjacent run-boundary regression.grouped-render.test.ts: 65 tests passed.git diff --check: clean.Observed result after fix: the earlier failed run keeps
turnSucceeded=false, while the later run with the assistant reply isturnSucceeded=true.What was not tested: no browser screenshot or live scheduled job was run; this is a shared projection fix covered at the deterministic UI model and renderer boundary. Local autoreview was attempted with
.agents/skills/autoreview/scripts/autoreview --mode localbut the Codex app rejected it under the external-review data-export policy, so no workaround was attempted.AI-assisted: yes. I understand the change: it keeps the #90122 same-turn suppression behavior, but prevents explicit run/turn metadata from leaking a later reply backward into an earlier failed autonomous turn.