Skip to content

fix: workspace HTML reports fail to attach in Webchat - #178940

Merged
joshavant merged 3 commits into
mainfrom
fix/webchat-html-publication
Oct 21, 2026
Merged

joshavant merged 3 commits into
mainfrom
fix/webchat-html-publication

Conversation

@joshavant

@joshavant joshavant commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes workspace HTML reports being rejected as unsupported when an agent explicitly attaches the final file to the current Control UI/Webchat conversation.

User Impact

Users can open and download a self-contained HTML report, including a parent agent’s final revision of a child draft, as a durable attachment that survives changes to or deletion of the source file. Existing read and delivery permissions still apply; no configuration changes are required.

Why This Change Was Made

The internal current-conversation send owner supplies explicit HTML publication intent. Media loading validates the bytes and the existing managed-attachment path saves the snapshot. This intent grants neither file access nor generated-file provenance. Automatic MEDIA: replies, external channel handling, and preview sandbox/script controls retain their existing policies. Conditional Webchat guidance directs the agent to this explicit send path.

Format validation and output-directive construction are extracted into focused modules, retaining one implementation and keeping the existing oversized modules within the line-growth rule. No new state, settings, or permission modes are introduced.

Evidence

Hosted CI finished with 84 successful checks and two failed browser checks; the CI gate remains red. The composer chat.abort timeout matches scheduled main exactly. The dashboard board.update timeout is source-attributed as unrelated to this PR: the UI/RPC owners and active test setup are unchanged, the added HTML scenario is excluded in this job, and the original 100-file selection adds no competing workload. Its underlying UI cause remains unresolved. One full replay at the actual CI merge 3fc21e07 passed 432 tests, three workers, exit 0; this supports the attribution without establishing a repair or reproducing the original machine/cache/scheduling. No source or timeout change was made. ClawSweeper reviewed e6933e63 with no actionable findings.

  • The actual message-tool regression failed on the untouched base with the unsupported-format error; all 15 internal-source integration cases pass with the fix.
  • Final-source run: 256 tests across 13 files passed, covering durable publication after source deletion, automatic HTML rejection, invalid bytes, read restrictions, revoked delivery authority, generated provenance, and prompt-prefix stability.
  • Fresh exact-head production Gateway/UI build and Chromium proof passed: build exit 0; browser exit 0, 1 test passed (8.034s case, 38.09s invocation). The scenario exercises real write/send tools, persisted attachment after deletion and reload, interactive sandbox preview, Source view, and exact UTF-8/CRLF download bytes and filename. Inference is synthetic; the draft is seeded rather than delegated to a live child agent. The linked receipt includes the nonfatal startup-JS budget warning.
  • All 13 resource-ownership tests, the focused CI ownership guard, and the sharding guard passed with the browser test assigned to its private, serial server owner. Production types, four affected test type graphs, scoped lint (13 files, no warnings/errors), formatting, docs checks, and line-cap ratchet passed. Fresh independent review found no actionable P0–P2 issues.

Separately, the local core test-root budget guard also fails on untouched base 863a3cdc6dc7: agents-tools 721, gateway-root 725, infra 728, plugins-platform 728 against 720. These are baseline guard failures; the affected test type graphs compile successfully.

Net change against the base: +57 production lines, +418 test lines, +9 documentation lines, and two suite-registration lines. The larger media-policy/prompt diff is extraction; browser proof reuses the maintained real-Gateway harness.

@clawsweeper

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

@joshavant
joshavant marked this pull request as ready for review October 21, 2026 02:21
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui agents Agent runtime and tooling size: L labels Oct 21, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Allows explicit current-conversation sends to publish readable local HTML reports as durable Webchat attachments.

Example: An agent sends implementation-plan.html from its workspace using message(action=send, media=<path>).

  • Before: The send rejects the HTML report as an unsupported format.
  • After: The conversation retains a named HTML attachment that opens and downloads after the source file is deleted.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused owner-based repair with shipped-entry-point evidence, preserved storage formats and defaults, and no actionable findings; the failed CI gate remains enforced.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Exact-head Linux ARM64 build and Chromium terminal output exercise the built Gateway's real write/message tools, durable attachment after deletion and reload, sandbox interaction and isolation, and exact download bytes; production-owner integration coverage additionally exercises denied reads and closed delivery admission, while inference remains synthetic.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An agent cannot attach its final workspace HTML report to the current Webchat conversation even when it can read the file.
Reason: The maintainer-authored direction restores useful file delivery through existing permissions and storage, with no new settings or parallel attachment system.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes a current HTML attachment failure, and review found no actionable introduced defects; the CI gate remains failed.

Priority: P2
Reviewed head: e6933e63d8dc2bb074f998d7ba15898b91414856

Before merge

None.

Findings

None.

Agent review details

How this fits together

