Skip to content

fix(gateway): render codex inline media once - #75727

Closed
Ittiz wants to merge 5 commits into
openclaw:mainfrom
Ittiz:main
Closed

Ittiz wants to merge 5 commits into
openclaw:mainfrom
Ittiz:main

Conversation

@Ittiz

@Ittiz Ittiz commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Problem: Codex-harness replies that emitted local MEDIA: image directives could fail to become trusted outgoing media, leaving inline images text-only or unavailable to WebChat/Control UI.
  • Why it matters: Agents using the Codex harness should be able to return generated/local images inline without requiring channel-specific manual workarounds, and users should not see duplicate assistant turns for one image reply.
  • What changed: Trust structured local media markers from non-external tool results, while preserving the existing registered-tool trust checks; replace the latest raw assistant MEDIA: transcript turn with the normalized media-bearing message instead of appending a second assistant image turn.
  • What did NOT change (scope boundary): This does not change external MCP tool trust, local media root serving checks, model prompting, ComfyUI plugin behavior, or any provider/network API.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • This PR fixes a bug or regression

No matching upstream issue was found. Searches checked: inline image, inline media, Codex harness image, MEDIA: image, assistant-media, managed media, Control UI image, and duplicate image/WebChat terms.

Root Cause (if applicable)

  • Root cause: The Codex/AppServer path can persist the model-authored assistant reply as raw text containing MEDIA:<local path> while the gateway reply payload carries the parsed/normalized media URL. The WebChat transcript bridge treated those as separate assistant replies and appended the normalized media message after the raw directive turn.
  • Missing detection / guardrail: Existing media tests covered parsing and directive stripping, but did not cover the Codex/AppServer split where the raw transcript text and normalized media payload represent the same reply.
  • Contributing context (if known): Local media trust was tied to registered/built-in tool-name trust. Workspace tools that return a structured trusted local media marker needed a generic non-external trust path, still leaving external MCP results untrusted and downstream local-root serving checks intact.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file:
    • src/agents/pi-embedded-subscribe.tools.media.test.ts
    • src/gateway/server-methods/chat.directive-tags.test.ts
  • Scenario the test should lock in:
    • Non-external structured trustedLocalMedia tool results keep local media URLs, while external tool results with the same marker do not.
    • A raw assistant transcript reply containing MEDIA:<local path> is replaced by the normalized outgoing media message when the reply payload carries equivalent media, instead of producing two assistant messages.
  • Why this is the smallest reliable guardrail: These tests hit the two affected seams directly: tool-result media trust filtering and WebChat transcript persistence/replacement.
  • Existing test that already covers this (if any): Existing directive/media tests covered stripping MEDIA: directives into outgoing media blocks, but not replacement of a raw persisted Codex/AppServer assistant turn.
  • If no new test is added, why not: N/A; new regression coverage is included.

User-visible / Behavior Changes

Codex-harness agents can render trusted local image replies inline in WebChat/Control UI without leaving a raw MEDIA: line behind or showing a duplicate text-plus-image assistant reply.

Diagram (if applicable)

Before:
[Codex assistant MEDIA reply] -> [raw transcript assistant text]
                              -> [gateway normalized media reply appended]
                              -> [duplicate assistant turns]

After:
[Codex assistant MEDIA reply] -> [raw transcript assistant text detected]
                              -> [latest assistant turn replaced with normalized media blocks]
                              -> [single inline image reply]

Security Impact (required)

  • New permissions/capabilities? (Yes/No): No
  • Secrets/tokens handling changed? (Yes/No): No
  • New/changed network calls? (Yes/No): No
  • Command/tool execution surface changed? (Yes/No): No
  • Data access scope changed? (Yes/No): No
  • If any Yes, explain risk + mitigation: N/A

Security notes:

  • Structured local media trust is ignored for external MCP tool results.
  • Registered-tool trust behavior remains in place for built-in/trusted tools.
  • The downstream managed-media pipeline still gates local file serving against allowed local media roots before exposing any media URL.

Repro + Verification

