Skip to content

fix: show authoritative tool outcomes - #163545

Merged
RomneyDa merged 4 commits into
mainfrom
fix/control-ui-tool-unknown
Oct 3, 2026
Merged

RomneyDa merged 4 commits into
mainfrom
fix/control-ui-tool-unknown

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Closes #163543
Supersedes the narrower Wait-only fix in #160450.

What Problem This Solves

Fixes: Control UI labels active and authoritatively completed Codex tool calls as Outcome unknown when a status-less history placeholder or discarded native terminal item wins projection.

User Impact

User impact: active tool rows now show Running, and Wait, collaboration, and subagent actions show their exact completed or failed outcome when Codex supplies one; genuinely ambiguous results remain unknown.

Why This Change Was Made

The fix restores the existing fact precedence at both owners:

  • Control UI's canonical outcome resolver falls through a status-less history activity to the live run state instead of treating object presence as a terminal fact.
  • The Codex transcript projector correlates same-ID raw calls with collaboration and subagent terminal items, including output-before/outcome and outcome-before/output ordering.
  • Exact Script completed / Script failed envelopes now apply to Wait as well as Exec; yielded and unrecognized envelopes stay unknown.

No fallback, config, protocol, or persistence surface is added. Production delta is +14 net lines in the Codex projector and net zero in Control UI; tests add +182 net lines across the two owner boundaries.

Evidence

Before, the active tool row incorrectly says Outcome unknown:

Control UI before: active tool row says Outcome unknown

After, the identical history and live event say Running:

Control UI after: active tool row says Running

Pre-fix proofs failed for the intended reasons:

  • browser fixture: expected Running, received Outcome unknown
  • Control UI unit regression: expected running, received unknown
  • Codex projection: completed/failed collaboration, subagent, and Wait cases retained unknown or false success

Post-fix validation:

  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test extensions/codex/src/app-server/event-projector.output-fidelity.test.ts ui/src/pages/chat/components/chat-tool-cards.node.test.ts ui/src/pages/chat/components/chat-tool-cards.test.ts — 89 passed across two routed shards
  • isolated Control UI browser fixture — 1 passed; inspected before/after screenshots above
  • node scripts/check-changed.mjs — passed the full changed typecheck, lint, ratchet, dead-export, boundary, and import-cycle plan
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --max-priority P2 — no accepted/actionable findings

Codex contract checked directly in ../codex at exact tag rust-v0.160.0: collaboration statuses include interrupted; app-server native items retain same IDs across start/completion notifications.

Test cost

One-worker local wall times on rebased head feda0718748572c759f2ca08578fa841811135b1:

  • Control UI shard: 8.44 s (66 tests across two files)
  • Codex shard: 55.53 s (23 tests)
  • routed wrapper total: 69.25 s

Exact-head CI run 37151725724 completed successfully in 485 seconds (8m 05s).

@clawsweeper

clawsweeper Bot commented Oct 2, 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.

@RomneyDa
RomneyDa marked this pull request as ready for review October 2, 2026 13:16
@RomneyDa
RomneyDa enabled auto-merge (squash) October 2, 2026 13:21
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 4:46 PM ET / 20:46 UTC (Revision 8).

ClawSweeper review

What this changes

The PR makes Control UI show active tools as Running and preserves Codex’s reported outcomes for Wait and same-ID collaboration calls.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on current main, and both previous findings are resolved. No blocking correctness or security finding remains; this member-authored PR should remain open for normal landing.

