fix(gateway): preserve node offloaded media transcripts#90619
Closed
sweetcornna wants to merge 1 commit into
Closed
fix(gateway): preserve node offloaded media transcripts#90619sweetcornna wants to merge 1 commit into
sweetcornna wants to merge 1 commit into
Conversation
|
Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
This was referenced Jun 16, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent.requestoffloaded image refs through the existingchat.sendmedia helpers so session transcripts keepMediaPath/MediaPathsfor iOS share and node gateway attachments.before_agent_runhook blocks safe by marking the recorder blocked from the command result before fallback persistence runs.Fixes #60339.
Verification
node scripts/run-vitest.mjs src/gateway/server-node-events.test.tsOPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/agents/command/attempt-execution.cli.test.ts -t "forwards prepared user-turn transcript recorders"OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/gateway/server-methods/chat.directive-tags.test.ts -t "preserves offloaded attachment media paths in transcript order"node_modules\.bin\oxfmt.cmd --check src/agents/command/attempt-execution.cli.test.ts src/agents/command/attempt-execution.ts src/agents/command/types.ts src/gateway/server-methods/chat.ts src/gateway/server-node-events.runtime.ts src/gateway/server-node-events.test.ts src/gateway/server-node-events.tsgit diff --checknode scripts/run-oxlint.mjs src/agents/command/attempt-execution.cli.test.ts src/agents/command/attempt-execution.ts src/agents/command/types.ts src/gateway/server-methods/chat.ts src/gateway/server-node-events.runtime.ts src/gateway/server-node-events.test.ts src/gateway/server-node-events.tsnode scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-60339-core.tsbuildinfonode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-60339-core-test.tsbuildinfopython .agents\skills\autoreview\scripts\autoreview --mode branch --base origin/main --engine claudeSource / contract proof
src/gateway/server-methods/chat.tsalready owns thepersistChatSendImages->buildChatSendUserTurnMedia->createUserTurnTranscriptRecorderflow for web/chat upload transcripts; this patch reuses that path instead of adding a node-only media persistence implementation.src/agents/embedded-agent-runner/run.tspropagatesmeta.error.kind: "hook_block"forbefore_agent_runblocks, andsrc/agents/command/delivery.tspreserves runmetain the command delivery result. The node fallback uses that established hook-block signal before callingpersistFallback().src/sessions/user-turn-transcript.tsalready skips fallback persistence when the recorder has been marked blocked, and short-circuits fallback after runtime persistence succeeds.Real behavior proof
Behavior addressed: node/iOS share
agent.requestattachments that parse intooffloadedRefsnow persist transcript media metadata instead of leaving the media orphaned after the parser returns.Real environment tested: Windows OpenClaw checkout, focused Vitest wrappers and static checks at head
f026bae77donfix/60339-node-offloaded-refsagainstorigin/main1a3ce7c2a8.Exact steps or command run after this patch: commands listed in
Verificationwere run after the final block-aware fallback change and before opening this PR.Evidence after fix:
server-node-events.test.tscovers parsed node offloaded refs being passed intopersistChatSendImages, converted into recorder media, forwarded intoagentCommandFromIngress, retried with a fresh per-request user idempotency key, and protected by fallback persistence. It also coversmeta.error.kind: "hook_block"marking the recorder blocked before fallback runs.attempt-execution.cli.test.tscovers recorder forwarding to both embedded and CLI runners.Observed result after fix: The prepared user-turn transcript recorder receives the raw user text plus persisted media paths, the agent still receives the parsed marker-bearing message, and fallback persistence cannot re-persist raw input for blocked runs.
What was not tested: No live iOS share extension or real node client attachment run was executed; this is source-level behavior proof with focused gateway and command-runner tests.