Environment

  • OS: Linux local development workspace; Windows gateway hot-patch was separately smoke-tested before PR preparation.
  • Runtime/container: Node local workspace.
  • Model/provider: Codex harness path observed with gpt-5.5 during manual smoke testing.
  • Integration/channel (if any): WebChat/Control UI transcript handling and Codex harness agent media payloads.
  • Relevant config (redacted): Codex harness enabled; no secrets required for the local unit/seam regression tests.

Steps

  1. Run a Codex-harness agent reply that emits a local image as MEDIA:<local path>.
  2. Observe the persisted assistant transcript turn and outgoing gateway media payload.
  3. Open WebChat/Control UI for the same session.

Expected

  • The reply appears once as an inline image-bearing assistant message.
  • The raw MEDIA: directive is not shown to the user.
  • Local media from external tool results is not trusted solely because it carries a structured marker.

Actual

  • Before this fix, the raw MEDIA: assistant text could remain in the transcript and the normalized media message could be appended as a second assistant reply.
  • Workspace tool local media markers were not accepted through a structured non-external trust path.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Passing local verification on the rebased branch:

node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo
# passed

node scripts/run-tsgo.mjs -p tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfo
# passed

node scripts/test-projects.mjs src/agents/pi-embedded-subscribe.tools.media.test.ts
# 42 passed

OPENCLAW_GATEWAY_PROJECT_SHARDS=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/chat.directive-tags.test.ts
# 132 passed

Human Verification (required)

  • Verified scenarios:
    • Rebased the fix onto current openclaw/openclaw main.
    • Verified the agent media trust tests pass.
    • Verified the gateway directive/WebChat media transcript tests pass.
    • Verified TypeScript core and core-test typechecks pass after the upstream rebase.
    • Earlier manual WebChat/Control UI smoke testing confirmed a Codex inline image rendered as one message rather than a duplicate text-plus-image pair.
  • Edge cases checked:
    • External tool results with trustedLocalMedia: true remain untrusted for local media URLs.
    • Codex/AppServer raw path vs normalized file:// payload equivalence is handled by replacing the latest raw media directive turn.
  • What you did not verify:
    • Full pnpm build after the rebase, because this local shell did not have pnpm on PATH; targeted tests and core typecheck were run directly with repository scripts.
    • Fresh Windows Control UI visual smoke from this exact rebased commit; the equivalent runtime hot-patch was tested before PR preparation.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

N/A for initial PR submission.

Compatibility / Migration

  • Backward compatible? (Yes/No): Yes
  • Config/env changes? (Yes/No): No
  • Migration needed? (Yes/No): No
  • If yes, exact upgrade steps: N/A

Risks and Mitigations

  • Risk: Replacing the latest assistant transcript turn could hide an unrelated prior assistant message if detection is too broad.
    • Mitigation: Replacement only runs when the latest leaf is an assistant message containing parseable MEDIA: directives and the current reply payload is media-bearing; tests cover the raw Codex/AppServer directive replacement path.
  • Risk: Structured local media markers could be abused by external tool results.
    • Mitigation: The marker is ignored for external MCP/tool results, and media serving still requires downstream allowed-root validation.

Real behavior proof

  • Behavior or issue addressed: Codex/AppServer replies that emit a raw MEDIA:<local path> image now normalize into the existing assistant transcript turn instead of leaving raw MEDIA text and appending a duplicate gateway-injected media reply. Current head tested: fede70512ea83677a9c79bd7530bf6865818125f.
  • Real environment tested: Local OpenClaw PR checkout on Linux, Node v24.13.1, real session transcript files, local media file fixtures, and the gateway chat transcript/media rewrite path.
  • Exact steps or command run after this patch: From the PR checkout after applying the ClawSweeper review fixes, ran git diff --check, PATH=/tmp/openclaw-corepack-bin:$PATH CI=true timeout 300s pnpm test src/gateway/server-methods/chat.directive-tags.test.ts, and node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/chat.directive-tags.test.ts.
  • Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output):
$ PATH=/tmp/openclaw-corepack-bin:$PATH CI=true timeout 300s pnpm test src/gateway/server-methods/chat.directive-tags.test.ts
$ node scripts/test-projects.mjs src/gateway/server-methods/chat.directive-tags.test.ts
[test] starting test/vitest/vitest.gateway.config.ts

 RUN  v4.1.6 /tmp/openclaw-pr-resolve-20260517

 Test Files  1 passed (1)
      Tests  77 passed (77)
   Start at  00:34:46
   Duration  12.92s (transform 2.53s, setup 291ms, import 6.75s, tests 5.52s, environment 0ms)