Priority: P2
Reviewed head: feda0718748572c759f2ca08578fa841811135b1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with inspected visual proof, meaningful boundary regressions, successful exact-head CI, and no remaining actionable finding.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after browser-fixture screenshots directly show the changed UI resolver producing Running for the same history/live scenario. Codex notification regressions supplement that visual proof; the MEMBER author is exempt from unrelated external-contributor runtime proof. No stored-data format or migration contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after browser-fixture screenshots directly show the changed UI resolver producing Running for the same history/live scenario. Codex notification regressions supplement that visual proof; the MEMBER author is exempt from unrelated external-contributor runtime proof. No stored-data format or migration contract changes.
Evidence reviewed 10 items Pinned introduction and merge ownership: Reviewed the merge-base-to-head introduction. The test merge’s raw parents are exactly the pinned base followed by the pinned PR head; its result changes only the six introduced paths, preserving unrelated base work.
Current main still needs the repair: At fetched main, status-less activity still immediately resolves to unknown, and native transcript projection still excludes collaboration items. The adjacent merged repair #164116 addresses native failure recovery rather than these remaining outcomes.
Previous findings resolved: The shared status map now treats interrupted as failed. The UI fallback requires an active run, a live card, and no completed result; status-less terminal activity remains unknown. Added notification-boundary and extraction/rendering regressions cover these two earlier findings.
Findings None None.
Security None None.

How this fits together

The Codex plugin translates app-server tool events into OpenClaw’s transcript. Control UI combines that history with live run facts to display tool progress and outcomes.

flowchart LR
  A[Codex tool events] --> B[Transcript projection]
  B --> C[Tool history]
  C --> E[Outcome resolver]
  D[Live run facts] --> E
  E --> F[Visible tool status]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +18, Tests +210. Total +228 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 48 30 +18
Tests 3 216 6 +210
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 264 36 +228

Review metrics

Metric Value Why it matters
Production versus regression coverage production +18 net lines; tests +210 net lines The introduced growth repairs two existing owner boundaries and adds outcome-ordering regressions without adding configuration or API surface.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #163543
Summary: This PR owns the reported active and terminal outcome repair; the merged native-failure work is adjacent.

Members:

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

Technical review

Best possible solution:

Keep outcome decisions in the existing transcript projector and UI resolver, preserving exact response content and uncertainty when no trustworthy terminal fact exists.

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

Yes, from source: active status-less history masks live-running facts, and current main excludes same-ID collaboration terminal results. This review inspected regressions and screenshots without executing a reproduction.

Is this the best way to solve the issue?

Yes. The patch repairs the existing outcome owners, uses exact identities and result envelopes, and preserves unknown terminal outcomes rather than inventing success.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 930bd387bbaa.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Misleading tool outcomes impair operator understanding while tool execution itself remains functional.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after browser-fixture screenshots directly show the changed UI resolver producing Running for the same history/live scenario. Codex notification regressions supplement that visual proof; the MEMBER author is exempt from unrelated external-contributor runtime proof. No stored-data format or migration contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after browser-fixture screenshots directly show the changed UI resolver producing Running for the same history/live scenario. Codex notification regressions supplement that visual proof; the MEMBER author is exempt from unrelated external-contributor runtime proof. No stored-data format or migration contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after browser-fixture screenshots directly show the changed UI resolver producing Running for the same history/live scenario. Codex notification regressions supplement that visual proof; the MEMBER author is exempt from unrelated external-contributor runtime proof. No stored-data format or migration contract changes.

Evidence

What I checked:

  • Pinned introduction and merge ownership: Reviewed the merge-base-to-head introduction. The test merge’s raw parents are exactly the pinned base followed by the pinned PR head; its result changes only the six introduced paths, preserving unrelated base work. (1889a9d1b5da)
  • Current main still needs the repair: At fetched main, status-less activity still immediately resolves to unknown, and native transcript projection still excludes collaboration items. The adjacent merged repair fix: show failed native tools in Codex transcripts #164116 addresses native failure recovery rather than these remaining outcomes. (ui/src/lib/chat/tool-cards.ts:155, 930bd387bbaa)
  • Previous findings resolved: The shared status map now treats interrupted as failed. The UI fallback requires an active run, a live card, and no completed result; status-less terminal activity remains unknown. Added notification-boundary and extraction/rendering regressions cover these two earlier findings. (extensions/codex/src/app-server/event-projector-items.ts:23, feda07187485)
  • Outcome and output ordering: Same-ID correlation reuses recorded raw calls. Terminal results retain their status while separately arriving response output enriches content; checkpoints wait for promised raw output. Wait uses the existing strict script-envelope parser, retaining yielded and unrecognized results as unknown. (extensions/codex/src/app-server/event-projector-tool-transcript.ts:237, feda07187485)
  • Dependency contract applies: The changed projector consumes Codex app-server item identities and statuses, and the PR expressly claims compatibility with rust-v0.160.0. The harness documentation assigns native execution to Codex and visible transcript projection to OpenClaw, establishing the dependency boundary. Public docs: docs/plugins/codex-harness.md. (docs/plugins/codex-harness.md:12, feda07187485)
  • Personally inspected pinned Codex contract: Verified dependency ownership through the backing cache’s GitHub origin. The sibling HEAD matches peeled rust-v0.160.0. Collaboration status includes Interrupted; event mapping preserves call_id in start/completion items. Subagent activity is status-less and carries its own event ID, so the adapter only correlates it when an exact raw-call identity exists. (codex-rs/app-server-protocol/src/protocol/v2/item.rs:1223, a956835d0207)

