fix: render WebChat message tool replies#81144
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. from source inspection, but not by executing current main: current main can suppress WebChat final delivery in message_tool_only mode while Codex telemetry reads original message-tool args instead of the sanitized result details. Real behavior proof Next step before merge Security Review detailsBest possible solution: Pick one canonical fix for #81109: land this sanitized renderer path with live behavior proof, or land #81110 and close the unused alternative. Do we have a high-confidence way to reproduce the issue? Yes from source inspection, but not by executing current main: current main can suppress WebChat final delivery in message_tool_only mode while Codex telemetry reads original message-tool args instead of the sanitized result details. Is this the best way to solve the issue? Unclear as a product choice. The implementation is a maintainable sanitized renderer option, but the narrower alternative is to keep internal WebChat replies automatic via #81110. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 8a6c18a08a03. |
|
Addressed ClawSweeper's P2 in
Validation run after the patch: OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/agents/tools/message-tool.test.ts extensions/codex/src/app-server/dynamic-tools.test.ts src/agents/pi-embedded-runner/run/payloads.test.ts src/agents/pi-embedded-runner/run/tool-media-payloads.test.ts
# passed: 3 Vitest shards, 102 tests
pnpm exec oxfmt --check --threads=1 src/agents/tools/message-tool.ts src/agents/tools/message-tool.test.ts extensions/codex/src/app-server/dynamic-tools.test.ts
# passed
git diff --check
# passed before commitRe-review progress:
|
|
Follow-up on the CI failures from my previous push:
Local validation from
|
|
Addressed the ClawSweeper sanitizer finding in |
|
@pashpashpash looks like #81586 landed the broader internal-UI message-tool sink for the same WebChat/Codex issue this PR was carrying as the option-2 renderer path. All good on the final shape, but I think your clanker forgot two housekeeping bits: close this as superseded and credit me / #81144 in the changelog 😄 |
|
Thanks for working on this. This WebChat/TUI current-run message-tool path has now been fixed on main by #81586, merged as 78eb92e. I rechecked the current code path: the message tool now returns the internal UI source reply sink, Codex telemetry extracts it, and the Pi payload builder projects it back into visible WebChat/TUI reply payloads plus transcript mirroring. Since this PR is superseded by the landed broader fix, I’m closing it to keep the queue clean. |
|
Superseded by #81586, which is merged on main. |
This PR restores the visible WebChat reply for Codex same-session
message(action="send")calls by carrying the sanitized tool-result text into the Codex telemetry/rendering path. The safety boundary is that WebChat displays the sanitized result detail, not the raw tool arguments that may include markdown or same-session routing internals.Summary
This is the option-2 alternative for #81109, alongside #81110. It keeps the Codex
messagetool path available for WebChat so the model can deliberately send the visible reply after a tool-heavy turn, but now renders only the sanitized same-session message text. That preserves the personality-restoringmessagetool behavior without leaking raw reasoning-tag content from original tool arguments.message(action="send")calls could be treated as external delivery or suppressed, and the first renderer version could have reused raw telemetry text.messagetool is the mechanism that lets Codex recover a warm, user-facing reply after tool execution instead of ending with a sterile final answer orSent..status: "ok", keep semanticdeliveryStatus: "sent", feed sanitized result text into Codex telemetry, and render that text through source-suppression-safe reply payloads.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
message_tool_onlycan use themessagetool for the visible reply without routing through an external channel, without being suppressed by final source-reply suppression, and without rendering unsanitized reasoning-tag text./Volumes/LEXAR/repos/openclaw-webchat-message-renderer, branchfix/webchat-message-tool-renderer, latest patch45e0d6de92a, using real source modules and focused Vitest coverage. This is not a full browser WebChat E2E run.Focused regressions now assert:
messagesends are bridge-successful (status: "ok",deliveryStatus: "sent"), the renderer receives source-suppression-safe payload metadata, and Codex telemetry prefers sanitized tool-result details over raw original args.attempt.messagingToolSentTextscould render<think>hidden</think>Visible replyeven thoughcreateMessageToolsanitized its copied params. The new test locks the sanitized result path.Root Cause (if applicable)
createMessageToolstrips reasoning tags on a copied params object before returning same-session result details.Regression Test Plan (if applicable)
src/agents/tools/message-tool.test.ts,extensions/codex/src/app-server/dynamic-tools.test.tsUser-visible / Behavior Changes
WebChat users can receive a real visible assistant reply from the
messagetool path inmessage_tool_onlymode. The rendered text is sanitized and can pass through source-reply suppression intentionally.Diagram (if applicable)
Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain risk + mitigation: N/A. The security-sensitive review finding was about reasoning-tag text disclosure; the patch mitigates it by rendering sanitized result text.Repro + Verification
Environment
messagetool path and Codex dynamic bridgesourceReplyDeliveryMode: "message_tool_only", current channelwebchatSteps
status: "ok"as success.Expected
messagesend returns success semantics.Actual
Evidence
Human Verification (required)
status: "ok"plusdeliveryStatus: "sent", external sends remain outside this same-session path.Review Conversations
ClawSweeper P2 addressed by
45e0d6de92a: render sanitized WebChat message-tool text.Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoRisks and Mitigations