$ node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/chat.directive-tags.test.ts\n\n RUN  v4.1.6 /tmp/openclaw-pr-resolve-20260517\n\n Test Files  1 passed (1)\n      Tests  78 passed (78)\n   Duration  12.41s\n\n[test] passed 1 Vitest shard in 23.72s
  • Observed result after fix: The focused gateway transcript/media suite passed on current head, including the new parser-parity regression for an unquoted local MEDIA path containing spaces, coverage that preserves captions while stripping raw MEDIA: directives, refuses to rewrite an older matching media turn after a newer assistant turn, and avoids a second message-level transcript update after the file-level rewrite event. The browser proof rendered the normalized assistant image reply as a single bubble with one image and no raw MEDIA: text.
    Browser-rendered Control UI proof on current head:
$ node --input-type=module <Playwright proof runner>
{
  "screenshotPath": "/home/daein/.openclaw/workspace/logs/pr-watch/75727-ui-proof-2ce0267.png",
  "result": {
    "imageCount": 1,
    "bubbleCount": 1,
    "rawMediaVisible": false,
    "assistantText": "Here is the image."
  }
}

Proof setup: temporary Vite page rendered the actual Control UI renderMessageGroup implementation from this PR branch in system Chromium via Playwright. The message shape matched the normalized gateway result after the raw MEDIA transcript turn is replaced: one assistant text block plus one input_image content block, with no MEDIA directive left in visible text.

  • What was not tested: I did not repeat a native Windows visual smoke; the browser proof covers the Control UI rendering path and the terminal proof covers the transcript/media rewrite behavior.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: M labels May 1, 2026
@clawsweeper

clawsweeper Bot commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed July 3, 2026, 5:27 AM ET / 09:27 UTC.

Summary
The PR replaces raw Codex/AppServer MEDIA: assistant transcript turns with normalized WebChat media messages, strips managed outgoing image blocks from provider replay, and includes SDK/release-script test/tooling fixes.

PR surface: Source +493, Tests +521, Other -1. Total +1013 across 9 files.

Reproducibility: yes. source-level: current main and latest releases still append a gateway-injected :assistant-media message while Codex/AppServer assistant output is text-only, so raw MEDIA: plus normalized media can become duplicate WebChat messages.

Review metrics: 3 noteworthy metrics.

  • PR Surface: +1053/-40 across 9 files. The fix touches gateway, agent replay/media trust, SDK tests, and release-script tests, so maintainers need more than diff-only review.
  • Merge State: mergeable=false, mergeable_state=dirty. A dirty head means the reviewed patch is not the final merge result.
  • Out-of-scope Drift: 3 non-gateway/media files affected. The SDK package test and cross-OS release-check files are outside the stated WebChat/Codex media bug path.

Stored data model
Persistent data-model change detected: serialized state: src/agents/embedded-agent-runner/replay-history.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦞 diamond lobster
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Forward params.cfg to the new transcript rewrite call.
  • Restack the dirty PR head on current main and refresh the proof for that exact head.
  • [P2] Drop or separately justify the SDK/release-script drift if it is not required for the media fix.

Proof path suggestion
A visible browser check would materially help after the restack because the user-facing result is exactly one inline image reply with no raw MEDIA text. Mantis is currently scoped to Telegram, Discord, and web UI chat proof, so it is not the right proof path for this surface.
Use maintainer screenshot/manual proof, browser or Playwright proof, Crabbox where appropriate, or normal local artifact proof instead.

Risk before merge

  • [P2] The new raw MEDIA replacement path currently ignores configured session write-lock timeout/stale settings because it drops params.cfg before calling the transcript rewrite seam.
  • [P1] GitHub reports the current PR head as dirty/non-mergeable, so the actual merged code path cannot be treated as reviewed until the branch is restacked.
  • [P1] The PR rewrites persisted assistant transcript entries and changes whether media-bearing replies are appended or replaced, so it remains compatibility, session-state, and message-delivery sensitive even with focused tests.
  • [P1] The SDK package test and cross-OS release-script changes are outside the gateway/media fix and should be dropped or separately justified during restack.

