Skip to content

fix(webchat): stage offloaded images for file tools - #168537

Merged
obviyus merged 4 commits into
openclaw:mainfrom
synthalorian:fix/issue-103198
Oct 13, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
synthalorian:fix/issue-103198

Conversation

@synthalorian

@synthalorian synthalorian commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #103198

What Problem This Solves

Fixes file tools being unable to find large WebChat image uploads even though the model can see the image.

User Impact

WebChat images larger than the 2,000,000-byte inline threshold are available to workspace tools as well as native vision. Small inline images retain their existing behavior; there are no new permissions or configuration settings.

Why This Change Was Made

Pass offloaded images to the same managed inbound-media staging owner already used by inline WebChat uploads and channel attachments. The staging-only copy does not hydrate a second vision image. Canonical image-reference resolution prefers a staged file over its media-store alias, including when the transcript snapshot predates staging.

The simplification removes the separate staged-image reference wrapper and a duplicate regression case. The complete PR is +30 production lines and +206 test lines against its merge base (down from +60 production/+245 tests). The remaining image reconciliation preserves the existing sandbox boundary rather than adding a WebChat-only runner path.

Thanks to @synthalorian for the fix and @woohahahaaa for the report. No overlap with Pash/Sarah changes.

Evidence

An isolated, built Gateway accepted actual chat.send image attachments over RPC. A scripted OpenAI Responses provider captured native vision input and called the real exec workspace tool. Baseline: d7ca748acba99c758ab548943642e1156fbcbbca; candidate: 8c2abc79feecaf0b959c94d292cee63fb567660c. The affected baseline files are unchanged at the PR merge base.

Input Baseline Candidate
3,147,780-byte PNG One vision image; file missing One vision image; staged file found
378-byte inline PNG One vision image; staged file found One vision image; staged file found

Observed tool output (generated IDs shortened):

baseline / large:
find: 'media/inbound': No such file or directory
(Command exited with code 1)

candidate / large:
-rw------- 1 root root 3147780 ... media/inbound/openclaw-staged-.../input-large---....png

baseline and candidate / small:
-rw------- 1 root root 378 ... media/inbound/openclaw-staged-.../input-small---....png

Both candidate turns completed with successfulToolNames: ["exec"]; captured requests contained exactly one input_image each.

Live-provider check on the same candidate: gpt-5-mini-2025-08-07 received the large image through an isolated Gateway, invoked the real exec tool, and reported media/inbound/openclaw-staged-.../input-live-large---....png. The tool output listed that file, the run completed successfully, and there were two provider requests. The test proxy selected the cheap live model instead of the mock model configured for the scripted comparison.

Focused checks in the secretless container:

  • chat-send-user-turn.test.ts: 23 passed, 38.80 seconds including compilation.
  • images.media-refs.test.ts: 12 passed, 5.23 seconds, including staged sandbox hydration from a path-less transcript fact.
  • Reverting production files to baseline makes the offloaded-image handoff regression fail (expected [] to deeply equal [...]) and the staged sandbox hydration regression fail (failedMediaCount is 1 instead of 0).
  • Changed-file Oxfmt and Oxlint passed; full runtime and Control UI build passed.

No visual UI changes; the proof uses the shipped Gateway RPC boundary.

Merge danger: two-way door; reverting restores the old attachment behavior without a schema or configuration migration. Blast radius is managed image staging and native image-reference resolution; inline-image and sandbox-hydration regressions remain covered.

@clawsweeper

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

@synthalorian

Copy link
Copy Markdown
Contributor Author

Proof: head f3eb7f752c9c633f5bc69de71cd5638a7b2af5e5

Regression: src/gateway/server-methods/chat-send-user-turn.test.ts

  • Before the fix, the vision-capable offloaded WebChat case returned an empty managed-media handoff.
  • After the fix, the full file passed 27 tests.
  • After rebase onto upstream/main 9c37dbf, the inline, offloaded, and already-prestaged cases passed (3 passed, 24 skipped).

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Oct 10, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The PR makes large WebChat image uploads available to workspace file tools while preserving one native vision input.

Example: Upload a 3,147,780-byte PNG through WebChat and ask the agent to inspect it with a workspace tool.

  • Before: The model receives one image, but the tool finds no staged file under media/inbound.
  • After: The tool finds the uploaded PNG in the managed staging directory, and the initial model request still contains exactly one image.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused, useful repair with shipped-entry runtime evidence, baseline-failing regressions, and no actionable correctness or security findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Exact-head evidence exercises an isolated built Gateway through chat.send, records actual workspace exec output for large and inline PNGs, verifies one initial vision image, and includes a live-provider tool call; earlier running-Gateway SSH sandbox evidence verifies matching bytes from a real sandboxed read.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A large WebChat image reaches native vision but lacks the staged workspace file needed by file tools.
Reason: The remaining failure is source-backed, the earlier repair identifies it explicitly, and the change restores the existing attachment contract without adding settings or permissions.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR repairs the remaining offloaded-image staging gap on current main, with relevant runtime proof and no actionable findings.

