Skip to content

feat(gateway): let operators disable client file and image uploads - #158567

Merged
roboclaw-bot merged 30 commits into
mainfrom
openclaw/disable-and-test-file-image-uploads
Sep 28, 2026
Merged

roboclaw-bot merged 30 commits into
mainfrom
openclaw/disable-and-test-file-image-uploads

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #158556

What Problem This Solves

Gateway operators need a way to disable client file and image uploads without disabling normal text conversations.

User Impact

Set gateway.uploads.enabled to false to hide Control UI upload controls and reject client upload requests at the Gateway. It defaults to true and hot-applies without restarting. Existing attachment drafts remain recoverable; text-only messages still work.

{ "gateway": { "uploads": { "enabled": false } } }

This governs client uploads, not agent filesystem permissions or incoming channel media. Downloads, existing media and agent-generated output retain existing policies. Trusted third-party tools writing their own client bytes must use the documented optional final-write callback; this is not a filesystem or DLP sandbox. No stored-data migration is required.

Why This Change Was Made

The Gateway owns the switch and rejects direct API uploads, not just browser controls. Live policy checks reach proposal/library storage and Workboard's final publication. Text-only skill edits retain existing support files by exact revision instead of re-uploading or discarding them.

Evidence

Config-help snapshot follow-up: the feature already intentionally declares gateway.uploads.enabled as a common setting, but the exact curated-common-leaf snapshot omitted it. CI run 36363112254 and the local captured config plan both reproduced the same single mismatch. Regenerating the named snapshot adds only that one sorted leaf; production visibility, schema, test enumeration, and the exact-set assertion are unchanged. This aligns expected output with the authorized feature, not an exception to the test.

  • The captured 59-file config plan changes from 1 failure / 851 passes / 5 existing skips to 852 passes / 5 existing skips, in 83.46s. The full help-quality and tier files pass 34 unique cases in 3.71s; the nested quality summary is counted once.
  • Focused independent P0–P2 review is scoped-clean (9.61s), and diff checks pass. No TypeScript, production, timeout, budget, or ignore rule changed; prior static/build/UI proof is retained rather than rerun for a generated expected-value entry.
  • The broader initial local job replay also hit an unrelated LAN self-reachability proof failure. That check passed in the actual hosted job; the local result is not counted as passing, and no networking or product policy was changed. The reproduced config snapshot failure is independently resolved by the focused and captured config runs above.

Archive-shortcut fixture follow-up (test only): the real keyboard action already returns an async header-action promise after its lazy import, archive workflow, and Undo toast. The fixture now observes that real call with a pass-through spy, asserts its exact target, and awaits its completion before the unchanged toast, durable-ID patch, draft, navigation, and Undo checks. No production behavior, mock implementation, timeout, isolation setting, or assertion was weakened.

The original hosted run 36360979826 failed this first toast assertion (zero calls; 1.838s), while the rest of its 225-file shard recorded 3,663 passes and 3 skips. The failure did not reproduce in the unchanged local file (24 cases / 4.77s) or valid captured-plan replay (3,667 cases / 91.99s). A cold import outlasting the incidental 1-second poll is a plausible mechanism, but the exact hosted cause remains uncertain; a stale mock identity was not independently excluded. The retained toast assertion would still expose a settled action with no expected toast.

  • After the correction: 20/20 standalone runs pass all 24 cases; first measured wall 3.49s, range 3.38–3.53s (68.94s combined). Three complete captured-plan replays each pass 225 files / 3,667 cases, in 89.53s, 87.57s, and 90.76s. These are repeated stability runs, not additional unique tests. Four owner/keyboard siblings pass 106 cases in 11.77s across normal and isolated UI projects.
  • Review: focused independent P0–P2 review is scoped-clean (11.01s), consistent with the separate source audit; neither claims to have reproduced the original failure.
  • Static checks: the complete one-file changed-check passes all 19 planned stages, including the ui-chat type graph, zero-warning/error lint, formatting, i18n, all three dead-export scans, and the unchanged ratchets. Existing upload implementation, full-build, asset-budget, and visual proof below remain valid scoped evidence.

The first local shard attempt had four browser-start failures caused by an overlong process-only temporary path, not archive assertions. Restoring the browser runner’s ordinary short OS temporary paths made the unchanged full plan pass; those failed startup attempts are not counted as passing proof. The earlier auto-merge request was retired through native recovery before this repair. Replacement landing must satisfy the native completed-evidence recovery gates.

Prior conflict-only refresh: merged main da04ae795c8dc24b000916161aadbb2e9f352cd2 to resolve the sole conflicted generated config-documentation hash. The upload source patch is unchanged across src, ui, extensions, and packages (stable patch ID dd92e1517bf266745ee8093c6bc45467b1e362ce); the only intersecting paths were the generated hash, existing assertion-baseline shrink, and Gateway documentation. Canonical config regeneration/check, document formatting, and diff checks pass. The freshly composed UI build passes in 17.59s, with 372,295 / 372,347 B startup JavaScript, 50,488 / 51,200 B startup CSS, and 204.9 / 215.0 KiB largest ordinary JavaScript. No budget or source-code exception was added. The prior full-build, runtime and independent-review evidence below is retained rather than rerun or relabeled as new-head execution. ClawSweeper revision 17 completed the preceding cb337ed1e180 head at 23:58:58 UTC with no code or security findings; its policy/budget items retain their documented owner dispositions.

Prior main reconciliation: incorporates main d038d1dbbfcf3ed5010912301a7d6c406003d231, preserving both histories and the retired Tasks cutover. The only textual conflicts were the generated config-doc hash/counts; those were regenerated through the owning command. The UI boot manifest was regenerated from ready routes. A composed router line-cap violation was fixed by consolidating the repeated exact-handler-identity/policy decision in the existing core-handler owner; both router fences and their ordering remain unchanged. No cap, timeout, assertion, or policy exception was added.

  • Inherited CI fixes: uses the exact already-landed b459eb600f23 restart-status fixture and 6ad6f1fbe846 maintenance-error-cause fixture, without changing production recovery or restoring Task state. The captured original restart plan failed 4 cases / passed 923; the corrected PR plan passes 927 cases in 126.75s. Main proof passes 1,143 cases with 14 existing skips in 132.62s. Focused restart cost: 27 cases / 48.11s; maintenance: 15 cases / 17.73s.
  • Current composition behavior: all 337 cases in 9 complete files pass in 131.87s across actual router receipt/new-input admission, send, observer/request lifetime, cancellation, staged uploads, loopback HTTP/native filesystem admission, and config-write effects with main's fs-safe 0.21.1.
  • Current UI: 46 unit cases and 8 unique bundled browser cases pass in 32.31s. This uses the actual Control UI with a mock Gateway. Hot-disable removes uploads, preserves drafts, and allows text; the existing inspected images remain representative.
  • Review: the full two-pass P0–P2 review completed in 161.87s. Its sole finding assumed the session-create upload guard precedes receipt replay; the actual exported handler is wrapped by idempotentSessionCreate, whose identity/authority and replay checks precede the inner handler. The real-router accepted-retry test covers this ordering. The concern is rejected on that source and behavior evidence, not relabeled a clean review. Final scoped source review: both the immutable main-composition audit and the final two-file consolidation audit found no P0–P2 regression; the latter verified exact handler identity, both fence positions, complete helper replacement, and preserved lazy handler loading.
  • Build and static: the serialized full package build passes in 358.75s, including native declarations, SDK exports, runtime sidecars and the CLI bootstrap guard. Core types, all five selected core-test graphs, UI types, all six selected source-file lint/format checks, i18n, ratchets, config-doc regeneration checks, and import-cycle analysis pass (zero runtime value cycles). The final composed artifact check passes the existing limits: 372,309 / 372,347 B startup JavaScript, 50,488 / 51,200 B startup CSS, and 204.9 / 215.0 KiB largest ordinary JavaScript. The existing @steipete-approved 371,771 B baseline plus 512/64 B allowances is unchanged. CSS remains above its advisory target.