Likely related people:

  • joshavant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (7 earlier review cycles)
  • reviewed 2026-10-02T13:22:23.170Z sha a1e7935 :: needs changes before merge. :: [P2] Preserve interrupted collaboration outcomes in the durable result
  • reviewed 2026-10-02T13:45:21.194Z sha 98b0930 :: needs changes before merge. :: [P2] Preserve interrupted collaboration outcomes in the durable result
  • reviewed 2026-10-02T17:12:02.990Z sha aab5fcc :: needs changes before merge. :: none
  • reviewed 2026-10-02T17:23:12.004Z sha aab5fcc :: needs changes before merge. :: [P2] Preserve unknown outcomes for status-less terminal activity
  • reviewed 2026-10-02T17:31:52.256Z sha aab5fcc :: needs changes before merge. :: [P2] Preserve unknown outcomes for status-less terminal activity
  • reviewed 2026-10-02T17:40:16.025Z sha 7601fa9 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-03T20:33:44.557Z sha feda071 :: needs maintainer review before merge. :: none

@RomneyDa
RomneyDa disabled auto-merge October 2, 2026 13:25
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 Oct 2, 2026
@RomneyDa
RomneyDa force-pushed the fix/control-ui-tool-unknown branch from 98b0930 to aab5fcc Compare October 2, 2026 17:06
@RomneyDa

RomneyDa commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

The interrupted collaboration finding is fixed at the shared Codex item-status owner, with before/after completion notification-boundary regressions. Exact pinned Codex 0.150.1 contract inspected; focused tests, changed gates, and fresh P2 autoreview are clean on aab5fcc5d1c2fbeb8584d0358837e6ac8b6860f9.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. 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. 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. 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. labels Oct 2, 2026
@RomneyDa

RomneyDa commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

The late status-less terminal-row finding is fixed at the outcome resolver. Status-less activity now means Running only for an active unfinished live row; terminal rows remain Outcome unknown. The extended boundary regression failed on the prior head as succeeded and passes on 7601fa95ebf. Focused UI tests and changed gates are green.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 2, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
@RomneyDa
RomneyDa force-pushed the fix/control-ui-tool-unknown branch from 7601fa9 to feda071 Compare October 3, 2026 20:29
@RomneyDa

RomneyDa commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Rebased onto current main after #164116 changed the same Codex transcript owner. The conflict resolution preserves main's newer code-mode native-call projection and reapplies only this PR's same-ID collaboration/Wait correlation plus active-vs-terminal UI outcome logic. Exact Codex 0.160.0 tag inspected (rust-v0.160.0: collaboration status includes interrupted); 89 focused tests, the full changed gate, and fresh whole-branch P2 autoreview are green on feda0718748572c759f2ca08578fa841811135b1.

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa
RomneyDa merged commit 8db9539 into main Oct 3, 2026
111 checks passed
@RomneyDa
RomneyDa deleted the fix/control-ui-tool-unknown branch October 3, 2026 22:45
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
* fix: show authoritative tool outcomes

* test(ui): align active tool outcome expectation

* fix(codex): preserve interrupted collaboration outcomes

* fix(ui): preserve unknown terminal tool outcomes
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 extensions: codex P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

[Bug]: Control UI shows known tool outcomes as unknown

1 participant