Priority: P2
Reviewed head: 8c2abc79feecaf0b959c94d292cee63fb567660c

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway attachment preparation supplies managed media facts to the existing workspace staging owner; prompt preparation reconciles those staged files with transcript image references before vision hydration.

flowchart LR
A[WebChat upload] --> B[Gateway attachment preparation]
B --> C[Managed media store]
C --> D[Inbound media staging]
D --> E[Workspace file tools]
C --> F[Native vision hydration]
D --> F
Loading

Technical review

Best possible solution:

Land the focused repair through the normal gates, retaining the existing staging owner and filesystem checks.

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

Current-main source exposes the missing staging handoff for an above-threshold upload to a vision-capable model; supplied baseline Gateway output demonstrates the missing workspace file, without this review executing target code.

Is this the best way to solve the issue?

The repair addresses the producer’s missing handoff and uses canonical staged-reference resolution instead of teaching file tools to guess an image_0 mapping.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • WebChat managed-media handoff and hydration suppression keeps the original intent (dd019ed: Expose inline uploads through the validated staging owner while retaining one original image input; offloaded access was explicitly outside that repair.)
  • Canonical media-fact reference resolution keeps the original intent (7eed2c3: Resolve structured local media references for native media preparation while retaining the existing validation boundaries.)
  • Recorder-aware image ownership keeps the original intent (5105688: Hydrate from authoritative recorder facts so stored images survive active-turn steering; the patch retains those facts and reconciles their newer staged location.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Harjoth Khara: Raw commit dd019ed adds src/gateway/server-methods/chat-send-user-turn.ts:62 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: dd019edd4c61; files: src/gateway/server-methods/chat-send-user-turn.ts)
  • Peter Steinberger: Raw commit f6818ae adds src/agents/embedded-agent-runner/run/images.media-refs.ts:39 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f6818ae5eabc; files: src/agents/embedded-agent-runner/run/images.media-refs.ts)
  • Tyler Yust: Raw commit 8d74578 adds src/agents/pi-embedded-runner/run/images.ts:155 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 8d74578ceb0c; files: src/agents/pi-embedded-runner/run/images.ts)

PR surface

Source +30, Tests +206. Total +236 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 44 14 +30
Tests 2 206 0 +206
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 250 14 +236

Review metrics

Metric Value Why it matters
Production versus test growth Production net +30 lines; tests +206 lines Production growth extends the existing handoff and reconciles staged references; tests cover the offloaded handoff, pre-staged preservation, and stale transcript snapshot.

Root-cause cluster

Relationship: same_root_cause
Canonical: #103198
Summary: The canonical issue retains the offloaded-image staging gap after the earlier inline-only repair.

Members:

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Repairs a bounded WebChat image-to-file-tool workflow, especially for sandboxed vision-capable sessions.
  • 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 (6 earlier review cycles)
  • reviewed 2026-10-10T16:59:12.132Z sha f3eb7f752c9c633f5bc69de71cd5638a7b2af5e5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T02:08:16.697Z sha 1d7ce4c :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T02:21:58.475Z sha 1d7ce4c :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T03:00:46.359Z sha 14e6823 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-13T04:05:37.528Z sha 992247f :: needs maintainer review before merge. :: none
  • reviewed 2026-10-13T04:38:38.053Z sha 8c2abc7 :: needs maintainer review before merge. :: none

Reviewed October 13, 2026, 12:44 AM ET / 04:44 UTC (Revision 7).

Vision-capable WebChat uploads above the inline threshold were saved in the media store but never handed to the existing staging owner, so file tools saw image_0 instead of the stored file.
@synthalorian

Copy link
Copy Markdown
Contributor Author

Live proof for head 1d7ce4cccba26cef57efa773b96fa8a0c1667306.

Commands:

git rev-parse HEAD
# 1d7ce4cccba26cef57efa773b96fa8a0c1667306

./node_modules/.bin/vitest run src/gateway/server-methods/chat-send-user-turn.test.ts --reporter=dot
# Test Files  1 passed (1)
# Tests  23 passed (23)

./node_modules/.bin/vitest run src/gateway/server.chat.gateway-server-chat-b.test.ts -t "duplicate attachment send wins parsing race" --reporter=verbose
# ✓ chat.send returns in_flight when duplicate attachment send wins parsing race 7132ms
# Tests  1 passed | 76 skipped (77)

PROOF_HEAD=$(git rev-parse HEAD) ./node_modules/.bin/tsx <proof script>

The proof script called the real attachment parser, prepareChatSendUserTurn, stageSandboxMedia with agents.defaults.sandbox.mode=all, and the real read tool. Temp directories are redacted as <temp>.

Previous CI failure on checks-node-changed-compact-large-11 (job 114264321174, run 38069566852):

AssertionError: expected "vi.fn()" to be called 1 times, but got 0 times
 ❯ src/gateway/server.chat.gateway-server-chat-b.test.ts:2396:42
     expect(dispatchInboundMessageMock).toHaveBeenCalledTimes(1);

