fix(agents): preserve structured tool result visible text#97268
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 5:32 AM ET / 09:32 UTC. Summary PR surface: Source +130, Tests +173. Total +303 across 3 files. Reproducibility: yes. at source level: current main returns Review metrics: 1 noteworthy metric.
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. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land exactly one helper-boundary fallback for the canonical visible-output bug, preserve text-first/image-skip/redaction/capping behavior, and close or supersede the same-root helper sibling. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main returns Is this the best way to solve the issue? Yes for the scoped visible-output bug: the helper boundary already owns display text extraction, and the PR preserves text-first and image-skip behavior while adding redaction and caps. The broader provider-context problem remains adjacent in #97450. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d17b970bb50d. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +130, Tests +173. Total +303 across 3 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
|
|
Follow-up evidence / scope clarification:
|
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
9b28834 to
f907f28
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
f907f28 to
db76698
Compare
|
Land-ready verification for prepared head
Proof gap: no additional Crabbox/Testbox scenario could run because this machine has no configured provider/coordinator credentials. Exact-head hosted CI and the existing installed live proof cover the land gate. |
|
Merged via squash.
|
…7268) * fix(agents): preserve structured tool result visible text * fix(agents): address structured tool result review blockers * fix(agents): cover real structured tool result shapes * fix(agents): preserve canonical tool error statuses * fix(agents): harden structured result rendering * fix(agents): preserve typed structured results * fix(agents): bound provider result media --------- Co-authored-by: snowzlmbot <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…7268) * fix(agents): preserve structured tool result visible text * fix(agents): address structured tool result review blockers * fix(agents): cover real structured tool result shapes * fix(agents): preserve canonical tool error statuses * fix(agents): harden structured result rendering * fix(agents): preserve typed structured results * fix(agents): bound provider result media --------- Co-authored-by: snowzlmbot <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…7268) * fix(agents): preserve structured tool result visible text * fix(agents): address structured tool result review blockers * fix(agents): cover real structured tool result shapes * fix(agents): preserve canonical tool error statuses * fix(agents): harden structured result rendering * fix(agents): preserve typed structured results * fix(agents): bound provider result media --------- Co-authored-by: snowzlmbot <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…7268) * fix(agents): preserve structured tool result visible text * fix(agents): address structured tool result review blockers * fix(agents): cover real structured tool result shapes * fix(agents): preserve canonical tool error statuses * fix(agents): harden structured result rendering * fix(agents): preserve typed structured results * fix(agents): bound provider result media --------- Co-authored-by: snowzlmbot <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
Summary
What Problem This Solves
The visible tool-result extraction path could drop structured non-image content because it only collected explicit text blocks. When a tool returned JSON/resource blocks without a text block, the visible transcript could fall back to an attachment-style placeholder instead of useful text.
Why This Change Was Made
Structured non-image tool results can carry the only human-readable result payload. The fallback is intentionally narrow: it serializes non-text/non-image content blocks only after normal text extraction, so existing text-first behavior remains stable and image payloads do not become visible text.
Review Follow-Up
Addressed the ClawSweeper review blockers on current head
f907f28856e9e745eab43da2e0b9c1990baa59dc:extractToolResultTextnow returns existing text blocks before structured serialization.text+ structured JSON coverage proving only the existing text output is emitted.test serverusing the global OpenClaw runtime under/usr/lib/node_modules/openclaw/dist.Implementation
stringifyStructuredToolResultContentinsrc/agents/embedded-agent-subscribe.tools.ts.textandimageblocks in the structured fallback.TOOL_RESULT_MAX_CHARSbehavior.Evidence
Validated on Linux at PR head
f907f28856e9e745eab43da2e0b9c1990baa59dc.Focused test command on
test server:Focused test result:
Installed runtime helper proof on
test serverafter hotfixing and restarting OpenClaw:Installed CLI visible-output path proof from
/usr/lib/node_modules/openclaw/dist/reply-usage-state-_oArqMDo.js:Installed session proof also verified a real embedded OpenClaw agent run after restart:
Additional current-install verification (Linux local OpenClaw install, 2026-06-28):
Scope And Limitations
Fixes #97267rather than closing it.Fixes #97267
Supersedes #97183