Skip to content

fix(ui): managed image replies render once under base paths - #113163

Merged
fuller-stack-dev merged 1 commit into
mainfrom
codex/fix-control-ui-managed-media
Jul 23, 2026
Merged

fuller-stack-dev merged 1 commit into
mainfrom
codex/fix-control-ui-managed-media

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

Closes #113161

Related prior art: #75727

AI-assisted: yes. I understand the change and verified the full ownership path.

What Problem This Solves

Fixes an issue where users viewing managed assistant images in a Control UI mounted below a base path would get a missing preview, and a Codex-managed media answer could appear as both a raw and managed assistant reply.

Why This Change Was Made

Managed outgoing media URLs remain origin-root Gateway API paths instead of being rebased under the Control UI mount. For Codex runtime-owned replies, the harness now carries the exact mirrored transcript idempotency key through finalization so Gateway replaces only that canonical assistant row with managed content rather than appending a parallel row.

The identity-based rewrite preserves the existing transcript event/message ID and neighboring assistant entries. Other harnesses without an attested transcript identity retain the existing append path.

Direct Codex contract check: app-server item completion is the authoritative item/result state, while turn completion is the final turn status (Codex app-server protocol). That matches the existing OpenClaw Codex projector’s item-owned assistant lifecycle and makes the mirror idempotency key the durable reconciliation identity.

User Impact

Managed images render normally when Control UI is served under a path such as /rosita, and one Codex media answer remains one logical assistant reply. Distinct neighboring assistant replies are not deduplicated.

Evidence

  • Base 8a2b2b35f50: deterministic Chromium requested /rosita/api/chat/media/outgoing/..., received text/html, and attached no image (red Testbox run).
  • Exact head afaddab0a90: Chromium requested only /api/chat/media/outgoing/..., received image/png, decoded a non-zero image width, showed the managed reply once, and preserved a distinct second reply.
  • Sanitized before/after contact sheets use the same deterministic fixture and 1280x800 viewport; no private session data is included.

Before (base; image absent):

Before: managed image missing under the Control UI base path

After (exact head; image decoded and replies remain distinct):

After: managed image rendered once with a distinct second reply

Raw recordings: base reproduction · exact-head fix · manifest and checksums

  • Focused Blacksmith proof: 379 assertions plus the Control UI E2E passed (run).
  • Exact-head focused proof after rebasing to bd48b7b26bb:
    • src/agents/embedded-agent-runner/run/payloads.test.ts: 54 passed
    • src/agents/embedded-agent-runner/run/run-attempt-dispatch.media.test.ts: 10 passed
    • src/gateway/server-methods/chat.directive-tags.test.ts: 157 passed
    • ui/src/e2e/managed-media-base-path.e2e.test.ts: 1 passed
  • Changed-surface type/lint/build command returned 0 on Blacksmith Testbox. The external portal finalization timed out afterward, so this PR does not claim that wrapper run as a GitHub check.
  • $behavior-validator: 4 contract clauses passed; 0 failed/blocked. Anti-cheat route returned HTML for any incorrectly prefixed request, decoded dimensions proved real image bytes, and the distinct second reply guarded against broad content dedupe.
  • $autoreview: clean, no accepted/actionable findings; overall correctness 0.94.
  • git diff --check: passed.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling extensions: codex size: M maintainer Maintainer-authored PR labels Jul 23, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Jul 23, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Maintainer landing update for head afaddab0a90e625b26a16cfe43b619803612dcfd:

  • ClawSweeper's completed review has no findings, calls the patch correct, and rates the real-behavior proof sufficient.
  • Its sole rank-up move is to rebase onto current main and rerun the focused proof. I am skipping that move under the repository's behind-main policy: bd48b7b..127b781 touches no PR file. The only adjacent runtime movement is refactor(auto-reply): split config dispatch pipeline #113154's mechanical split of dispatch-from-config.ts; dispatch-from-config.payloads.ts, the assistant metadata projection owner changed here, is untouched. The synthetic merge is conflict-free.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 113163 passed in hosted_exact_or_recent_parent mode for this exact head after that impact review. The red/green browser, Gateway transcript, Codex attestation/propagation, source-blind behavior, and clean autoreview evidence therefore remain valid.

No owner-boundary, security, config, protocol, or sibling-runtime concerns remain. Proceeding through the repo-native merge gate once the durable ClawSweeper publication catches up.

@fuller-stack-dev
fuller-stack-dev merged commit 09c6d66 into main Jul 23, 2026
167 of 171 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the codex/fix-control-ui-managed-media branch July 23, 2026 22:49
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Current-main drift proof completed before merge:

The overlapping main change (#113157) only replaces the shared chat-run-state test fixture; the exact transcript rewrite and base-path behavior remain green on the actual merge result. This satisfies the ClawSweeper rank-up intent without rewriting the PR branch.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Landed via squash as 09c6d66d19b91e1ce6eb4058e387a8c5fae03a6c from source head afaddab0a90e625b26a16cfe43b619803612dcfd.

Post-merge verification:

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 extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: managed chat images break under Control UI base paths and duplicate Codex replies

1 participant