That race is fixed on current main by waiting until dispatch is entered. This head includes that test, and the local rerun passed.

Stdout:

{
  "head": "1d7ce4cccba26cef57efa773b96fa8a0c1667306",
  "thresholdBytes": 2000000,
  "offloaded": {
    "inputBytes": 2100000,
    "imageOrder": ["offloaded"],
    "storedPath": "<temp>/media/inbound/photo---8e37922b-6f58-4890-8fd2-43b0cb030942.png",
    "storedSha256": "d06adbdb280b38de0c38da71d7202d9bd668df9ec2cd673b9b7ca16c91411fc7",
    "inputSha256": "d06adbdb280b38de0c38da71d7202d9bd668df9ec2cd673b9b7ca16c91411fc7",
    "bytesMatchStore": true,
    "vision": {
      "managedPaths": ["<temp>/media/inbound/photo---8e37922b-6f58-4890-8fd2-43b0cb030942.png"],
      "managedHydrationSuppressed": [true],
      "managedHydrateCount": 0,
      "promptMediaCount": 1,
      "promptHydrateCount": 1,
      "inlinePromptImageCount": 0,
      "visionInputs": 1,
      "containsImage0": false
    },
    "fileTool": {
      "requestedPath": "<temp>/media/inbound/photo---8e37922b-6f58-4890-8fd2-43b0cb030942.png",
      "cwd": "<temp>/workspace",
      "content": [
        {"type": "text", "text": "Read image file [image/png]"},
        {"type": "image", "mimeType": "image/png", "dataBytes": 2100000}
      ]
    },
    "sandbox": {
      "enabled": true,
      "mode": "all",
      "stagedPath": "media/inbound/openclaw-staged-bd7ce8d3-53bb-45f1-82f6-6071eac038e8/input-photo---8e37922b-6f58-4890-8fd2-43b0cb030942.png",
      "stagedSha256": "d06adbdb280b38de0c38da71d7202d9bd668df9ec2cd673b9b7ca16c91411fc7",
      "bytesMatchStore": true,
      "fileTool": {
        "requestedPath": "media/inbound/openclaw-staged-bd7ce8d3-53bb-45f1-82f6-6071eac038e8/input-photo---8e37922b-6f58-4890-8fd2-43b0cb030942.png",
        "cwd": "<temp>/sandboxes/workspace-33270f1e3aec5da22aaa4d517c1d94e3",
        "content": [
          {"type": "text", "text": "Read image file [image/png]"},
          {"type": "image", "mimeType": "image/png", "dataBytes": 2100000}
        ]
      },
      "image0": {
        "error": "File not found: <temp>/sandboxes/workspace-33270f1e3aec5da22aaa4d517c1d94e3/image_0."
      }
    }
  },
  "inline": {
    "inputBytes": 68,
    "imageOrder": ["inline"],
    "managedPath": "<temp>/media/inbound/dot---6dadd448-7c70-4747-8c27-1525ad17da50.png",
    "ctxPaths": ["<temp>/media/inbound/dot---6dadd448-7c70-4747-8c27-1525ad17da50.png"],
    "vision": {
      "managedPaths": ["<temp>/media/inbound/dot---6dadd448-7c70-4747-8c27-1525ad17da50.png"],
      "managedHydrationSuppressed": [true],
      "managedHydrateCount": 0,
      "promptMediaCount": 0,
      "promptHydrateCount": 0,
      "inlinePromptImageCount": 1,
      "visionInputs": 1,
      "containsImage0": false
    },
    "pluginBoundCount": 1,
    "fileTool": {
      "requestedPath": "<temp>/media/inbound/dot---6dadd448-7c70-4747-8c27-1525ad17da50.png",
      "content": [
        {"type": "text", "text": "Read image file [image/png]"},
        {"type": "image", "mimeType": "image/png", "dataBytes": 68}
      ]
    }
  },
  "prestaged": {
    "pluginBoundCount": 0,
    "ctxPaths": ["<temp>/already-staged/attachment-1.png"],
    "keptPrestagedPath": true,
    "ctxHydrateCount": 1,
    "fileTool": {
      "requestedPath": "<temp>/already-staged/attachment-1.png",
      "content": [
        {"type": "text", "text": "Read image file [image/png]"},
        {"type": "image", "mimeType": "image/png", "dataBytes": 68}
      ]
    }
  }
}

@synthalorian

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 13, 2026
@synthalorian

Copy link
Copy Markdown
Contributor Author

Follow-up proof on the same head 1d7ce4cccba26cef57efa773b96fa8a0c1667306, through the shipped Gateway chat.send handler.

Command:

./node_modules/.bin/vitest run src/gateway/server.chat.gateway-server-chat-b.test.ts -t "hands an above-threshold WebChat image" --reporter=verbose

Result: ✓ chat.send hands an above-threshold WebChat image to the read tool 5820ms (1 passed, 77 skipped).