Maintainer options:

  1. Patch And Restack The Transcript Rewrite (recommended)
    Forward the caller config into the new rewrite call, resolve the dirty merge state, and refresh the proof on the resulting clean head.
  2. Split Or Justify The Tooling Drift
    Drop the SDK/release-check changes from this media PR unless the restacked branch proves they are still required for the same fix.
  3. Carry A Narrow Replacement Instead
    If the branch remains dirty, close or pause it and move the useful raw MEDIA replacement into a smaller maintainer-owned PR.

Next step before merge

  • [P2] Manual review is needed because the current PR head has a concrete P2 correctness fix plus dirty merge state, while this branch already owns the canonical issue.

Security
Cleared: No concrete security or supply-chain concern remains visible; the current diff keeps local media behind exact trusted-tool gating and adds a regression for structured-marker bypass.

Review findings

  • [P2] Forward cfg into the transcript rewrite — src/gateway/server-methods/chat.ts:2019
Review details

Best possible solution:

Forward config: params.cfg, restack this into a clean mergeable branch, keep or split only the still-needed tooling drift, and rerun focused gateway/media plus replay validation before maintainer merge.

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

Yes, source-level: current main and latest releases still append a gateway-injected :assistant-media message while Codex/AppServer assistant output is text-only, so raw MEDIA: plus normalized media can become duplicate WebChat messages.

Is this the best way to solve the issue?

No, not yet: replacing the latest matching raw MEDIA assistant turn is the right fix shape, but the current PR needs config forwarding and a clean restack before it is the best mergeable solution.

Full review comments:

  • [P2] Forward cfg into the transcript rewrite — src/gateway/server-methods/chat.ts:2019
    replaceLatestAssistantMediaDirectiveTranscriptMessage accepts cfg and both callers pass it, but this new rewrite call drops it. rewriteTranscriptEntriesInRuntimeTranscript uses that config for session write-lock options, so media replacement now ignores configured lock timeouts/stale settings unlike the existing source-reply rewrite path. Pass config: params.cfg here.
    Confidence: 0.87

Overall correctness: patch is incorrect
Overall confidence: 0.84

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 68e06b9ea148.

Label changes

Label justifications:

  • P2: This is a normal-priority WebChat/gateway media bug fix with bounded but real user-visible duplicate-message impact.
  • merge-risk: 🚨 compatibility: The PR changes gateway transcript/media persistence behavior and is currently dirty against main, so upgrade/current-session behavior needs a clean merge proof.
  • merge-risk: 🚨 session-state: The core fix rewrites persisted assistant transcript entries and can affect session transcript leaf/history state.
  • merge-risk: 🚨 message-delivery: The core fix decides whether media-bearing assistant replies are appended, replaced, or suppressed in WebChat delivery.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body includes terminal output plus browser-observed Control UI proof showing one image bubble and no raw MEDIA text after the fix, though proof should be refreshed after restack.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes terminal output plus browser-observed Control UI proof showing one image bubble and no raw MEDIA text after the fix, though proof should be refreshed after restack.
Evidence reviewed

PR surface:

Source +493, Tests +521, Other -1. Total +1013 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 3 516 23 +493
Tests 5 535 14 +521
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 3 -1
Total 9 1053 40 +1013

Acceptance criteria:

  • [P1] git diff --check.
  • [P1] node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/chat.directive-tags.test.ts.
  • [P1] node scripts/test-projects.mjs src/agents/embedded-agent-subscribe.tools.media.test.ts.
  • [P1] node scripts/run-vitest.mjs src/agents/embedded-agent-runner/replay-history.test.ts.