The current-source message owner passes local files through session-scoped read policy and media validation into the existing managed attachment store, which supplies authenticated Webchat previews and downloads.

flowchart LR
  A[Agent message send] --> B[Current conversation owner]
  B --> C[Session scoped file access]
  C --> D[HTML byte validation]
  D --> E[Managed attachment snapshot]
  E --> F[Webchat preview and download]
Loading

Technical review

Best possible solution:

Retain the explicit-send format admission while keeping file access, delivery authority, generated provenance, and managed attachment persistence with their existing owners.

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

Current-main source shows workspace HTML rejected without generated provenance, and the author reports the actual message-tool regression failing on the untouched base; this read-only review ran no target code.

Is this the best way to solve the issue?

The change fixes format admission at the shared media owner, supplies intent only from the existing explicit-send owner, and reuses durable attachments; the extracted policy and prompt sections replace their original implementations without creating competing owners.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Host-read HTML admission changes intended behavior with a stated reason (68d0c0f: Allow generated reports while blocking arbitrary host-local HTML and disguised binary content.)
  • Generated HTML staging provenance keeps the original intent (58c1383: Retain exact-byte trust across staging and restart recovery without trusting the outbound directory by path.)
  • Assistant output directives keeps the original intent (cc5c691: Give Webchat structured attachment and embed guidance while preserving channel delivery semantics.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +57, Tests +420, Docs +9. Total +486 across 15 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 7 311 254 +57
Tests 7 424 4 +420
Docs 1 9 0 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 744 258 +486

Review metrics

Metric Value Why it matters
Additive SDK parameter 1 optional publication mode on 2 existing media loaders The existing SDK re-exports expose htmlPublication; omission preserves existing behavior, and no new user configuration is introduced.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: The SDK-visible media loaders gain an optional format-admission parameter; the maintainer-authored repair retains existing defaults and callers.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: Repairs a limited but useful report-delivery workflow without changing general chat availability.
  • merge-risk: 🚨 compatibility: The SDK-visible media loaders gain an optional format-admission parameter; the maintainer-authored repair retains existing defaults and callers.
  • 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.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-21T02:54:06.040Z sha e6933e6 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-21T03:26:58.994Z sha e6933e6 :: needs maintainer review before merge. :: none

Reviewed October 20, 2026, 11:34 PM ET / October 21, 2026, 03:34 UTC (Revision 3).

@joshavant

Copy link
Copy Markdown
Collaborator Author

Fresh runtime proof for e6933e63d8dc2bb074f998d7ba15898b91414856, collected 2026-10-21 UTC in a new task-owned Linux ARM64 VM, using frozen dependencies, Node 24.21.0, pnpm 12.12.1, Playwright 1.64.0, and Chromium 156.0.8078.4.

The production Gateway/UI build exited 0 (reported 1m13.6s):

OPENCLAW_BUILD_PRIVATE_QA=1 OPENCLAW_RUN_NODE_SKIP_DTS_BUILD=1 corepack pnpm build

The maintained real-Gateway browser scenario exited 0:

# Compiler cache isolated to this task-owned VM.
OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/home/nerfed/html-publication-review-20261021/browser-proof-cache \
node scripts/run-vitest.mjs run \
  --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner \
  --project ui-e2e-serial-standalone \
  ui/src/e2e/chat-html-publication.real-gateway.e2e.test.ts --maxWorkers=1

Selected actual stdout, with the temporary checkout path removed:

✓ ui-e2e-serial-standalone ui/src/e2e/chat-html-publication.real-gateway.e2e.test.ts
  > Explicit HTML publication through real Webchat
  > retains final parent-edited HTML after source deletion, reload, sandbox preview and exact download 8034ms
Test Files  1 passed (1)
     Tests  1 passed (1)
  Duration  38.09s

The maintained scenario executes real write and message.send tools through the production Gateway, verifies durable attachment metadata, deletes the source, reloads the browser, opens and interacts with the sandboxed HTML, verifies that top-document access is denied and the host API is absent, and checks exact Source/download UTF-8 and CRLF bytes plus filename. Normal fixture cleanup and compiler-generation verification completed.

Only inference is synthetic; the child draft is seeded, not produced by live delegation. This proves the publication/delivery/browser path, not live-model tool selection or external transports. The source archive identifies the exact head; the test SHA-256 is d91f453d1f9345b19bf94a4f1c5d69e379833082e987fd31a8274459f305458a.

Build output also reported an advisory startup-JS budget warning (318.8 KiB versus 317.5 KiB); the build still exited 0. This runtime proof does not assert that all CI checks pass. The separate CI dashboard-timeout investigation is continuing; no product code, assertions, or timeout budgets changed for this run.

@joshavant

joshavant commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator Author

CI disposition: the dashboard timeout in run 39534093805, attempt 1, job 119007116100 is unrelated to this PR’s changed behavior. Its underlying UI cause remains unresolved.

This attribution uses the actual CI merge 3fc21e071d28944149d3023eb122e260a74d443f against its actual main parent 5199713a8ebf1bbcebc168f19f72e49464701156, rather than comparing the older branch checkout with current main:

  • The 15-file delta changes no existing UI runtime, dashboard test, mock Gateway, browser fixture, protocol/package dependency, Vite builder, Workboard browser fixture, shared server setup, compiler/bootstrap implementation, sequencer, or timing weights. Exact blob comparisons confirm the inspected owners are identical.
  • The only changes in the UI test configuration register the new HTML real-Gateway scenario. Both configuration files become byte-identical to the parent when that one registration line is removed. In this job, OPENCLAW_UI_E2E_SKIP_REAL_GATEWAY=1 excludes that file; its private/serial registration also excludes it from the bundled project. The HTML scenario starts no concurrent Gateway or server in this job.
  • The failed operation is dashboard menu → retained BoardView/cell → BoardProvider → browser MockWebSocket. The mock records the request before handling its response and replaces the browser WebSocket. This scenario has no RPC passthrough, real model, or live Gateway. Changed message-send, HTML-format, and prompt owners cannot admit or reject its board.update.
  • Shared setup was followed through the static Vite preview and Workboard’s browser/Control UI SDK build, including relevant computed entrypoints. Those owners and browser inputs are unchanged. The previously restored 100-file inventory and successful 432-test replay additionally confirm that the HTML scenario added no competing test workload.

The disposition rests on this execution-path and effective-configuration isolation; the passing replay is supporting evidence. Original machine/cache/scheduling behavior and the runtime reason for the missed request remain unmeasured. This establishes no flaky-test frequency or observed baseline failure for the dashboard case.

The composer failure separately matches scheduled main. Hosted CI remains failed, and all review/security/merge checks retain their existing enforcement. No source change or diagnostic patch is needed for this PR’s CI attribution; the bounded capture proposal below remains useful for an independent dashboard investigation.


CI dashboard-timeout follow-up completed without source changes.

The failed CI job tested merge 3fc21e071d28944149d3023eb122e260a74d443f (PR head e6933e63, main parent 5199713a). Although its display label is “5/9,” its recorded Vitest arguments are shard 5/8, three workers.

I recovered the original preflight include list from that job, used a separate frozen install at the exact merge, and verified that the selected 100 filenames match the CI log exactly: 95 bundled suites and five private-server serial suites. One full replay ran in the task-owned Linux ARM64 VM:

CI=true OPENCLAW_UI_E2E_SKIP_REAL_GATEWAY=1 OPENCLAW_VITEST_MAX_WORKERS=3 \
OPENCLAW_VITEST_INCLUDE_FILE=/home/nerfed/html-publication-review-20261021/ci-ui-include.json \
node scripts/run-vitest.mjs run \
  --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner \
  --maxWorkers 3 --shard 5/8

Selected actual stdout:

✓ |ui-e2e-bundled| ui/src/e2e/solo-widget-chrome.e2e.test.ts
  > single widget chrome
  > retains page controls in split view and restores multi-widget controls without reloading 2932ms
Test Files  100 passed (100)
     Tests  432 passed (432)
  Duration  522.79s

Terminal process status was 0; compiler-generation verification completed, and no timeout captures were produced. No assertions, waits, fixtures, permission checks, or product code were changed. This reproduces the test selection and worker setting, not the original machine/cache/load or exact cross-worker timing.

Original cause remains unresolved. CI timed out waiting for a second board.update after Remove. Its two retained public summaries show a connected, responsive renderer without a crash or stall. They omit the private screenshot and mock request history, which the upload owner intentionally does not publish.

Source traces the click through current provider/widget ownership checks and retained board/tab/revision/cell checks. A stale relationship could drop the action; the retained evidence cannot establish that it did. There is no evidence supporting relaxation of those checks or a speculative product patch.

The smallest useful capture on a future occurrence is the existing private screenshot/mock request diagnostics, correlated with bounded facts identifying the menu target and whether the retained board tab, widget revision, and cell match at selection. Reuse the existing test-diagnostic owner; do not broadly upload private browser state.

The separate composer timeout still matches scheduled main. Hosted PR CI remains red; these passes neither repair nor label the original dashboard failure “flaky” or pre-existing. Fresh HTML publication runtime proof is linked separately.

@joshavant

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 21, 2026
@joshavant
joshavant merged commit 0bed68a into main Oct 21, 2026
229 of 234 checks passed
@joshavant
joshavant deleted the fix/webchat-html-publication branch October 21, 2026 03:36
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
* fix(webchat): allow explicit HTML report attachments

* fix(test): register HTML publication private UI server

* test: include HTML publication in Gateway inventory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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: L 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.

1 participant