The call used coreGatewayHandlers["chat.send"], a Control UI WebChat client, and a vision model. Temp home paths are redacted as <temp>.

Stdout:

PROOF_JSON {
  "entry": "coreGatewayHandlers chat.send",
  "client": "control-ui webchat",
  "inputBytes": 2100000,
  "mediaPath": "<temp>/.openclaw/media/inbound/photo---1f0af41e-217c-4be9-b340-1138c2d18c39.png",
  "bytesMatch": true,
  "sha256": "d06adbdb280b38de0c38da71d7202d9bd668df9ec2cd673b9b7ca16c91411fc7",
  "hydrationSuppressed": true,
  "promptImages": 0,
  "promptMedia": 1,
  "managedHydrate": 0,
  "sandboxMode": "all",
  "stagedPath": "media/inbound/openclaw-staged-219f13ae-526f-4d1a-bcd1-5c8d3c3f6f69/input-photo---1f0af41e-217c-4be9-b340-1138c2d18c39.png",
  "readTool": [
    {"type": "text", "text": "Read image file [image/png]"},
    {"type": "image", "mimeType": "image/png", "dataBytes": 2100000}
  ],
  "stagedRead": [
    {"type": "text", "text": "Read image file [image/png]"},
    {"type": "image", "mimeType": "image/png", "dataBytes": 2100000}
  ],
  "image0": "File not found: <temp>/.openclaw-test/proof-sandboxes/workspace-bbbf097fe4a0a819f0296a7fcd0f4f1c/image_0."
}

chat.send stored the 2,100,000-byte image and put that media-store path on the dispatch context. Sandbox mode all staged a copy with the same bytes. The real read tool consumed both paths. The managed copy stayed hydration-suppressed, so the turn kept one prompt media input. The gateway suite still stubs the model dispatch, so this read was executed with the path chat.send handed over rather than by a live model tool call.

@synthalorian

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Sandbox vision was following the media URI from the transcript snapshot, which is not a file inside the sandbox. Use the staged workspace path as the single vision input.
@synthalorian

Copy link
Copy Markdown
Contributor Author

Running Gateway proof on head 14e68232cde9b97ee634c5dbc0cc8f9cec374763.

Docker was not usable here (/var/run/docker.sock is root:docker and passwordless sudo is unavailable). The sandbox is the built-in SSH backend, mode=all, against an unprivileged sshd on 127.0.0.1:22222. The gateway process is node scripts/run-node.mjs gateway run with an isolated state dir. The model is a local deterministic OpenAI Responses fixture. The WebChat client called chat.send with a real 2,431,757-byte PNG, then agent.wait. The read tool executed inside that sandbox; it was not invoked by the proof script.

Stdout excerpt:

PROOF_JSON {
  "head": "14e68232cde9b97ee634c5dbc0cc8f9cec374763",
  "entry": "gateway run + webchat chat.send",
  "client": "webchat",
  "sandbox": "ssh mode=all",
  "inputBytes": 2431757,
  "inputSha256": "bd53f4286967f7da5c8677030ba60c4cb0f345d175f828b6eaccaff6fd7fcc70",
  "chatSend": {"runId": "proof-offloaded-2d3a47fe-3a7c-48ad-9202-436a3960ea3c", "status": "started"},
  "agentWait": {
    "status": "ok",
    "terminalReceipt": {
      "successfulToolNames": ["read"],
      "terminalDisposition": "visible"
    },
    "terminalReply": {"disposition": "visible", "text": "sandboxed read complete"}
  },
  "providerImageCounts": [1, 2],
  "initialVisionInputs": 1,
  "imageLoadFailureNotice": false,
  "readPath": "media/inbound/openclaw-staged-184960a1-b048-48d9-a1e8-da48431fa2eb/input-photo---a2f879cd-cb7a-4545-8d45-19ca37d9d0f2.png",
  "toolImageBytes": [2431757],
  "toolImageSha256": ["bd53f4286967f7da5c8677030ba60c4cb0f345d175f828b6eaccaff6fd7fcc70"],
  "stagedFiles": ["2431757 <temp>/sandbox-root/openclaw-ssh-workspace-4c2c864751aa273832493a9f1f68ee42/workspace/media/inbound/openclaw-staged-184960a1-b048-48d9-a1e8-da48431fa2eb/input-photo---a2f879cd-cb7a-4545-8d45-19ca37d9d0f2.png"]
}

The first provider request contained one input_image and no "could not be loaded" note. providerImageCounts[1] === 2 is the follow-up after the sandboxed read: the original prompt image plus the tool image. The read path is the staged sandbox file, not image_0, and its SHA-256 matches the upload.

@synthalorian

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M and removed size: S labels Oct 13, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 13, 2026
Typecheck and lint failed because MediaImageRef was imported and never read.
@synthalorian

Copy link
Copy Markdown
Contributor Author

CI on 14e68232cde9b97ee634c5dbc0cc8f9cec374763 failed before the gate. First real error, from check-lint-core-2 and every typecheck shard:

src/agents/embedded-agent-runner/run/images.ts:46:8: error: Type 'MediaImageRef' is imported but never used. (eslint(no-unused-vars))
src/agents/embedded-agent-runner/run/images.ts(46,8): error TS6133: 'MediaImageRef' is declared but its value is never read.

build-artifacts also reported extensions/workboard/openclaw.plugin.json differed from a fresh plugin-asset build. That file is unchanged on this branch, and node --import ./scripts/tsx.mjs scripts/bundled-plugin-assets.mts --phase build --check matches the committed bytes locally.

New head: 992247f82b0b71b49344a4eadc0f5766f3bebd4c. It only removes the unused import. The gateway proof behavior is unchanged, so this does not request another ClawSweeper review. CI for this head has not finished.

@obviyus

obviyus commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Oct 13, 2026
@obviyus
obviyus merged commit 5c69645 into openclaw:main Oct 13, 2026
133 of 136 checks passed
@obviyus

obviyus commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Landed in 5c69645. Thanks @synthalorian! Verified on a built Gateway: large WebChat images are now staged where workspace tools can read them, and vision still gets one copy.

RomneyDa added a commit that referenced this pull request Oct 13, 2026
* improve: simplify workspace and memory plugin messages

* test(reef): match stored-key generation diagnostic