What I checked:

  • Repository policy read: Root AGENTS.md and scoped guides for src/agents, src/gateway, src/gateway/server-methods, scripts, and test were read; the server-methods guide requires transcript writes to preserve the session DAG through the session seam. (src/gateway/server-methods/AGENTS.md:3, 68e06b9ea148)
  • Current main still appends assistant-media: Current main builds media content and appends a new assistant transcript message with idempotency key ${clientRunId}:assistant-media; no raw MEDIA replacement helper exists on this path. (src/gateway/server-methods/chat.ts:4059, 68e06b9ea148)
  • Latest releases still have append behavior: Both v2026.6.11 and v2026.7.1-beta.1 still contain appendWebchatAgentMediaTranscriptIfNeeded plus the :assistant-media append and no replacement helper, so the PR is not obsolete by release or main behavior. (src/gateway/server-methods/chat.ts:3805, e085fa1a3ffd)
  • Codex contract checked directly: Codex AppServer protocol exposes completed assistant output as a text-only agentMessage, and core agent message content is concatenated into that text field, so a raw MEDIA: directive can arrive as assistant text. (../codex/codex-rs/app-server-protocol/src/protocol/v2/item.rs:237, da4c8ca57d40)
  • Codex image validation checked: Codex AppServer validates image URLs for message and tool-output items but treats ResponseItem::AgentMessage as non-image-bearing, reinforcing that image directives in this flow are text, not native image blocks. (../codex/codex-rs/app-server/src/request_processors/turn_processor.rs:28, da4c8ca57d40)
  • PR head omits config forwarding: The PR-head helper accepts cfg?: OpenClawConfig and callers pass cfg, but its new rewriteTranscriptEntriesInRuntimeTranscript call does not include config: params.cfg. (src/gateway/server-methods/chat.ts:2003, c278019c6956)

Likely related people:

  • jalehman: Recent commits added transcript update/runtime identity contracts and routed transcript writers through the session seam that this PR uses for replacement. (role: recent transcript seam contributor; confidence: high; commits: 00a75db4280b, 475252453b4b, efa9a6110b4e; files: src/agents/embedded-agent-runner/transcript-rewrite.ts, src/config/sessions/session-accessor.ts, src/gateway/server-methods/chat.ts)
  • vincentkoc: Recent history includes transcript rewrite sharing, replay pairing repair, and delivery mirror dedupe on the same replay/session media surfaces. (role: recent gateway/media and replay-history contributor; confidence: high; commits: 4bde68ed3859, b4bc1f20c9fc, f5eddc2b6d1f; files: src/agents/embedded-agent-runner/transcript-rewrite.ts, src/agents/embedded-agent-runner/replay-history.ts, src/gateway/chat-display-projection.ts)
  • HemantSudarshan: Authored merged PR Fix duplicate Control UI assistant-media replies #75481, which fixed a partial-overlap assistant-media duplicate path but did not implement raw MEDIA transcript replacement. (role: adjacent prior fix author; confidence: medium; commits: d5dbc45eb6e5; files: src/gateway/server-methods/chat.ts, src/gateway/server-methods/chat.directive-tags.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • 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.

@Ittiz
Ittiz force-pushed the main branch 4 times, most recently from ec81c25 to a78f652 Compare May 1, 2026 22:59
@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label May 1, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the cli CLI command changes label May 1, 2026
@Ittiz
Ittiz force-pushed the main branch 5 times, most recently from d1273f0 to e32a269 Compare May 2, 2026 04:22
@Ittiz
Ittiz force-pushed the main branch 3 times, most recently from 5a09dfc to 5b1bf9e Compare May 2, 2026 07:57
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label May 2, 2026
@Ittiz
Ittiz force-pushed the main branch 2 times, most recently from e1d4076 to 813a326 Compare May 2, 2026 09:11
@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label May 2, 2026
@openclaw-barnacle openclaw-barnacle Bot added the channel: discord Channel integration: discord label May 2, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 18, 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels May 18, 2026
@clawsweeper

clawsweeper Bot commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 26, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels May 26, 2026
@clawsweeper

clawsweeper Bot commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🌱 uncommon Mossy Signal Puff

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🌱 uncommon.
Trait: sniffs out flaky tests.
Image traits: location green-check meadow; accessory commit compass; palette charcoal, cyan, and signal green; mood watchful; pose holding its accessory up for inspection; shell translucent glimmer shell; lighting subtle sparkle highlights; background little resolved-comment flags.
Share on X: post this hatch
Copy: My PR egg hatched a 🌱 uncommon Mossy Signal Puff in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@Ittiz