The first local runtime invocation used two nonexistent file selectors and executed no cases; only the corrected selection is counted. An overlapping build was stopped by its compiler namespace guard when the test runner created metadata. The serialized rerun retains that guard; the earlier build and interrupted static tail are not passing evidence. Enforced published-head CI, exact-head local review, and the native recent-ClawSweeper completion check remain separate landing gates.

Earlier implementation and verification evidence

Upstream CI fixture follow-up (test only): adopts the exact correction already landed in 14ef6ab47832 (#159819). Main had retired the taskId artifact selector from both the schema and resolver, but one topology assertion still supplied it. Supported run/session authorization and topology checks remain intact; production code and test timeouts are unchanged. The original captured PR plan reproduces 1 failure / 919 passes / 1 existing skip in 179.26s. With the canonical fix, the complete 69-selector plan passes 1,020 cases with 1 existing skip in 287.32s, including the isolated leg. The independent main proof passes 1,053 cases with 14 existing skips in 291.97s; the focused file, Gateway-methods types, lint, formatting, and scoped independent review pass. Initial local Doctor timeouts were isolated to ambient Gateway-auth inputs: unchanged tests pass after removing those inputs only from the test subprocess. Stored credentials, product code, and test timeouts were unchanged. Current-head hosted CI and review are still required.

Receipt-safe disabling: accepted chat, session creation, send, and message-action requests keep their authorized cached or in-flight receipts after hot-disable. Fresh input still returns FORBIDDEN / UPLOADS_DISABLED before new byte effects. The canonical receipt owners make that distinction; exact handler identity limits router deferral, and overrides retain both fences. Outbound route validation precedes replay, while binding publication and new work follow input admission. A refused request neither caches a denial nor pins a route; re-enabling it uses the current account default. Existing caller, session, runtime, cancellation, final-write, and handoff checks remain intact.

  • Original failure: four outbound cached/in-flight cases failed in 19.22s; four chat/session/direct-entry cases failed in 42.51s. All failed because a valid retry became an upload denial. An interrupted compilation attempt ran no cases and is excluded.
  • Repaired owners: 201 cases across the complete three affected files pass in 89.87s. Final standalone costs: send150 cases/13.58s; client-policy14 cases/46.50s; router-policy37 cases/8.81s. The strengthened outbound cases also verify that a rejected request does not retain its old default account after re-enable.
  • Lifecycle and storage siblings: 525 cases across 13 files pass in 170.99s, including full agent admission, follow-up custody, chat cancellation, session idempotency, archive uploads, and the schema/worker admission tests. Scheduled/read-account coverage adds 14 cases in 26.18s. No assertions, retries, or timeouts were relaxed.
  • UI composition: 35 unit cases and 8 unique bundled browser cases pass in 38.35s. Inspected fresh before/after captures confirm that hot-disable removes file/photo/camera actions while other composer tools remain. Browser assertions verify draft recovery and text-only sending. Existing published screenshots below remain representative; this uses the actual Control UI with a mock Gateway, not production traffic.
  • Review and static checks: the full reconciled candidate received a completed two-pass P0–P2 review with no actionable findings (194.06s). Core, all 25 core-test graphs, and UI types pass; ratchets, formatting, config docs, boundaries, dead exports, scoped lint, styles, and architecture/auth guards pass across the successful prefix and corrected type/tail replays (the initial whole-check command is not labeled all-green). Subsequent fixture changes preserve the exact landed upstream test fix and use a fresh UUID rather than widening an inferred test type.

Main reconciliation: the candidate preserves the published branch and main e3f3c15ebfe histories, including main's Task runtime removal. Old CI's schema-probe failure is superseded by main's 1664e4cf262 / af9e273f634 reverts; the obsolete local test correction was not published. Main's c4e67604df4d removes the exact unused iOS import reported by the old scan. Local static validation found a stale media-test callback; this candidate incorporates the exact already-landed three-fixture repair 0b6f02faae3 (#159836), whose 16 focused cases pass in 79.43s. Fresh published-head CI remains required; these are not rerun claims for the old failed/cancelled jobs.

Build and approved budget: the main-composed full package build passes in 459.07s. Its separate asset check passes: startup JavaScript 371,645 / 372,347 B, startup CSS 50,359 / 51,200 B, largest ordinary JavaScript 204.1 / 215.0 KiB. Canonical boot-manifest regeneration was used; no packing or budget exception was added. The existing @steipete-approved 371,771 B baseline and 512/64 B allowances remain unchanged. CSS remains above the advisory target. The later receipt repair changes backend admission and tests, not UI source; exact-head CI owns final published-artifact validation.

Before — uploads enabled

Upload actions visible

After — uploads disabled

Upload actions removed; other composer tools remain

Earlier implementation proof and measured costs

Current-main reconciliation and receipt recovery: merged ac4c248d7789 while preserving both histories and the existing admission owner. Caller/runtime authority is separate from upload input policy. Stop receipts survive a concurrent disable, and the canonical agent RPC reconciles an authorized cached receipt before admitting new bytes; overridden handlers retain the router fence. A fresh idempotency key still returns FORBIDDEN / UPLOADS_DISABLED, with no files, inference or leftover reservation. The Stop-plus-disable case fails before repair (15.92s); the real-router retry also reproduces the prior denial (34.41s). The repaired three-file lifecycle/receipt selection passes 431 cases in 161.56s; final router/upload-policy checks pass 45 cases in 33.66s. The final nine-case real-writer file alone passes in 22.65s. The current-main composition also passed 421 cases across 5 files in 190.41s, including presence and skills flows. Both bundled browser files pass 8 cases in 27.35s after boot regrouping.

The full package build passed in 351.14s. Its separate performance check exposed a 99-byte ordinary-chunk excess; canonical ready /new and /chat boot-manifest regeneration fixed it without changing packing constants or raising any budget. On committed candidate 89f5025563b, startup JavaScript is 371,616 / 372,347 B, startup CSS 50,359 / 51,200 B, and the largest ordinary JavaScript chunk is 214.9 / 215.0 KiB; all enforced asset budgets pass. CSS remains above its advisory target. Composition with current main b8894086496e is conflict-free; this is local composition proof, not hosted CI success.

Current-main static validation passed core, all 25 core-test graphs, UI, plugins, plugin tests and script types; ratchets, formatting, metadata and dead exports also passed. The whole-core lint run found only the unchanged main 701-line projection file, repaired with the exact already-landed simplification from 54c0ae69cb8 (#159473). Fresh scoped lint passes 181 core/UI/package files, 7 Workboard files and the performance script; style, schema, architecture and authorization guard tails pass. Subsequent receipt changes have fresh core/Gateway types, lint, line-cap checks and zero-cycle Madge analysis. The monolithic changed-check is not relabeled all-green: its valid prefix plus these corrected tail checks supply the evidence. Full current-candidate independent P0–P2 review is scoped-clean; the final mechanical request-fact reuse also passes its router tests and lint. New published-head CI remains required.

Stop during attachment preparation: replay the existing terminal Stop/timeout receipt instead of returning an attachment error after the reservation ends. Settlement stays with the existing agent-deduplication lifecycle; storage admission and cleanup remain intact. The existing attachment-setup tests reproduced 2 failures before repair (41.63s); the added real-handler/filesystem Stop regression also failed on the original code (17.77s). The complete recorded 67-file Gateway-methods plan now passes 1,685 cases in 292.82s with a process-only non-Git temp root. After placing settlement in its lifecycle owner, the final real-writer policy/Stop suite passes all 8 cases in 38.80s, and the attachment-setup selection passes 4 cases in 13.56s (382 intentionally unselected). Independent P0–P2 review is scoped-clean. The complete five-file changed-check gate passes, including core plus all 25 core-test type graphs, lint, ratchets, dead exports and architecture/auth guards; separate Madge analysis reports zero cycles. New-head hosted gates are not yet claimed. One intervening compilation attempt executed no cases because newly written local proof metadata changed the compiler namespace; the frozen replay above is the valid run.

Steering fixture correction (tests only): CI36308777797 exposed3 failures because the directive-test helper advertised unguarded V1 while upload-bearing, source-bound steering requires V2. Both production adapters already register V2 (attempt-stream-prepare.ts:478–527, run-attempt-active-turn.ts:529–569); the registry deliberately rejects source-bound V1. CI reported3failures/1283passes; the ordinary64-file leg of the recorded67-file plan reproduced those3 plus a separate local temp-root Git-marker failure (4failures/1282passes190.34s). The steering file alone reproduces3failures/222passes52.63s. Its default fixture now uses V2 and invokes the supplied guard immediately before mock-queue handoff, in the existing sibling support module. All225 test cases retain their assertions and timeouts; explicit legacy cases remain unchanged. All225cases pass23.37s; ratchets, formatting, lint and Gateway-methods types pass; independent P0-P2 review is scoped-clean. The first corrected full-plan replay passed all steering cases but retained the separate touched-files environment failure (1failure/1285passes186.08s). The shared local temp root has a pre-existing empty .git marker, violating that test’s non-checkout premise; it was not removed or modified. With a process-only verified non-Git temp root, all10 touched-file cases pass11.52s. The clean-temp replay passed the ordinary 64-file/1,286-case leg, then exposed the agent Stop/timeout attachment defect in the isolated leg. The repair and complete 67-file passing replay are recorded above. The steering change itself remains test-only; fresh CI remains required.

Custom plugin final-write guard: a plugin explicitly persisting client bytes now checks live upload policy regardless of its tool name. Whole-request and inherited RPC checks retain their captured classification so text-only tools stay available; trusted internal RPC remains exempt. A tiny custom plugin fixture exercises real loopback HTTP/RPC dispatch, the production plugin-context resolver, and native fs-safe Root.write admission (the tool catalog is injected, not a full plugin-loader/production-traffic test). On prior code, both initially-disabled and late-disabled requests returned200 and overwrote an existing file;3 enabled/internal/text controls passed (21.87s wall). Repaired full HTTP suite:66cases pass35.52s, about3.4s test time with most wall spent compiling workers. Four authority/context/Workboard sibling files:79cases pass25.40s. Ratchets, formatting, lint, core and Gateway-root types pass; incremental P0-P2 review is scoped-clean.

Cancellation follow-up: preserve the original abort reason before checking composed attachment admission. CI36307185176 failed the existing unsandboxed-cancellation case (1failure/823passes in the66-file ordinary Gateway-methods shard); replaying its captured70-file plan reproduces that failure in173.95s, and the file alone reproduces1failure/11passes in44.80s. The one-line repair passes all19 cancellation/upload-policy cases in67.17s, with unchanged assertions and awaited abandoned-file cleanup. It preserves ordinary staging-error and explicit RPC-abort precedence. Targeted lint, core and Gateway-methods types pass; incremental P0-P2 review is scoped-clean. The complete captured70-file Gateway-methods plan now passes896cases in194.71s, including its isolated-project cases. No test expectations changed.

Avatar settlement follow-up: if an inline avatar has already been written while uploads are enabled, finish its matching config projection instead of returning a denial with an unreported durable write. Creation keeps delegated/recovery authority live; update keeps workspace authority live. Input that has not yet been published is still denied after hot-disable, including bootstrap-only creation. Three real-writer settlement cases fail on the prior implementation (7 controls pass;46.99s wall); all10 policy cases pass after repair (51.81s wall). This includes remote write acknowledgment and unchanged-identity/no-publication controls. The file uses one state fixture and real native identity/config writers; mocking those writers would miss this partial-write defect. Most wall cost is compiled-worker preparation (34.56s in the green run); test time is about11s. Incremental independent review is scoped-clean through P2. Owning sibling tests passed37 cases (13 existing skips); they also exposed a missing pre-call authority assertion from the earlier final-hook change. Restoring that assertion alongside the native final-write hook makes the final43 creation-unit +10 policy cases pass in46.49s combined. The full selected six-file changed-check run completed successfully, including all25 core-test type graphs and its architecture/auth guards. The subsequent one-line cancellation repair has separate targeted checks above. Exact-head hosted gates remain required.

CI repair: run36306180497 exposed a main-composition callback shadow and a type-only chat-admission import cycle. Both are corrected without changing runtime behavior; targeted lint, full architecture check (including Madge) and core typecheck pass. The failed/cancelled run is not passing evidence.

Prior main reconciliation: merged a66d75f96795 while preserving both histories. The only manual conflict resolution was canonical regeneration of the config-documentation hash. All runtime files auto-merged, including upstream delegated-media custody. With current locked dependencies, 215 cases across 8 affected files pass in123.15s; config-baseline validation, core types and the Control UI build pass. Earlier broader checks below remain retained evidence; new-head CI is still required.

Current repair: input-only policy reaches the final filesystem, SQLite or transport admission for chat/agent/session/companion media, outbound buffers, inline avatars, terminal uploads, staged skill archives and installation, and HTTP/plugin tools. Classification survives hydration. Accepted results and compensating cleanup remain intact. Plugin tool context gains an optional SQL-safe assertInputCommitAllowed; no schema, stored-format, retention or transaction-model change.

  • Real negative control: on published d2dc4030b2f, HTTP tool → in-process Gateway → archive storage returned success and committed a new SQLite upload row after hot-disable. The repaired path returns 403 and leaves rows unchanged. Original-code avatar, inbound/outbound, terminal, skill-install and media-publication regressions also fail at the intended boundary; repaired owner cases pass.
  • HTTP + Workboard tools: 66 cases pass in 18.75s combined wrapper wall. Workboard tests observe real raw blob storage at queued writes, blob commit and metadata publication, including cleanup after rejection.
  • Affected siblings: 480 cases across 7 files pass in 45.73s: OpenAI/Responses HTTP, node invocation, in-process authorization/continuation, plugin-context construction and media storage. Earlier focused late-effect proof passed 765 cases across 17 files; applicable evidence is reused, not counted as new execution.
  • Browser behavior: the full retained-file skills flow passes 7 cases. It now asserts retainFiles for unchanged support files rather than retransmitting their bytes. Earlier actual Control UI/mock-Gateway E2E verified hot policy refresh, hidden file/photo/camera controls, preserved drafts and text-only sending. It is not live production-traffic proof.
  • Build: the full package-owned build passed in7m26.2s, including native declarations, SDK exports, runtime loader checks and Control UI. Subsequent test-only cleanup and an unused internal export removal were checked separately. New-head CI will validate the published artifact.

Validation before the mechanical main refresh: all planned changed-scope checks passed across the main run and targeted failure replays: core and all test type graphs, extension types, core/extension lint, ratchets, dead exports, SDK boundaries and architecture/auth guards. Final fixture replay passed 42 cases, including all 7 browser cases, in63.00s. Independent review completed with 11 reports: old-index observations are resolved by the staged repaired tree; four context-dependent concerns were checked against complete callers. No actionable current-tree finding remains from that review; it is not described as scoped-clean. New-head CI and ClawSweeper review remain required.

Performance approval: @steipete approved the paired startup baseline/cap 370,756→371,771 B (+0.27%) on September 27. The existing 512 B growth and 64 B variance allowances remain unchanged. The reconciled committed build measures 371,616 / 372,347 B startup JavaScript. Startup CSS is 50,359 B, below its 51,200 B hard ceiling but above the advisory target. No new budget exception.

Current CI investigation: run36308009045 on12c2655e0cb failed native-subagent-monitor.rotated-parent.test.ts (finishes-after-registration) with Task registry read identity requires preparation:1failed/325passed/1skipped across11files127.31s. The implicated test, monitor/history-recovery, SDK task-runtime and task-reader files are unchanged against the incorporated main base. The captured11-file owner plan passes326cases with1existing skip locally in87.20s, then the isolated file passes22cases in63.66s. The failure did not reproduce. Source inspection found a retained prepared task-read path, but no safe demonstrated repair was established; no Codex/task-reader source, assertions, retries or timeouts were changed. Local replay is not the hosted runtime environment and is not proof of a fix. The original failure remains recorded, and the new head still requires enforced CI.

Historical proof and limits: previously published proposal/library/Workboard final-effect fixes were verified through real handlers and filesystem/SQLite writers; 223 Workboard cases and the proposal/library owner regressions passed. Reconciliation preserved current-main identity, attachment-read and request-lifecycle ownership. The earlier UI shard 3 had four 5px desktop-overflow failures, reproduced once in isolation; they are not claimed fixed by this change. Published-head CI later failed the skills-library request-shape assertion now corrected by the 7-case browser replay. On published head 2b78910f608a, CI36309927348 passed all three UI checks and all nine browser-E2E shards, including shard 3; this is observed passing evidence, not a diagnosed fix for the historical overflow. The same run failed the Gateway agent attachment cases repaired above and cancelled sibling jobs. Exact-head CI still owns final validation. Cancelled and skipped jobs are not passes.

Focused late-effect test costs

Seconds, retained single-worker file measurements; wall includes compiler/cache, imports and teardown. Subsequent grouped fixture replays are stated above.

Test file (under src/ unless noted) Cases Command wall
gateway/server-methods/chat.directive-tags.test.ts 225 23.37
gateway/server-methods/terminal.dispatch-authority.test.ts 27 13.98
gateway/server-methods/terminal-upload.policy.test.ts 2 10.57
gateway/server-methods/skills-upload.policy.test.ts 9 11.55
gateway/server-methods/agents-upload.policy.test.ts 10 51.81
gateway/server.client-upload-policy.test.ts 9 22.65
gateway/server-methods/skills.install-upload-policy.test.ts 5 12.39
gateway/session-companion-ask.test.ts 16 19.15
gateway/chat-attachments.test.ts 73 10.31
media/store.read-scope.test.ts 23 11.17
gateway/openai-compatible-agent-run.test.ts 23 13.00
gateway/server-methods.upload-policy.test.ts 36 11.23
gateway/openai-http.test.ts 131 21.90
gateway/openresponses-http.test.ts 137 22.42
gateway/tools-invoke-http.test.ts 66 35.52
gateway/server-methods/send.test.ts 146 17.77
media/outbound-attachment.test.ts 5 1.80
infra/outbound/message-action-params.test.ts 58 11.39
extensions/workboard/src/tools.upload-policy.test.ts 5 10.92

Negative-control wall: avatar25.44s, inbound23.17s, outbound25.97s, archive-install9.68s, nested SQLite9.97s, buffer/stream publication8.01s, Workboard tool storage10.15s. Failures were inspected for their intended effect; unsuccessful fixture/compilation attempts are excluded. Native lifecycle cleanup and shared suite fixtures are retained. New-head CI seconds will be recorded after the run exists.

Historical measurements

Retained from earlier published revisions; cancelled/failed CI jobs below are not passing evidence for the new head.

Measured changed-test costs
Test file Cases passed Vitest case-time sum (s) Command wall (s)
extensions/workboard/src/gateway.test.ts 13 3.769 104.18
src/config/config.schema-regressions.test.ts 53 0.242 76.54
src/gateway/config-reload.operation-policy.test.ts 82 0.258 32.23
src/gateway/control-ui.http.test.ts 160 9.755 60.84
src/gateway/openai-http.test.ts 151 13.261 85.71
src/gateway/openresponses-http.test.ts 146 8.752 93.27
src/gateway/server-methods/nodes.invoke-wake.test.ts 87 0.525 79.78
src/gateway/server-methods/skills-library.test.ts 4 0.633 36.34
src/gateway/tools-invoke-http.test.ts 60 4.447 17.64
ui/src/app/config.test.ts 20 0.016 3.34
ui/src/components/command-palette-attachments.test.ts 13 1.343 9.39
ui/src/components/terminal/terminal-panel-upload.test.ts 12 0.582 3.92
ui/src/pages/agents/identity-actions.test.ts 10 0.029 15.82
ui/src/pages/chat/chat-view.attachment-paste.test.ts 10 0.648 19.28
ui/src/pages/new-session/composer.test.ts 49 0.601 16.84
ui/src/pages/new-session/draft-submission-flow.test.ts 28 0.425 27.87
ui/src/pages/profile/identity-section.test.ts 9 0.222 17.68
ui/src/pages/profile/profile-page.test.ts 20 9.620 24.27
src/gateway/server-methods.upload-policy.test.ts 35 0.264 29.61
ui/src/pages/chat/chat-upload-policy.test.ts 2 0.097 5.92
ui/src/pages/skills/library-uploads.test.ts 10 0.056 2.86
ui/src/e2e/uploads-policy.e2e.test.ts 1 1.393 26.84
Total 975 56.938 790.17

Seconds. Unit commands ran serially as pnpm test <file> --maxWorkers=1; the browser E2E used the supported bundled UI runner. Wall includes launcher, worker compilation/cache, imports, and teardown. Case time sums reported Vitest milliseconds, not a percentage conversion. Existing suite-level fixtures remain shared; no new per-test Gateway boots. Two plugin-page files contain fixture-type-only changes, no new cases. First ready CI run 36210733555: bundled-protocol job failed after218s (protocol step141s); fail-fast cancelled the rest. Control UI performance passed in135s and UI E2E shard9/9 passed in216s. UI unit shards were cancelled after245s each; those are not passing results. Repaired-head CI remains required. The additional proposal-upload suite has19 passing cases, ~1.5s execution and12.68s warm command wall; its136-case sibling replay took64.20s.

Updated changed-test costs (seconds)
File Cases Command wall
src/gateway/server-methods/skills-library.test.ts 6 14.49
extensions/workboard/src/gateway.test.ts 15 16.47
ui/src/app/app-host.test.ts 33 4.75
ui/src/app/app-host.chat-metadata.test.ts 43 3.87
ui/src/app/app-shell-gateway.test.ts 34 2.18

Each measured with pnpm test <file> --maxWorkers=1; wall includes loading/compilation. Full local Node UI shard2:161.44s; shard 3:156.57s, including the reported geometry failures. CI run36213313574 failed the missing-config fixtures; bundled protocol passed207s, UI1/3 passed313s, failed UI2/3 and3/3 jobs319s/324s. These are job elapsed times, not isolated test cost. New-head CI is required.

Worked on by

Work sessions


View the OpenClaw team session

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 3de937bd-f1f9-4710-b319-7c1137141175
@clawsweeper

clawsweeper Bot commented Sep 26, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime plugin: workboard size: XL labels Sep 26, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 26, 2026 02:08
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: c320cbbaa799e4e655f376651d21b9e6d7589026
  • Maintainer: @roboclaw-bot
  • Repository role: maintain

These security sensitive changes were made:

  • src/agents/tools/presence-tool-authority.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/operator-invocation-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/operator-tool-gateway-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 27, 2026, 9:16 PM ET / September 28, 2026, 01:16 UTC (Revision 20).

ClawSweeper review

What this changes

Adds a default-enabled Gateway setting that hides Control UI upload actions and rejects new client file and image input across supported Gateway, HTTP, skill, and Workboard paths.

Merge readiness

⛔ Blocked before merge - 6 items remain

Keep open. Current main does not offer this operator control, and the branch has credible behavior proof with no verified correctness finding. Its operator-facing policy scope and UI budget still need an independent maintainer decision.

Priority: P2
Reviewed head: c320cbbaa799e4e655f376651d21b9e6d7589026
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong final-effect and visual evidence supports the patch, with a documented plugin boundary and measured UI cost awaiting owner acceptance.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed Gateway input and plugin final-write owners are exercised through loopback HTTP/RPC and the native filesystem writer: the recorded disabled and late-disabled cases return 403 without changing the file, while enabled and internal controls succeed. Inspected before/after Control UI images show upload controls removed. No persisted schema or file format changes require migration; the optional config key preserves the enabled default.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed Gateway input and plugin final-write owners are exercised through loopback HTTP/RPC and the native filesystem writer: the recorded disabled and late-disabled cases return 403 without changing the file, while enabled and internal controls succeed. Inspected before/after Control UI images show upload controls removed. No persisted schema or file format changes require migration; the optional config key preserves the enabled default.
Evidence reviewed 11 items Current-main capability: Current main proceeds from Control UI configuration to cliAgents without an uploads setting; the proposed switch remains absent.
Release check: GitHub lists v2026.9.6 as published on 2026-09-23, before this feature PR opened. Current main also lacks the switch.
Gateway policy owner: The introduced classifier identifies client media input and retains that classification for a live final-write check after preparation.
Findings None None.
Security None None.

How this fits together

Clients send text and media through the Control UI and Gateway APIs. Gateway policy checks new media input before handlers deliver messages or commit bytes to storage.

flowchart LR
  A[Operator upload setting] --> C[Gateway upload policy]
  B[UI and API requests] --> C
  C --> D{New client bytes?}
  D -->|Disabled| E[Reject request]
  D -->|Allowed| F[Handler and final write guard]
  F --> G[Message or storage]
Loading

Decision needed

Question Recommendation
Should this switch ship with existing custom plugin byte writers responsible for adopting the optional final-write guard, and with the 371,771-byte UI startup baseline? Accept the documented scope and budget: Record owner acceptance of plugin opt-in at final writes and the measured startup baseline.

Why: The documented scope cannot control arbitrary trusted plugin writes, and the PR's account of budget approval does not independently settle either operator-facing tradeoff.

Before merge

  • Resolve merge risk (P1) - With uploads disabled, an existing third-party tool that persists client-supplied bytes without adopting the new optional final-write callback can still write them. An owner must accept this documented policy limit before merge.
  • Resolve merge risk (P1) - The Control UI startup JavaScript baseline rises by 766 gzip bytes. Approval is asserted in the PR, but independent owner acceptance is not recorded on it.
  • Complete next step (P2) - Record a maintainer decision on the trusted-plugin final-write contract and the 371,771-byte startup baseline before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Operator setting 1 added; default enabled Existing configurations retain upload behavior until an operator opts out.
Extension contracts 1 optional plugin callback and 1 skill-library request field added Plugin authors and skill-library clients gain new documented ways to handle final writes and retain existing files.
Control UI startup baseline +766 gzip bytes The cap change is measurable and needs a recorded owner disposition.
Production and test LOC production +1,588 net; tests +5,046 net Production growth is attributed to guards across multiple final-effect owners; the substantial test expansion increases review cost.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #158556
Summary: This PR is the candidate implementation for the linked open operator upload-control request.

Members:

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

Merge-risk options

Maintainer options:

  1. Accept the scoped policy (recommended)
    Approve the documented plugin opt-in limit and measured UI budget on this PR.
  2. Pause for a broader contract
    Hold landing if operators must be able to block custom plugin writers without plugin adoption.

Technical review

Best possible solution:

Ship one Gateway-owned client-upload policy with live final-effect checks, a clearly approved trusted-plugin contract, and an accepted UI startup budget.

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

Not applicable: this adds an operator capability rather than repairing a reported failure. Current main lacks the setting; the branch provides source, final-write, and Control UI evidence for the proposed behavior.

Is this the best way to solve the issue?

Yes for supported Gateway input: centralized admission and final-write checks preserve text requests and accepted receipts. The trusted-plugin coverage and UI budget remain owner choices.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 72b76842012f.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a useful, bounded operator feature without an established urgent regression.
  • merge-risk: 🚨 compatibility: Existing custom plugin byte writers will not honor the disabled-upload setting until they adopt the new optional callback.
  • 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 (terminal): The changed Gateway input and plugin final-write owners are exercised through loopback HTTP/RPC and the native filesystem writer: the recorded disabled and late-disabled cases return 403 without changing the file, while enabled and internal controls succeed. Inspected before/after Control UI images show upload controls removed. No persisted schema or file format changes require migration; the optional config key preserves the enabled default.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed Gateway input and plugin final-write owners are exercised through loopback HTTP/RPC and the native filesystem writer: the recorded disabled and late-disabled cases return 403 without changing the file, while enabled and internal controls succeed. Inspected before/after Control UI images show upload controls removed. No persisted schema or file format changes require migration; the optional config key preserves the enabled default.

Evidence

What I checked:

  • Current-main capability: Current main proceeds from Control UI configuration to cliAgents without an uploads setting; the proposed switch remains absent. (src/config/zod-schema.gateway.ts:203, 72b76842012f)
  • Release check: GitHub lists v2026.9.6 as published on 2026-09-23, before this feature PR opened. Current main also lacks the switch. (eb377ac59e6c)
  • Gateway policy owner: The introduced classifier identifies client media input and retains that classification for a live final-write check after preparation. (src/gateway/upload-policy.ts:134, c320cbbaa799)
  • Receipt-aware routing: Canonical handlers retain their own accepted-request replay admission; overridden handlers keep the router upload fence. (src/gateway/server-methods/core-handlers.ts:190, c320cbbaa799)
  • Plugin API boundary: The branch adds an optional host-bound final-write callback to plugin tool context. The accompanying documentation asks plugins that persist client bytes to call it; existing custom writers are not automatically mediated. (src/plugins/tool-types.ts:75, c320cbbaa799)
  • Final-effect proof: The exact captured PR body reports loopback HTTP/RPC runs through the production tool context and native filesystem writer. The fixture covers initially disabled, late disabled, enabled, internal, and text-only cases, checking both response and final file contents. (src/gateway/tools-invoke.policy.test-support.ts:73, c320cbbaa799)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Shakker: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record independent owner acceptance of the optional plugin final-write boundary and the 371,771-byte startup baseline.

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 (19 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-27T09:50:07.649Z sha 2b78910 :: blocked before merge. :: none
  • reviewed 2026-09-27T12:37:07.994Z sha bfaa0ec :: blocked before merge. :: none
  • reviewed 2026-09-27T16:03:51.362Z sha 1ec091c :: blocked before merge. :: none
  • reviewed 2026-09-27T19:56:54.066Z sha 94cc315 :: blocked before merge. :: none
  • reviewed 2026-09-27T21:04:58.696Z sha 315195c :: blocked before merge. :: none
  • reviewed 2026-09-27T23:58:58.785Z sha cb337ed :: blocked before merge. :: none
  • reviewed 2026-09-28T00:16:05.839Z sha 4b7226d :: blocked before merge. :: none
  • reviewed 2026-09-28T00:51:40.339Z sha 60247e4 :: blocked before merge. :: none

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 8ecc08aa-73bd-4250-9fe9-56656141d80a
@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Sep 26, 2026
Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: c71e19b5-761c-4340-b91e-2ffcf5863b11
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 26, 2026
Preserve main filesystem admission and asynchronous Control UI reads while retaining live upload policy guards. Regenerate config documentation from the merged schema.

Co-authored-by: steipete <[email protected]>
Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 54e8020d-028f-4979-9227-6e5a98bde26d
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) September 28, 2026 00:10
roboclaw-bot and others added 4 commits September 28, 2026 00:38
Observe the real keyboard-triggered header action with a pass-through spy and join its promise before checking the existing Undo toast. Keep all target, draft, navigation and Undo assertions, without replacing implementation or changing timeouts.

Co-authored-by: steipete <[email protected]>
Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 3bc2883f-ba75-4b4b-96c3-c97487509461
Regenerate the exact common-leaf expectation for gateway.uploads.enabled, which the approved feature already declares common. Preserve production tiers and the complete exact-set assertion.

Co-authored-by: steipete <[email protected]>
Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 852353c8-d836-48df-9129-5051bab52261
@roboclaw-bot
roboclaw-bot merged commit f2e5268 into main Sep 28, 2026
247 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/disable-and-test-file-image-uploads branch September 28, 2026 01:40
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

MarMarLabs added a commit to MarMarLabs/openclaw that referenced this pull request Sep 28, 2026
50 upstream commits, including the gateway switch for client file and
image uploads (openclaw#158567) and cleanup passes over infra, scripts, channel
core and agent tools. No file outside the generated set changed on both
sides.

Two conflicts, both generated: docs/.generated/config-baseline.counts.json
and docs/.generated/config-baseline.sha256. openclaw#158567 adds gateway.uploads
and gateway.uploads.enabled, so core goes from 2462 to 2464. This branch
keeps channel at 3788 and plugin stays at 4350. Both files came from
upstream and were regenerated.

build:docker ran in a separate detached checkout of this commit outside the
nested node_modules install. Regenerating there changed those two files and
nothing else, giving the predicted counts, the upstream core hash, this
branch's channel hash and a new combined hash. The three generated-file
checks pass there.

No test this branch added or changed was deleted upstream in this range.

Feishu: 106 files and 1854 tests in the extension project, 17 files and
312 tests in the database-workers project. The forwarder test and the
routing guards pass, 1931 tests. tsgo:core, tsgo:extensions,
tsgo:extensions:test, tsgo:test:root, the line-cap, max-lines and
assertion-safety ratchets against upstream/main, oxlint and oxfmt on the
43 changed code files all pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
…penclaw#158567)

Add a default-enabled, hot-applied Gateway switch for client file and image uploads, reflected in the Control UI. Enforce the policy at final input-write boundaries while preserving text, drafts, trusted internal/generated media, and authorized accepted request receipts. Retain existing skill support files by exact revision.

Closes openclaw#158556

Worked on by:
- @steipete

Work session: https://team.openclaw.ai/chat/roboclaw/dashboard/722174dd-3af0-4d0c-b6e9-d9fbe6101472

Co-authored-by: steipete <[email protected]>
steipete added a commit that referenced this pull request Oct 13, 2026
Share route decoding, attachment retention, gallery preparation, transient
identity encoding, override copying, and extension classification. Remove
duplicate admission/schema mirrors and obsolete supported-browser fallbacks.
Both Lit and Solid paths remain; no rendering change is intended. No config,
protocol, persisted shape, dependency, or public SDK change.

Best-effort tradeoffs accepted

- Malformed internal native requests (#140988): all callers are typed and
  native hosts validate at the effect; their error replaces the renderer mirror.
- Worker replacement during an identity query (#140484): added for synthetic
  autoreview interleavings, not a human incident. Return false; normal worker
  announcements and foreground recovery observe the next active worker.
- Native readiness changing between synchronous checks (#140484/#109719):
  rely on queued events. A broken native event can require another worker event
  or reload; camera readiness retains its existing five-second error deadline.
- Overlapping application-root health reporters (#152638): startup mounts one
  root. Unsupported overlapping roots are last-publication-wins; the actual
  reported health/status feature and native trusted-document checks remain.
- Polling after stop (#139704): its sole owner retires eligibility first.
  Scheduling now uses that owner admission, not a separate read-only generation.
- Resetting an observer without retiring its connection (#116887): no production
  caller does this. Canonical connection epochs remain the sole retirement owner;
  unsupported direct live-scope reset no longer fences an old response separately.
- Upload policy changing during local reads (#158567): decoded/hash work can
  finish. Draft publication and every upload request retain live policy checks.
- Missing supported browser primitives (#105240/#151388/#100024/#102745):
  unsupported runtimes error instead of code-point initials, skipped input yield,
  wall-clock timing, or approximate microtask paint. The human progress-card fix
  in #151386 keeps its browser yield and durable FIFO handoff unchanged.
- URL APIs disappearing after URL creation (#100024/#149330): supported browsers
  keep paired APIs. An unsupported replaced global can throw during cleanup;
  undefined URLs, creation fallback, cancellation and release ordering remain.
- Malformed internal MCP calls bypassing AppBridge (#161747): may throw. The SDK
  still rejects malformed wire blocks before dispatch, proved over real in-memory
  App/AppBridge transport. UI content, authority, confirmation and custody policy
  remain. The introducing PR cites no human incident for the second mirror.

Production: +176/-394, net -218 lines across 21 eligible old files. Tests: +30.
Focused owner/sibling tests, targeted types/lint/format, lint-suppression and
independent P0-P2 review pass. Import edges are unchanged; runtime/Madge cycle
proof remains zero. Whole-tree Knip timed out at existing limits; heavy gallery
renderer runs did not reach assertions, while its owning controller suite passed.
steipete added a commit that referenced this pull request Oct 13, 2026
* refactor(apple): simplify old shared and macOS bookkeeping

Replace redundant generations with existing cancellation or actual owner
identity, consolidate parallel fallback/policy paths, and remove test-only
forwarding layers. Preserve authority, FIFO, durable state, resource bounds,
public protocol/config shapes, signing, permissions, and visible rendering.

Reuse canonical session-key normalization for Voice Wake delivery selection:
opaque Signal group IDs remain case-sensitive and main aliases are not added.
Use canonical IP-literal policy for discovery labels and remote CLI validation.

Best-effort tradeoffs accepted

- Palette generation (#159350): synthetic direct completions bypassed the sole cancellation-owning caller; unsupported future callers can show stale results until the next search. Current cancellation/request/agent checks remain.
- Link preview generation (#160710): synthetic URL replacement without caller cancellation is outside the SwiftUI task lifecycle; a late cosmetic result can remain until the next refresh. Network/SSRF checks and bounded caches remain.
- Sidebar preview generation (#147197): same-request overlapping cache reads can finish out of order; no linked human failure report, and a later refresh replaces the cosmetic projection. Owner/request checks remain.
- Source-preview producer revision (#148906): duplicate of exact task cancellation, with no human failure report. Consumer revision and authenticated resource authority remain.
- Mermaid generations (#135470/#135746): feature stress fixtures, no linked human race report. Exact subscriber cancellation and job/WebView identity retain the same admission; no extra failure accepted.
- Camera JPEG UUID (#107879): duplicates exact task cancellation; #107804 was a human feature request, not a generation-specific incident. Captured session/agent/route and attachment admission remain.
- Discovery generation (#145435): speculative queued callbacks, no linked human incident. A stopped browser may publish one late discovery projection; next discovery/refresh repairs it. Connection authority remains separate.
- FSEvents generation (#145453): synthetic stop/restart fixtures, no linked human incident. An old callback after restart may cause one extra refresh; serial lifecycle ownership and pending-work cancellation remain.
- Menu generations (#139688): feature-local late-result fixtures, no linked human incident. Exact task cancellation replaces duplicate tokens; drain-before-disconnect and real consumer/window authority remain.
- Cron generation (#131466/#137502): #138209 cut every load over to one cancel-and-drain chain. No direct concurrent load caller remains; cancellation and physical source leases stay checked after awaits.
- WebChat visibility acknowledgement/retry (#113634/#137089): synthetic timeout/reconnect interleavings, no linked human incident. A timed-out visibility update is best effort until the next transition/reconnect; FIFO and live socket leases remain.
- WebChat cleanup UUID (#113634/#137089): retain one bounded completed Task handle per live connection instead of matching cleanup tokens. Completion releases captures; replacement/retirement removes the handle.
- Child-exit polling (#145437): synthetic missed-notification coverage, no linked human report. A lost OS exit notification may wait for the existing deadline; final non-reaping liveness/status checks and cleanup remain.
- Realtime iterator borrowing trap (#156772): every real consumer awaits its own iterator sequentially. Unsupported concurrent next calls no longer get a custom custody protocol; bounded stream/cancellation/socket checks remain.
- Receipt projection admission (#161745): both real callers already match receipt and row identity immediately before synchronous projection. Those effect checks remain; no unsupported internal caller is defended twice.
- Recap attribution heuristics (#112188/#113084): synthetic guard matrix, no linked human race report. Missing initial rows or very late unrelated completion may supply a cosmetic footer; per-session freshness, failed-turn handling and settled results remain.
- PortGuardian per-write schema scans (#110527): synthetic live-handle version advance, no linked human incident. Concurrent external schema upgrades are best effort until reopen; initial admission, migration locks, receipts, transactions and durability remain.
- Unread queue counter (#110019): actual Task equality replaces the duplicate integer token. Exact-tail reclamation, bounded bookkeeping, FIFO and route authority remain unchanged.

Review dispositions: the claimed Task compilation failure is disproved by the
selected SDK's Equatable conformance and native builds. Repeated receipt
identity admission is unnecessary at its internal projector because both real
callers retain it immediately before projection. Per-write schema revalidation
was declined under the explicit best-effort policy above.

Proof and scope

Net production reduction: 369 lines (148 added, 517 deleted), excluding tests.
Fresh seven-day census permits all substantive production edits; the only
recent caller change is the unavoidable one-line fallback-to-parse rename.

Shared Swift build passed. Final focused shared tests passed 396 cases in six
suites (6.683s execution), Watch decoder tests passed five cases (0.003s), and
isolated whole-owner native tests passed 16 cases. macOS SwiftPM compiled all
products and the test bundle. Final macOS and iOS/Watch xcodebuild builds passed
(89.60s and 120.87s wall), without signing changes or app launches.

Canonical Apple lint/format checks passed; the initial iOS format failure in
WatchCommands was ours and corrected, with no gate weakened. Lint-suppression
tests passed 3/3 (14.09s wall). Earlier runtime cycles and Madge each reported 0;
the TypeScript graph is unchanged. Native localization stayed at 4476 entries.
The 45 original packaging/elevation timeout cases passed one focused retry
(94.79s wall), with no assertion/budget change and no claim of a diagnosed fix.

Known gaps: seven issues remained in the earlier ChatStreamReplayTests
narration=false package cases; causality/current-main attribution is unproven.
App-hosted macOS tests were not executed on the operator desktop. No hosted CI
or PR was started: the explicit BELOW-500 rule requires a branch-only handoff.

* refactor(ui): consolidate old UI owners and validation

Share route decoding, attachment retention, gallery preparation, transient
identity encoding, override copying, and extension classification. Remove
duplicate admission/schema mirrors and obsolete supported-browser fallbacks.
Both Lit and Solid paths remain; no rendering change is intended. No config,
protocol, persisted shape, dependency, or public SDK change.

Best-effort tradeoffs accepted

- Malformed internal native requests (#140988): all callers are typed and
  native hosts validate at the effect; their error replaces the renderer mirror.
- Worker replacement during an identity query (#140484): added for synthetic
  autoreview interleavings, not a human incident. Return false; normal worker
  announcements and foreground recovery observe the next active worker.
- Native readiness changing between synchronous checks (#140484/#109719):
  rely on queued events. A broken native event can require another worker event
  or reload; camera readiness retains its existing five-second error deadline.
- Overlapping application-root health reporters (#152638): startup mounts one
  root. Unsupported overlapping roots are last-publication-wins; the actual
  reported health/status feature and native trusted-document checks remain.
- Polling after stop (#139704): its sole owner retires eligibility first.
  Scheduling now uses that owner admission, not a separate read-only generation.
- Resetting an observer without retiring its connection (#116887): no production
  caller does this. Canonical connection epochs remain the sole retirement owner;
  unsupported direct live-scope reset no longer fences an old response separately.
- Upload policy changing during local reads (#158567): decoded/hash work can
  finish. Draft publication and every upload request retain live policy checks.
- Missing supported browser primitives (#105240/#151388/#100024/#102745):
  unsupported runtimes error instead of code-point initials, skipped input yield,
  wall-clock timing, or approximate microtask paint. The human progress-card fix
  in #151386 keeps its browser yield and durable FIFO handoff unchanged.
- URL APIs disappearing after URL creation (#100024/#149330): supported browsers
  keep paired APIs. An unsupported replaced global can throw during cleanup;
  undefined URLs, creation fallback, cancellation and release ordering remain.
- Malformed internal MCP calls bypassing AppBridge (#161747): may throw. The SDK
  still rejects malformed wire blocks before dispatch, proved over real in-memory
  App/AppBridge transport. UI content, authority, confirmation and custody policy
  remain. The introducing PR cites no human incident for the second mirror.

Production: +176/-394, net -218 lines across 21 eligible old files. Tests: +30.
Focused owner/sibling tests, targeted types/lint/format, lint-suppression and
independent P0-P2 review pass. Import edges are unchanged; runtime/Madge cycle
proof remains zero. Whole-tree Knip timed out at existing limits; heavy gallery
renderer runs did not reach assertions, while its owning controller suite passed.

* refactor(ui): remove obsolete Fetch capability branch

The supported Control UI browser floor includes Fetch. Start attachment
metadata reads directly rather than leaving an unsupported runtime in a
permanent checking state.

Best-effort tradeoffs accepted

- Missing global Fetch: the guard originated in #64104, whose feature report
  cites no human missing-Fetch incident. An unsupported runtime that replaces
  Fetch now reaches the existing rejected-request/unavailable path. Metadata
  validation, auth/tickets, allow POST, cancellation, resource admission,
  expiry and bounded retry remain unchanged. No intended rendering change.

Unchanged lifecycle baseline: 21/21, 25.09 s. Final lifecycle and attachment
siblings: 50/50, 14.77 s. UI types, typed lint, formatting and lint-suppression
checks pass. This cut removes five production lines including formatter
reflow, bringing the lane to 223 net production lines removed.
Fresh independent P0-P2 review is scoped-clean with no actionable findings.

* fix(ui): use global frame scheduling APIs

Preserve double-frame paint timing and cancellation without requiring a Window object in renderer-free hosts that supply the standard global APIs. The existing access suite reproduces seven unhandled errors before this fix and passes on main; all 130 affected cases plus 262 timing/state/send sibling cases now pass without test changes.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…#170823)

* refactor(apple): simplify old shared and macOS bookkeeping

Replace redundant generations with existing cancellation or actual owner
identity, consolidate parallel fallback/policy paths, and remove test-only
forwarding layers. Preserve authority, FIFO, durable state, resource bounds,
public protocol/config shapes, signing, permissions, and visible rendering.

Reuse canonical session-key normalization for Voice Wake delivery selection:
opaque Signal group IDs remain case-sensitive and main aliases are not added.
Use canonical IP-literal policy for discovery labels and remote CLI validation.

Best-effort tradeoffs accepted

- Palette generation (openclaw#159350): synthetic direct completions bypassed the sole cancellation-owning caller; unsupported future callers can show stale results until the next search. Current cancellation/request/agent checks remain.
- Link preview generation (openclaw#160710): synthetic URL replacement without caller cancellation is outside the SwiftUI task lifecycle; a late cosmetic result can remain until the next refresh. Network/SSRF checks and bounded caches remain.
- Sidebar preview generation (openclaw#147197): same-request overlapping cache reads can finish out of order; no linked human failure report, and a later refresh replaces the cosmetic projection. Owner/request checks remain.
- Source-preview producer revision (openclaw#148906): duplicate of exact task cancellation, with no human failure report. Consumer revision and authenticated resource authority remain.
- Mermaid generations (openclaw#135470/openclaw#135746): feature stress fixtures, no linked human race report. Exact subscriber cancellation and job/WebView identity retain the same admission; no extra failure accepted.
- Camera JPEG UUID (openclaw#107879): duplicates exact task cancellation; openclaw#107804 was a human feature request, not a generation-specific incident. Captured session/agent/route and attachment admission remain.
- Discovery generation (openclaw#145435): speculative queued callbacks, no linked human incident. A stopped browser may publish one late discovery projection; next discovery/refresh repairs it. Connection authority remains separate.
- FSEvents generation (openclaw#145453): synthetic stop/restart fixtures, no linked human incident. An old callback after restart may cause one extra refresh; serial lifecycle ownership and pending-work cancellation remain.
- Menu generations (openclaw#139688): feature-local late-result fixtures, no linked human incident. Exact task cancellation replaces duplicate tokens; drain-before-disconnect and real consumer/window authority remain.
- Cron generation (openclaw#131466/openclaw#137502): openclaw#138209 cut every load over to one cancel-and-drain chain. No direct concurrent load caller remains; cancellation and physical source leases stay checked after awaits.
- WebChat visibility acknowledgement/retry (openclaw#113634/openclaw#137089): synthetic timeout/reconnect interleavings, no linked human incident. A timed-out visibility update is best effort until the next transition/reconnect; FIFO and live socket leases remain.
- WebChat cleanup UUID (openclaw#113634/openclaw#137089): retain one bounded completed Task handle per live connection instead of matching cleanup tokens. Completion releases captures; replacement/retirement removes the handle.
- Child-exit polling (openclaw#145437): synthetic missed-notification coverage, no linked human report. A lost OS exit notification may wait for the existing deadline; final non-reaping liveness/status checks and cleanup remain.
- Realtime iterator borrowing trap (openclaw#156772): every real consumer awaits its own iterator sequentially. Unsupported concurrent next calls no longer get a custom custody protocol; bounded stream/cancellation/socket checks remain.
- Receipt projection admission (openclaw#161745): both real callers already match receipt and row identity immediately before synchronous projection. Those effect checks remain; no unsupported internal caller is defended twice.
- Recap attribution heuristics (openclaw#112188/openclaw#113084): synthetic guard matrix, no linked human race report. Missing initial rows or very late unrelated completion may supply a cosmetic footer; per-session freshness, failed-turn handling and settled results remain.
- PortGuardian per-write schema scans (openclaw#110527): synthetic live-handle version advance, no linked human incident. Concurrent external schema upgrades are best effort until reopen; initial admission, migration locks, receipts, transactions and durability remain.
- Unread queue counter (openclaw#110019): actual Task equality replaces the duplicate integer token. Exact-tail reclamation, bounded bookkeeping, FIFO and route authority remain unchanged.

Review dispositions: the claimed Task compilation failure is disproved by the
selected SDK's Equatable conformance and native builds. Repeated receipt
identity admission is unnecessary at its internal projector because both real
callers retain it immediately before projection. Per-write schema revalidation
was declined under the explicit best-effort policy above.

Proof and scope

Net production reduction: 369 lines (148 added, 517 deleted), excluding tests.
Fresh seven-day census permits all substantive production edits; the only
recent caller change is the unavoidable one-line fallback-to-parse rename.

Shared Swift build passed. Final focused shared tests passed 396 cases in six
suites (6.683s execution), Watch decoder tests passed five cases (0.003s), and
isolated whole-owner native tests passed 16 cases. macOS SwiftPM compiled all
products and the test bundle. Final macOS and iOS/Watch xcodebuild builds passed
(89.60s and 120.87s wall), without signing changes or app launches.

Canonical Apple lint/format checks passed; the initial iOS format failure in
WatchCommands was ours and corrected, with no gate weakened. Lint-suppression
tests passed 3/3 (14.09s wall). Earlier runtime cycles and Madge each reported 0;
the TypeScript graph is unchanged. Native localization stayed at 4476 entries.
The 45 original packaging/elevation timeout cases passed one focused retry
(94.79s wall), with no assertion/budget change and no claim of a diagnosed fix.

Known gaps: seven issues remained in the earlier ChatStreamReplayTests
narration=false package cases; causality/current-main attribution is unproven.
App-hosted macOS tests were not executed on the operator desktop. No hosted CI
or PR was started: the explicit BELOW-500 rule requires a branch-only handoff.

* refactor(ui): consolidate old UI owners and validation

Share route decoding, attachment retention, gallery preparation, transient
identity encoding, override copying, and extension classification. Remove
duplicate admission/schema mirrors and obsolete supported-browser fallbacks.
Both Lit and Solid paths remain; no rendering change is intended. No config,
protocol, persisted shape, dependency, or public SDK change.

Best-effort tradeoffs accepted

- Malformed internal native requests (openclaw#140988): all callers are typed and
  native hosts validate at the effect; their error replaces the renderer mirror.
- Worker replacement during an identity query (openclaw#140484): added for synthetic
  autoreview interleavings, not a human incident. Return false; normal worker
  announcements and foreground recovery observe the next active worker.
- Native readiness changing between synchronous checks (openclaw#140484/openclaw#109719):
  rely on queued events. A broken native event can require another worker event
  or reload; camera readiness retains its existing five-second error deadline.
- Overlapping application-root health reporters (openclaw#152638): startup mounts one
  root. Unsupported overlapping roots are last-publication-wins; the actual
  reported health/status feature and native trusted-document checks remain.
- Polling after stop (openclaw#139704): its sole owner retires eligibility first.
  Scheduling now uses that owner admission, not a separate read-only generation.
- Resetting an observer without retiring its connection (openclaw#116887): no production
  caller does this. Canonical connection epochs remain the sole retirement owner;
  unsupported direct live-scope reset no longer fences an old response separately.
- Upload policy changing during local reads (openclaw#158567): decoded/hash work can
  finish. Draft publication and every upload request retain live policy checks.
- Missing supported browser primitives (openclaw#105240/openclaw#151388/openclaw#100024/openclaw#102745):
  unsupported runtimes error instead of code-point initials, skipped input yield,
  wall-clock timing, or approximate microtask paint. The human progress-card fix
  in openclaw#151386 keeps its browser yield and durable FIFO handoff unchanged.
- URL APIs disappearing after URL creation (openclaw#100024/openclaw#149330): supported browsers
  keep paired APIs. An unsupported replaced global can throw during cleanup;
  undefined URLs, creation fallback, cancellation and release ordering remain.
- Malformed internal MCP calls bypassing AppBridge (openclaw#161747): may throw. The SDK
  still rejects malformed wire blocks before dispatch, proved over real in-memory
  App/AppBridge transport. UI content, authority, confirmation and custody policy
  remain. The introducing PR cites no human incident for the second mirror.

Production: +176/-394, net -218 lines across 21 eligible old files. Tests: +30.
Focused owner/sibling tests, targeted types/lint/format, lint-suppression and
independent P0-P2 review pass. Import edges are unchanged; runtime/Madge cycle
proof remains zero. Whole-tree Knip timed out at existing limits; heavy gallery
renderer runs did not reach assertions, while its owning controller suite passed.

* refactor(ui): remove obsolete Fetch capability branch

The supported Control UI browser floor includes Fetch. Start attachment
metadata reads directly rather than leaving an unsupported runtime in a
permanent checking state.

Best-effort tradeoffs accepted

- Missing global Fetch: the guard originated in openclaw#64104, whose feature report
  cites no human missing-Fetch incident. An unsupported runtime that replaces
  Fetch now reaches the existing rejected-request/unavailable path. Metadata
  validation, auth/tickets, allow POST, cancellation, resource admission,
  expiry and bounded retry remain unchanged. No intended rendering change.

Unchanged lifecycle baseline: 21/21, 25.09 s. Final lifecycle and attachment
siblings: 50/50, 14.77 s. UI types, typed lint, formatting and lint-suppression
checks pass. This cut removes five production lines including formatter
reflow, bringing the lane to 223 net production lines removed.
Fresh independent P0-P2 review is scoped-clean with no actionable findings.

* fix(ui): use global frame scheduling APIs

Preserve double-frame paint timing and cancellation without requiring a Window object in renderer-free hosts that supply the standard global APIs. The existing access suite reproduces seven unhandled errors before this fix and passes on main; all 130 affected cases plus 262 timing/state/send sibling cases now pass without test changes.
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 gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: workboard proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security-sensitive-changed size: XL 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.

[Feature]: Let operators disable client file and image uploads

1 participant