* fix(webchat): stage offloaded images for file tools (#168537)

fix(webchat): stage offloaded WebChat images into the managed workspace

WebChat images above the inline threshold reached vision input but were not handed to managed workspace staging, so file tools couldn't find them. Offloaded WebChat images now expose their media-store path for staging, path-less transcript images hydrate from the staged sandbox copy, and images already staged are not staged again. Vision still receives exactly one image.

Proof: built Gateway chat.send with a 3,147,780-byte PNG: on main the image reached vision but exec found no staged file; on the candidate exec finds the staged PNG. A 378-byte inline image works the same on both. A live gpt-5-mini turn also found the staged image through exec.

Thanks @synthalorian.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(gateway): retain model lists across skills refreshes

Configuration publications refresh skills because skills can depend on arbitrary
config paths. Reuse the published model-list cache when the existing catalog
facts still match, while rebuilding commands and other skill-dependent metadata.
Model, auth, plugin, catalog and owner changes keep their existing invalidation
and read-authority boundaries.

Fixes the repeated projection work exposed by 877301a (#170341): scheduled
main run 38339144048 rebuilt model lists after each of six UI preference writes.
The prepared-model regression also reproduced the unnecessary second projection
before this change. Preserve the original integration assertion and verify that
skills-dependent commands refresh alongside retained model projections.

Validation: prepared-model regression fails before the repair and passes after
(2/2 tests; 257.74s on the loaded host). Targeted lint, formatting and diff checks
pass. Independent Codex review completed with no actionable findings. The full
Gateway freshness integration remains assigned to canonical CI.

* test(gateway): resolve auth-policy session targets in workers

The synchronous fixture lookup could create a database after a Gateway
worker captured its absence, triggering the physical identity guard and
closing admission before the initial turn. Use existing read-only worker
discovery for both fixture targets, matching neighboring authority tests.

Preserve all retained and revoked grant, final-write, and transcript
assertions. No production guard or authorization behavior changes.

* fix(plugins): retain inspected config for decision diagnostics

Plugin inspection resolved the explicitly supplied config, then discarded
it while projecting decision providers and consulted the runtime snapshot
instead. Cold inspection could fail with an unprepared runtime config; a
prepared but different runtime could also report the wrong configured model.

Carry the resolved config through the existing inspection context. Cover
single and all-plugin inspection with different explicit and ambient models.
Plugin loading, decision execution, and lifecycle ownership are unchanged.

Original ambient-config lookup: cde6bbd (#152237), exposed by
7e48efb (#169714). Scheduled main 38334375513 repeats nine
trust-diagnostics failures.

Focused proof: loader.trust-diagnostics 11/11 and status 9/9 passed.
The two new cases take 29ms and 15ms; loaded-host wrapper wall 1794.74s
is dominated by worker build and module transforms. Independent review
found no actionable defects.

* fix: allow test builds in containers without systemd (#170640)

---------

Co-authored-by: synth <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 13, 2026
* improve: simplify gateway, protocol, and security diagnostics

* fix(webchat): stage offloaded images for file tools (#168537)

fix(webchat): stage offloaded WebChat images into the managed workspace

WebChat images above the inline threshold reached vision input but were not handed to managed workspace staging, so file tools couldn't find them. Offloaded WebChat images now expose their media-store path for staging, path-less transcript images hydrate from the staged sandbox copy, and images already staged are not staged again. Vision still receives exactly one image.

Proof: built Gateway chat.send with a 3,147,780-byte PNG: on main the image reached vision but exec found no staged file; on the candidate exec finds the staged PNG. A 378-byte inline image works the same on both. A live gpt-5-mini turn also found the staged image through exec.

Thanks @synthalorian.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(gateway): retain model lists across skills refreshes

Configuration publications refresh skills because skills can depend on arbitrary
config paths. Reuse the published model-list cache when the existing catalog
facts still match, while rebuilding commands and other skill-dependent metadata.
Model, auth, plugin, catalog and owner changes keep their existing invalidation
and read-authority boundaries.

Fixes the repeated projection work exposed by 877301a (#170341): scheduled
main run 38339144048 rebuilt model lists after each of six UI preference writes.
The prepared-model regression also reproduced the unnecessary second projection
before this change. Preserve the original integration assertion and verify that
skills-dependent commands refresh alongside retained model projections.

Validation: prepared-model regression fails before the repair and passes after
(2/2 tests; 257.74s on the loaded host). Targeted lint, formatting and diff checks
pass. Independent Codex review completed with no actionable findings. The full
Gateway freshness integration remains assigned to canonical CI.

* test(gateway): resolve auth-policy session targets in workers

The synchronous fixture lookup could create a database after a Gateway
worker captured its absence, triggering the physical identity guard and
closing admission before the initial turn. Use existing read-only worker
discovery for both fixture targets, matching neighboring authority tests.

Preserve all retained and revoked grant, final-write, and transcript
assertions. No production guard or authorization behavior changes.

* fix(plugins): retain inspected config for decision diagnostics

Plugin inspection resolved the explicitly supplied config, then discarded
it while projecting decision providers and consulted the runtime snapshot
instead. Cold inspection could fail with an unprepared runtime config; a
prepared but different runtime could also report the wrong configured model.

Carry the resolved config through the existing inspection context. Cover
single and all-plugin inspection with different explicit and ambient models.
Plugin loading, decision execution, and lifecycle ownership are unchanged.

Original ambient-config lookup: cde6bbd (#152237), exposed by
7e48efb (#169714). Scheduled main 38334375513 repeats nine
trust-diagnostics failures.

Focused proof: loader.trust-diagnostics 11/11 and status 9/9 passed.
The two new cases take 29ms and 15ms; loaded-host wrapper wall 1794.74s
is dominated by worker build and module transforms. Independent review
found no actionable defects.

* fix: allow test builds in containers without systemd (#170640)

---------

Co-authored-by: synth <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 13, 2026
* improve: simplify agent, exec, and automation messages

* fix(webchat): stage offloaded images for file tools (#168537)

fix(webchat): stage offloaded WebChat images into the managed workspace

WebChat images above the inline threshold reached vision input but were not handed to managed workspace staging, so file tools couldn't find them. Offloaded WebChat images now expose their media-store path for staging, path-less transcript images hydrate from the staged sandbox copy, and images already staged are not staged again. Vision still receives exactly one image.

Proof: built Gateway chat.send with a 3,147,780-byte PNG: on main the image reached vision but exec found no staged file; on the candidate exec finds the staged PNG. A 378-byte inline image works the same on both. A live gpt-5-mini turn also found the staged image through exec.

Thanks @synthalorian.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(gateway): retain model lists across skills refreshes

Configuration publications refresh skills because skills can depend on arbitrary
config paths. Reuse the published model-list cache when the existing catalog
facts still match, while rebuilding commands and other skill-dependent metadata.
Model, auth, plugin, catalog and owner changes keep their existing invalidation
and read-authority boundaries.

Fixes the repeated projection work exposed by 877301a (#170341): scheduled
main run 38339144048 rebuilt model lists after each of six UI preference writes.
The prepared-model regression also reproduced the unnecessary second projection
before this change. Preserve the original integration assertion and verify that
skills-dependent commands refresh alongside retained model projections.

Validation: prepared-model regression fails before the repair and passes after
(2/2 tests; 257.74s on the loaded host). Targeted lint, formatting and diff checks
pass. Independent Codex review completed with no actionable findings. The full
Gateway freshness integration remains assigned to canonical CI.

* test(gateway): resolve auth-policy session targets in workers

The synchronous fixture lookup could create a database after a Gateway
worker captured its absence, triggering the physical identity guard and
closing admission before the initial turn. Use existing read-only worker
discovery for both fixture targets, matching neighboring authority tests.

Preserve all retained and revoked grant, final-write, and transcript
assertions. No production guard or authorization behavior changes.

* fix(plugins): retain inspected config for decision diagnostics

Plugin inspection resolved the explicitly supplied config, then discarded
it while projecting decision providers and consulted the runtime snapshot
instead. Cold inspection could fail with an unprepared runtime config; a
prepared but different runtime could also report the wrong configured model.

Carry the resolved config through the existing inspection context. Cover
single and all-plugin inspection with different explicit and ambient models.
Plugin loading, decision execution, and lifecycle ownership are unchanged.

Original ambient-config lookup: cde6bbd (#152237), exposed by
7e48efb (#169714). Scheduled main 38334375513 repeats nine
trust-diagnostics failures.

Focused proof: loader.trust-diagnostics 11/11 and status 9/9 passed.
The two new cases take 29ms and 15ms; loaded-host wrapper wall 1794.74s
is dominated by worker build and module transforms. Independent review
found no actionable defects.

* fix: allow test builds in containers without systemd (#170640)

---------

Co-authored-by: synth <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
fix(webchat): stage offloaded WebChat images into the managed workspace

WebChat images above the inline threshold reached vision input but were not handed to managed workspace staging, so file tools couldn't find them. Offloaded WebChat images now expose their media-store path for staging, path-less transcript images hydrate from the staged sandbox copy, and images already staged are not staged again. Vision still receives exactly one image.

Proof: built Gateway chat.send with a 3,147,780-byte PNG: on main the image reached vision but exec found no staged file; on the candidate exec finds the staged PNG. A 378-byte inline image works the same on both. A live gpt-5-mini turn also found the staged image through exec.

Thanks @synthalorian.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
* improve: simplify workspace and memory plugin messages

* test(reef): match stored-key generation diagnostic

* fix(webchat): stage offloaded images for file tools (openclaw#168537)

fix(webchat): stage offloaded WebChat images into the managed workspace

WebChat images above the inline threshold reached vision input but were not handed to managed workspace staging, so file tools couldn't find them. Offloaded WebChat images now expose their media-store path for staging, path-less transcript images hydrate from the staged sandbox copy, and images already staged are not staged again. Vision still receives exactly one image.

Proof: built Gateway chat.send with a 3,147,780-byte PNG: on main the image reached vision but exec found no staged file; on the candidate exec finds the staged PNG. A 378-byte inline image works the same on both. A live gpt-5-mini turn also found the staged image through exec.

Thanks @synthalorian.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(gateway): retain model lists across skills refreshes

Configuration publications refresh skills because skills can depend on arbitrary
config paths. Reuse the published model-list cache when the existing catalog
facts still match, while rebuilding commands and other skill-dependent metadata.
Model, auth, plugin, catalog and owner changes keep their existing invalidation
and read-authority boundaries.

Fixes the repeated projection work exposed by 044ae43 (openclaw#170341): scheduled
main run 38339144048 rebuilt model lists after each of six UI preference writes.
The prepared-model regression also reproduced the unnecessary second projection
before this change. Preserve the original integration assertion and verify that
skills-dependent commands refresh alongside retained model projections.

Validation: prepared-model regression fails before the repair and passes after
(2/2 tests; 257.74s on the loaded host). Targeted lint, formatting and diff checks
pass. Independent Codex review completed with no actionable findings. The full
Gateway freshness integration remains assigned to canonical CI.

* test(gateway): resolve auth-policy session targets in workers

The synchronous fixture lookup could create a database after a Gateway
worker captured its absence, triggering the physical identity guard and
closing admission before the initial turn. Use existing read-only worker
discovery for both fixture targets, matching neighboring authority tests.

Preserve all retained and revoked grant, final-write, and transcript
assertions. No production guard or authorization behavior changes.

* fix(plugins): retain inspected config for decision diagnostics

Plugin inspection resolved the explicitly supplied config, then discarded
it while projecting decision providers and consulted the runtime snapshot
instead. Cold inspection could fail with an unprepared runtime config; a
prepared but different runtime could also report the wrong configured model.

Carry the resolved config through the existing inspection context. Cover
single and all-plugin inspection with different explicit and ambient models.
Plugin loading, decision execution, and lifecycle ownership are unchanged.

Original ambient-config lookup: 0a54fc6 (openclaw#152237), exposed by
5dbf215 (openclaw#169714). Scheduled main 38334375513 repeats nine
trust-diagnostics failures.

Focused proof: loader.trust-diagnostics 11/11 and status 9/9 passed.
The two new cases take 29ms and 15ms; loaded-host wrapper wall 1794.74s
is dominated by worker build and module transforms. Independent review
found no actionable defects.

* fix: allow test builds in containers without systemd (openclaw#170640)

---------

Co-authored-by: synth <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
* improve: simplify gateway, protocol, and security diagnostics

* fix(webchat): stage offloaded images for file tools (openclaw#168537)

fix(webchat): stage offloaded WebChat images into the managed workspace

WebChat images above the inline threshold reached vision input but were not handed to managed workspace staging, so file tools couldn't find them. Offloaded WebChat images now expose their media-store path for staging, path-less transcript images hydrate from the staged sandbox copy, and images already staged are not staged again. Vision still receives exactly one image.

Proof: built Gateway chat.send with a 3,147,780-byte PNG: on main the image reached vision but exec found no staged file; on the candidate exec finds the staged PNG. A 378-byte inline image works the same on both. A live gpt-5-mini turn also found the staged image through exec.

Thanks @synthalorian.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(gateway): retain model lists across skills refreshes

Configuration publications refresh skills because skills can depend on arbitrary
config paths. Reuse the published model-list cache when the existing catalog
facts still match, while rebuilding commands and other skill-dependent metadata.
Model, auth, plugin, catalog and owner changes keep their existing invalidation
and read-authority boundaries.

Fixes the repeated projection work exposed by 044ae43 (openclaw#170341): scheduled
main run 38339144048 rebuilt model lists after each of six UI preference writes.
The prepared-model regression also reproduced the unnecessary second projection
before this change. Preserve the original integration assertion and verify that
skills-dependent commands refresh alongside retained model projections.

Validation: prepared-model regression fails before the repair and passes after
(2/2 tests; 257.74s on the loaded host). Targeted lint, formatting and diff checks
pass. Independent Codex review completed with no actionable findings. The full
Gateway freshness integration remains assigned to canonical CI.

* test(gateway): resolve auth-policy session targets in workers

The synchronous fixture lookup could create a database after a Gateway
worker captured its absence, triggering the physical identity guard and
closing admission before the initial turn. Use existing read-only worker
discovery for both fixture targets, matching neighboring authority tests.

Preserve all retained and revoked grant, final-write, and transcript
assertions. No production guard or authorization behavior changes.

* fix(plugins): retain inspected config for decision diagnostics

Plugin inspection resolved the explicitly supplied config, then discarded
it while projecting decision providers and consulted the runtime snapshot
instead. Cold inspection could fail with an unprepared runtime config; a
prepared but different runtime could also report the wrong configured model.

Carry the resolved config through the existing inspection context. Cover
single and all-plugin inspection with different explicit and ambient models.
Plugin loading, decision execution, and lifecycle ownership are unchanged.

Original ambient-config lookup: 0a54fc6 (openclaw#152237), exposed by
5dbf215 (openclaw#169714). Scheduled main 38334375513 repeats nine
trust-diagnostics failures.

Focused proof: loader.trust-diagnostics 11/11 and status 9/9 passed.
The two new cases take 29ms and 15ms; loaded-host wrapper wall 1794.74s
is dominated by worker build and module transforms. Independent review
found no actionable defects.

* fix: allow test builds in containers without systemd (openclaw#170640)

---------

Co-authored-by: synth <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
* improve: simplify agent, exec, and automation messages

* fix(webchat): stage offloaded images for file tools (openclaw#168537)

fix(webchat): stage offloaded WebChat images into the managed workspace

WebChat images above the inline threshold reached vision input but were not handed to managed workspace staging, so file tools couldn't find them. Offloaded WebChat images now expose their media-store path for staging, path-less transcript images hydrate from the staged sandbox copy, and images already staged are not staged again. Vision still receives exactly one image.

Proof: built Gateway chat.send with a 3,147,780-byte PNG: on main the image reached vision but exec found no staged file; on the candidate exec finds the staged PNG. A 378-byte inline image works the same on both. A live gpt-5-mini turn also found the staged image through exec.

Thanks @synthalorian.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(gateway): retain model lists across skills refreshes

Configuration publications refresh skills because skills can depend on arbitrary
config paths. Reuse the published model-list cache when the existing catalog
facts still match, while rebuilding commands and other skill-dependent metadata.
Model, auth, plugin, catalog and owner changes keep their existing invalidation
and read-authority boundaries.

Fixes the repeated projection work exposed by 044ae43 (openclaw#170341): scheduled
main run 38339144048 rebuilt model lists after each of six UI preference writes.
The prepared-model regression also reproduced the unnecessary second projection
before this change. Preserve the original integration assertion and verify that
skills-dependent commands refresh alongside retained model projections.

Validation: prepared-model regression fails before the repair and passes after
(2/2 tests; 257.74s on the loaded host). Targeted lint, formatting and diff checks
pass. Independent Codex review completed with no actionable findings. The full
Gateway freshness integration remains assigned to canonical CI.

* test(gateway): resolve auth-policy session targets in workers

The synchronous fixture lookup could create a database after a Gateway
worker captured its absence, triggering the physical identity guard and
closing admission before the initial turn. Use existing read-only worker
discovery for both fixture targets, matching neighboring authority tests.

Preserve all retained and revoked grant, final-write, and transcript
assertions. No production guard or authorization behavior changes.

* fix(plugins): retain inspected config for decision diagnostics

Plugin inspection resolved the explicitly supplied config, then discarded
it while projecting decision providers and consulted the runtime snapshot
instead. Cold inspection could fail with an unprepared runtime config; a
prepared but different runtime could also report the wrong configured model.

Carry the resolved config through the existing inspection context. Cover
single and all-plugin inspection with different explicit and ambient models.
Plugin loading, decision execution, and lifecycle ownership are unchanged.

Original ambient-config lookup: 0a54fc6 (openclaw#152237), exposed by
5dbf215 (openclaw#169714). Scheduled main 38334375513 repeats nine
trust-diagnostics failures.

Focused proof: loader.trust-diagnostics 11/11 and status 9/9 passed.
The two new cases take 29ms and 15ms; loaded-host wrapper wall 1794.74s
is dominated by worker build and module transforms. Independent review
found no actionable defects.

* fix: allow test builds in containers without systemd (openclaw#170640)

---------

Co-authored-by: synth <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime 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: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: WebChat image attachments not mapped to media store path — image tool receives "image_0" instead of real file path

2 participants