Ittiz commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head: 69ae550667eb010c7d65aac0234d1a3fd6cb72ab.

I removed the release-owned CHANGELOG.md entry and refreshed the PR body Real behavior proof to the current head. Local cleanup check: git diff --check passed. The focused gateway behavior test is currently blocked only in this temp checkout by missing rastermill; CI installs dependencies from the lockfile.

@clawsweeper

clawsweeper Bot commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@Ittiz

Ittiz commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head: a046242234bbbdc369730a38fc9b0b2d1be9d211.

Merged latest upstream main, removed the release-owned CHANGELOG.md entry, added the required transcripts tool-display metadata from current main drift, regenerated the shared snapshot, and refreshed the PR body Real behavior proof to the current head.

Local checks passed: git diff --check, node --import tsx scripts/tool-display.ts --check.

@clawsweeper

clawsweeper Bot commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@Ittiz

Ittiz commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Fixed the P1 local-media trust-boundary finding at current head c6d9caa632a3af0a760a844ed7244094176a0a1c.

What changed:

  • Removed the generic details.media.trustedLocalMedia structured-marker path from filterToolResultMediaUrls.
  • Local media now stays behind the existing trusted registered tool path and exact run-local tool-name gate, with the existing owned TTS exception preserved.
  • Updated the regression so comfy_run_workflow with trustedLocalMedia: true does not preserve a local path when the exact run-local trusted set only contains exec.

Local proof:

  • git diff --check
  • node scripts/test-projects.mjs src/agents/embedded-agent-subscribe.tools.media.test.ts passed: 38 tests.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/chat.directive-tags.test.ts passed: 270 tests.

@clawsweeper

clawsweeper Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Ittiz

Ittiz commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebuilt the PR as a clean one-commit series at current head 8a1b5b875e1673fcedcd6d505d04776cff3e10b7 so the rejected structured local-media marker path no longer appears in the PR patch history.

What changed from the previous pushed head:

  • The final tree is identical to the locally tested c6d9caa632a3af0a760a844ed7244094176a0a1c tree.
  • The PR history no longer contains an earlier commit that adds hasStructuredTrustedLocalMediaMarker or trustedRegisteredTool || hasStructuredTrustedLocalMediaMarker(result) and then removes it later.
  • The final diff only keeps local media behind if (trustedRegisteredTool) and includes the comfy_run_workflow regression expecting [] when only exec is trusted.

Local proof from the identical tree before the clean rewrite:

  • git diff --check
  • node scripts/test-projects.mjs src/agents/embedded-agent-subscribe.tools.media.test.ts passed: 38 tests.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/chat.directive-tags.test.ts passed: 270 tests.

@clawsweeper

clawsweeper Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Ittiz

Ittiz commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Fixed the P1 tail-safety finding at current clean head 812afa911cae981098e9aa99f23a8b1b87bfc410.

What changed:

  • replaceLatestAssistantMediaDirectiveTranscriptMessage now rewrites only a matching raw MEDIA assistant at the transcript tail.
  • If an older matching raw MEDIA assistant is followed by a newer user or assistant turn, the helper refuses to rewrite it and reports that a newer entry blocked the replacement.
  • The agent media path now appends the current media reply only for that blocked-old-MEDIA case when no replay-safe media content was built, while preserving the existing stale-media no-op behavior.
  • Added/updated gateway regressions so older matching MEDIA replies after newer assistant/user turns remain untouched and the current reply is appended instead.

Local proof:

  • git diff --check
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/chat.directive-tags.test.ts passed: 272 tests.
  • node scripts/test-projects.mjs src/agents/embedded-agent-subscribe.tools.media.test.ts passed: 38 tests.

@clawsweeper

clawsweeper Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@Ittiz

Ittiz commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded by merged PR #113163, which explicitly incorporated this prior art and now provides the one-reply managed-image behavior on current main with identity-based transcript handling and base-path-safe media URLs. I did not rewrite the old fork main branch because there is no remaining feature delta to reconcile.

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 gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL stale Marked as stale due to inactivity status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant