Skip to content

fix(infra): relay exec-completion replies on WebChat-internal sessions - #148360

Merged
jalehman merged 9 commits into
openclaw:mainfrom
etzelm:fix/webchat-exec-completion-reply
Sep 17, 2026
Merged

jalehman merged 9 commits into
openclaw:mainfrom
etzelm:fix/webchat-exec-completion-reply

Conversation

@etzelm

@etzelm etzelm commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #147387

Current published and demonstrated head: 7e22264fa0ee40084afa45f59825a7e4510fd0d5. This ancestry-preserving merge integrates main 4520c88d8c9e0146f05a9ab5ae0431f57f884e65, including #151080 and #151086. The original 18-file feature delta and contributor history are preserved.

Fresh exact-head proof: Gateway / Control UI results and four inspected screenshots. Sanitized direct-AWS execution passed 569 tests across 22 files, changed-file checks, builds, connected exactly-once delivery, and disconnected/reopen/reload history. The worker and fixture processes were cleaned up, and lease absence was independently verified. This is an actual Gateway/browser/background-exec run using a deterministic local provider fixture, not a live-model proof. Screenshots were also published in the originating chat. Exact-head CI is green; static/current-head code review found no actionable patch defects. The human changes-requested disposition remains unresolved, and no merge is being attempted.

Historical evidence below: Contributor live-model observations were collected on 426944919981395990cfdf45c52cd9a76cb66dc3; earlier deterministic Gateway/UI observations were collected on cb4e63b5e052f61bbaf53bc36aaadca715f2de87. Those observations retain their original scope. The new linked run, rather than source equivalence alone, supplies execution evidence for the current integrated head.

Most of what is in the tree is @jalehman's work. The per-commit breakdown is under Attribution.

Related historical reports: #31348 and #31375. Neither substitutes for the current repair or its proof.

What Problem This Solves

A background exec command started from an internal WebChat session (Control UI or the Windows Companion) runs to completion and no completion reply ever appears in that session. The command really ran and the follow-up turn really executed, so the work is done, but the person who started it sees nothing and has to ask again by hand. The same flow on Telegram or any other external channel delivers the completion normally, so the behaviour differs silently by client surface.

User Impact

  • A background exec started from a WebChat session now receives its completion reply in that same session, the way it already worked on external channels.
  • Explicit suppression stays silent. heartbeat.target: "none" publishes nothing, and neither does an explicit target that never resolves to a deliverable route. Both are the delivery resolver's reason: "target-none" verdict.
  • Hidden internal sessions are not turned into recipients. Publication requires an internal session a person actually opened: delivery.kind === "internal", createdVia !== "internal", and either an operator-created row, a row with lastReadAt set, or a spawn row under a dashboard: key.
  • The published row is ordinary model context, not delivery bookkeeping. It carries provider: "openclaw" with model: "automation-result", which is deliberately not in TRANSCRIPT_ONLY_OPENCLAW_ASSISTANT_MODELS (src/shared/transcript-only-openclaw-assistant.ts), so replay, web push, run waits and the composer treat it as the reply instead of skipping it as a mirror.
  • No new configuration option, schema change, migration, dependency, permission, network destination, or command-execution surface. Existing session-generation, writer, cancellation and active-transcript checks all still apply.

Why This Change Was Made

Root cause. Relay eligibility recognised only an external route. At base f9584dc, src/infra/heartbeat-runner-execution.ts:394-396 reads:

const canRelayToUser = Boolean(
  delivery.channel !== "none" && delivery.to && visibility.showAlerts,
);

A WebChat-internal session never has an external channel or recipient by design, so the first two conjuncts fail regardless of visibility.showAlerts. Every exec-completion wake on such a session therefore took the suppressed branch: the model was told "An async command completion event was triggered, but user delivery is disabled for this run. Handle the result internally. ... Do not mention, summarize, or reuse command output." (src/infra/heartbeat-events-filter.ts:130-141), and the dispatcher's no-channel gate discarded whatever came back anyway. Nothing was wrong with the exec run itself. The reply was suppressed twice before it could reach the session.

An earlier revision of this branch answered that by mirroring the reply into the transcript. That approach is gone. It wrote the primary publication as an unmarked delivery mirror, a shape the rest of the codebase classifies as bookkeeping rather than as the reply. What is in the tree now is a guarded publication that settles the completion event on a real receipt.

What the current implementation does

  1. Publication path. New src/infra/heartbeat-session-publication.ts (+284). publishHeartbeatSessionReply writes the completion into the originating session's own transcript under that session's current generation, fenced on expectedSessionId, expectedLifecycleRevision and the active writer run id, and re-checks ownership before the write, inside the append transaction, and again at commit. When the run already committed its own final (assistantMessageIndex, assistantTranscriptOwned, or a source-reply transcript mirror), the publication reconciles against that committed row instead of appending a second one, and refuses if the runtime final's text or media do not match the committed receipt.

  2. Settlement on the receipt. In src/infra/heartbeat-dispatch.ts, the channel-less branch (:582) no longer returns visibleReplySent: false unconditionally. It captures the pending completion occurrence ids, calls the publication, and returns visibleReplySent: committed.ok, so consumeSelectedSystemEventEntries runs only after the canonical transcript owner accepted the write or the replay. A refused publication records its reason and leaves the event pending rather than consuming it silently.

  3. Committed custody before the write can yield. onMessageCommitted now fires synchronously inside appendExpectedSessionTranscriptTurn (src/config/sessions/session-accessor.sqlite-transcript-turn.ts), directly after the guarded SQLite commit and before cancellation, owner drain or transcript publication can run at an async boundary. Pinned by a new case in session-accessor.transcript-owner.test.ts, "completes committed custody before a queued cancellation can interrupt the receipt".

  4. One canonical definition of the final-answer bytes. resolveRawAssistantAnswerText moved out of src/agents/embedded-agent-runner/run/payloads.ts into new src/shared/assistant-answer-text.ts, so the receipt comparison and the runner's own payload resolution read the same bytes rather than two copies of the same logic. Net -67/+1 in payloads.ts, and its entry drops out of config/assertion-safety-baseline.txt.

  5. Strict media replay for keyed mirrors, with pre-upgrade compatibility. src/config/sessions/transcript.ts drops isIdentifiedDeliveryMirror, so a keyed mirror is held to strict replay identity instead of being exempted from it. Media identity enters the canonical assistant message through recordAssistantManagedMediaUrls, and persistInternalSourceReply records its media urls. The legacy replay follow-up restores identical replay for rows written before the upgrade: messagesMatchForIdempotentReplay projects away openclawDelivery.mediaUrls when the stored row is a v2026.9.4-shaped mirror that never carried the field, and stays strict otherwise. Covered by src/config/sessions/transcript.media-identity.test.ts. The transcript.ts assertion-ratchet entry goes from 15 to 14.

  6. Resolver-level target-none gate. src/infra/heartbeat-runner-execution.ts captures the projection candidate before the routing await, so the client-owned generation is still read before anything can await, then decides after the resolver returns:

    // src/infra/heartbeat-runner-execution.ts:380
    const internalProjection = delivery.reason === "target-none" ? undefined : projectionCandidate;

    The preceding revision gated on the config string heartbeat?.target !== "none". That catches the literal "none" but not an explicit target that never resolves to a route. In src/infra/outbound/targets.ts an explicit target starts at "none" (:231); a value that is not none/last/owner and not a deliverable channel falls through :236-241, and with no to set it never reassigns target, so :257-260 returns reason: "target-none" while heartbeat.target still holds the original string. HeartbeatSchema.target is z.string().optional(), so such a config typechecks. Gating on the resolver verdict rather than the string keeps both the relay prompt and the publication path from seeing a target the resolver already declined to deliver to. See Blast radius for how reachable that state actually is.

Attribution

Branch history in git log order, base f9584dc:

commit author contribution
f7904df @etzelm original relay-eligibility fix and its first test
aa1056e @etzelm shouldSetIndicator extraction in heartbeat-dispatch.ts
f88a795 this side, committed under a Claw placeholder author first maintainer-review response
1148b94 @jalehman publication path, settlement on the receipt, committed-custody ordering, shared answer-text module, gateway boundary test
4572570 @jalehman strict media replay identity, and the first target:none guard
4269449 @etzelm resolver-level target-none gate, rebased onto 4572570
cb4e63b5 @jalehman legacy delivery-mirror replay identity
c6bb4595 @jalehman ancestry-preserving integration of main CI repairs
7e22264f @jalehman ancestry-preserving integration of landed Slack boundary and regression repairs

@jalehman wrote the bulk of the current implementation: src/infra/heartbeat-session-publication.ts and its 641-line unit test, src/shared/assistant-answer-text.ts, src/gateway/session-message-events.exec-completion.test.ts (+202), the session-accessor custody changes, and the transcript.ts media-identity work including the pre-upgrade replay fix on the head commit.

Whole branch against f9584dc: 17 files changed, 2422 insertions, 119 deletions.

Evidence

Live before and after in a real Control UI WebChat client

This is the artifact the review has asked for on every revision. A real gateway, a real browser client, a real background exec, and the real heartbeat path. Only the model call is scripted, by a deterministic OpenAI-compatible server; this is not a fully live model run, and the distinction matters, so it is stated up front. The scripted model is compliant in both directions: told "user delivery is disabled ... reply NO_REPLY only" it replies NO_REPLY, and told "Please relay the command output to the user" it relays. So the rendered differential reflects the code path, not a model ignoring instructions.

The prompt is RUN_JOB:<MARKER>. The model answers by calling exec with bash -lc 'sleep 40; echo <MARKER>' in background and replying STARTED. The completion, if relayed, renders as BACKGROUND JOB DONE :: <MARKER>.

Arm 1, merge base 4e44dbf, heartbeat.target: last. Completion absent.

Arm 1 baseline on merge base 4e44dbf: user prompt, background marker job, STARTED, and no completion row

Arm 2, head 4269449, identical harness. Completion present exactly once.

Arm 2 on head 4269449: the same conversation plus BACKGROUND JOB DONE :: EXEC_MARKER_ARM2

Arm 3, head 4269449, heartbeat.target: none. Suppression still honored, no user-visible row.

Arm 3 on head 4269449 with target none: STARTED only, no completion row

signal arm 1 (4e44dbf, last) arm 2 (4269449, last) arm 3 (4269449, none)
delivery.kind at wake internal internal internal
createdVia operator operator operator
relay prompt count 0 1 0
suppression prompt count 1 0 1
completion visible in rendered WebChat false, 0 rows true, 1 row false, 0 rows
chat.history occurrences over a second connection 0 1 0

The chat.history row is read by a new process over a new connection after the run finishes, which is what a reconnecting client sees. Arms 1, 2 and 3 use the identical harness, session shape and scripted model on the same host; only the image (1 vs 2) or the target (3) differs.

A real Control UI client produces the gated session shape with no hand seeding. An earlier report could not explain how a real session acquires delivery.kind: "internal" and seeded it by hand. It does not need seeding. A sampler recorded the session entry every 3 seconds during arm 2:

[01:56:56] agent:main:main|operator|internal|-     <- set by the browser's chat.send turn
[01:57:38] agent:main:main|operator|none|-         <- rewritten by the later heartbeat turn

createdVia: "operator" plus delivery: { kind: "internal" } is exactly the gate at heartbeat-runner-execution.ts:340-351. The value is internal at wake time and none afterwards, which is why reading the entry after the fact was misleading.

Harness, the two prompts as the model actually received them, and settlement log lines

Three images built from node:24-bookworm + corepack pnpm, each from a detached worktree at the exact sha, all docker build exits 0:

image commit role
openclaw-repro:MB18 4e44dbfb428ad11cb20dbaf9ba82b87be7853651 merge base on main, pre-fix
openclaw-repro:HD18 426944919981395990cfdf45c52cd9a76cb66dc3 demonstrated revision, fixed
openclaw-repro:PR18 4572570321d146260ed40ee4df15f33bf5e99897 its parent

Real in every arm: the gateway process (openclaw gateway run), the Control UI served by the gateway itself from its own dist/control-ui (control-ui http=200), a real headless Chromium client driven with the same selectors the repo's ui/src/e2e suite uses, chat.send over the Gateway WebSocket, the exec tool, the real background process, maybeNotifyOnExit into the heartbeat wake, prepareHeartbeatRunStage, dispatch, the on-disk SQLite session store, and chat.history over a second connection. The native WebChat app is macOS/iOS only and cannot run in a Linux container; the Control UI chat tab is a real WebChat client over the same RPCs and is the surface the production session shape comes from.

Arm 1, merge base 4e44dbf, the prompt the model received:

An async command completion event was triggered, but user delivery is disabled for this
run. Handle the result internally and reply NO_REPLY only. Do not mention, summarize, or
reuse command output.

Arm 2, 4269449, same harness:

An async command you ran earlier has completed. The command completion details are:

Exec completed (plaid-ba, code 0) :: EXEC_MARKER_ARM2

Please relay the command output to the user in a helpful way. If the command succeeded,
share the relevant output. If it failed, explain what went wrong.

chat.history read by gateway call chat.history in a new process over a new connection:

arm 1: SESSION_KEY=agent:main:main  history_exit=0  history_completion_occurrences=0
arm 2: SESSION_KEY=agent:main:main  history_exit=0  history_completion_occurrences=1
arm 3: SESSION_KEY=agent:main:main  history_exit=0  history_completion_occurrences=0

The wake fired in all three arms and reached outcome=completed in all three. Arm 2, from the gateway log:

01:56:25 [heartbeat] started
01:57:37 [diagnostic] message received: chatId=heartbeat sessionKey=agent:main:main source=dispatchInboundMessage
01:57:37 [diagnostic] session turn created: runId=b6bc4c7d-... trigger=heartbeat
01:57:37 [diagnostic] message processed: outcome=completed duration=415ms

Arm 1 is identical in shape and also reaches outcome=completed. The entire difference is which prompt the run assembled, and therefore whether anything reached the client.

Sanitization: the gateway token in every arm is the literal string fake-local-token-not-a-secret and appears only in a URL fragment, never on screen. The scripted provider uses apiKey: "unused-local". No real keys, tokens, IPs, phone numbers, private hostnames or personal names appear in any image. The UI shows only the generic Assistant, Owner, workspace ws and Scripted Deterministic Model. Each arm ran on throwaway config and a throwaway /state.

Live re-run on the current head cb4e63b5, scripted control plus a real model

Re-run with the same harness on the current head cb4e63b5 (baseline arms on the merge base 4e44dbf), with two model configurations: the scripted control (deterministic, compliant), and a real model, Claude Sonnet 5 through the bundled claude-cli backend on the heartbeat turn that receives the relay or suppression prompt (session modelOverride set by /model claude-cli/claude-sonnet-5; the first turn stays scripted so that OpenClaw's own exec starts the job, because the claude-cli backend maps exec onto Claude's native Bash and does not expose it over its MCP bridge). Real-model assertions look for the exec output marker in a new assistant row, never for wording. Full detail, receipt variants and the legacy media replay are in the re-run comment.

arm image heartbeat.target model on the relay turn expected rendered client chat.history, 2nd connection
s1 4e44dbf last scripted absent absent 0
s2 cb4e63b5 last scripted present once present, 1 row 1
s3 cb4e63b5 none scripted absent absent 0
s4 cb4e63b5 last scripted, relay carries media present once with image present, image rendered 1
h1 4e44dbf last Claude Sonnet 5 (claude-cli) absent absent (NO_REPLY) 0
h2a, h2b cb4e63b5 last Claude Sonnet 5 (claude-cli), two runs marker present once present, 1 row, both runs marker present
h3 cb4e63b5 none Claude Sonnet 5 (claude-cli) absent absent (NO_REPLY) 0

s2 on head cb4e63b5, scripted control: BACKGROUND JOB DONE :: EXEC_MARKER_S2 rendered once

h2a on head cb4e63b5, Claude Sonnet 5 via claude-cli relaying EXEC_MARKER_H2A in its own words

Legacy media replay (cb4e63b5) on one real store: a v2026.9.4 gateway wrote a keyed media mirror row with no media identity; on the parent 4269449 the identical replay candidate conflicts, on the head it matches with no new row, and a changed-media candidate conflicts on both. Browser rendering and second-connection history were live at each phase.

Two-destination screenshot gate (AGENTS.md, "Product and validation"): the inspected before/after pair above (arm1-03-final.png, arm2-03-final.png) was attached in the originating implementation chat on 2026-09-17 at 02:35 UTC and verified to render there, and is embedded here, where every image URL was re-checked to return 200 image/png.

What the live run does not establish

  • The arms in this subsection ran on the parent 4269449. The re-run on the current head cb4e63b5 is in the subsection above.
  • The session key observed is agent:main:main, not the agent:main:dashboard:<uuid> seen in production. The driver did not find a "New session" control, so the Control UI reused the agent default session. createdVia and delivery.kind still match production, and those are what the gate reads.
  • transcript_events durable-row counts were not captured in this run; the query returned empty, so that table or column name is wrong in this harness. An earlier run measured transcript publication successfully. Nothing here contradicts it, but nothing here re-proves it either.
  • Arm 3 sets heartbeat.target: "none" at agents.defaults, not per session. The container has exactly one session so the effect on the session under test is the same, but no session-scoped field exists.
  • Only the automatic value of messages.visibleReplies was exercised.
  • All arms in this subsection used the scripted model; the real-model arms are in the subsection above.

Blast radius of item 6, narrower than it looks

The unresolvable-target arm is proven at unit level and is a real code path, but I could not reach it from a static, schema-valid config, and that is worth saying rather than implying a live repro exists. Both candidate targets were rejected by config validation before the gateway could start:

target: "pagerduty"  -> OpenClaw config is invalid; run "openclaw doctor --fix" before startup.
target: "webchat"    -> agents.defaults.heartbeat.target: unknown heartbeat target: webchat

agents.defaults.heartbeat.target is validated against an allowlist, so an arbitrary unresolvable string cannot be set there. The resolver state the gate guards against needs a target that passes validation at load and fails normalization at resolution: a channel plugin present when the config validated and absent when the heartbeat resolved, or a non-config heartbeat source. Neither was reproducible in a container in the time available, and a session-scoped override does not exist in src/config/sessions/types.ts. So the fix is correct and cheap, its unit coverage is real, and its reachability from a static config is not demonstrated.

The discriminating unit before and after

Three arms at the end of src/infra/heartbeat-runner.webchat-exec-completion.test.ts, reusing @jalehman's existing withProjectionScenario / runProjectionWake / readProjectionMessages helpers:

arm heartbeat.target publishes role
routeless target:last "last" yes control
explicit target:none "none" no passes under both implementations
explicit target with no resolvable route "pagerduty", no to no discriminating

With only src/infra/heartbeat-runner-execution.ts reverted to 4572570 and the test file held at 4269449:

 Test Files  1 failed (1)
      Tests  1 failed | 23 passed (24)

AssertionError: expected [ { role: 'assistant', …(8) } ] to have a length of +0 but got 1
 ❯ src/infra/heartbeat-runner.webchat-exec-completion.test.ts:395:24

Patched (4269449): Test Files 1 passed (1) / Tests 24 passed (24), all arms green.

Exactly what that proves, and what it does not. Line 395 is expect(messages).toHaveLength(publishes ? 1 : 0), the committed assistant row. vitest stops at the first failing assertion, so the committed-row layer is the only layer demonstrated failing on the unpatched arm. The onSessionTranscriptUpdate broadcast assertion (:396) and the getLastHeartbeatEvent() status and reason assertions (:399-403) sit after it and were never evaluated unpatched. Patched, all of them pass. So: one layer proven differentially, every layer proven passing on the new gate, and nothing more is being claimed.

Per-arm output, both sides

Unpatched (heartbeat-runner-execution.ts at 4572570, test file at 4269449):

 ✓ preserves explicit target:none before target:last delivers in the same WebChat session 739ms
 ✓ routeless target:last leaves the completion published: true 719ms
 ✓ explicit target:none leaves the completion published: false 709ms
 × explicit target with no resolvable route leaves the completion published: false 723ms

 Test Files  1 failed (1)
      Tests  1 failed | 23 passed (24)

Patched (4269449):

 ✓ preserves explicit target:none before target:last delivers in the same WebChat session 731ms
 ✓ routeless target:last leaves the completion published: true 716ms
 ✓ explicit target:none leaves the completion published: false 704ms
 ✓ explicit target with no resolvable route leaves the completion published: false 710ms

 Test Files  1 passed (1)
      Tests  24 passed (24)

Plain expect throughout, no expect.soft. Prompt body assertions were left to @jalehman's existing target:none test rather than duplicated.

What the rest of the suite covers

  • src/infra/heartbeat-session-publication.test.ts (641 lines) exercises the publication owner directly: cancellation and authority loss during queued work, publish-once on replay, receipt reconciliation by key, by stream index and by owned transcript, source-mirror and media receipts, refusal when ownership metadata has no committed final, fences on session, revision, writer and archive, a revision-less generation that later materialises one, and refusal to revive an abandoned completion.
  • src/gateway/session-message-events.exec-completion.test.ts drives runHeartbeatOnce against a real gateway WebSocket client, connected and disconnected, and asserts the events drain, exactly one committed completion in history, one live notification when a client is connected and none when it is not, and that a second wake is skipped with the reply generator called once.
  • src/config/sessions/session-accessor.transcript-owner.test.ts and src/config/sessions/transcript.media-identity.test.ts cover the custody ordering and the media replay identity described above.

Local checks on the demonstrated revision

check result
pnpm tsgo exit 0 on the final tree
oxfmt --check on both changed files "All matched files use the correct format", 2 files
oxlint type-aware, --tsconfig config/tsconfig/oxlint.core.json src/infra exit 0; zero diagnostics on either changed file. One warning in total, src/infra/sqlite-worker-broker.ts:744 eslint(max-lines), in a file this PR does not touch
vitest, src/infra/heartbeat-runner.webchat-exec-completion.test.ts Test Files 1 passed (1) / Tests 24 passed (24)
vitest, src/infra/heartbeat* plus src/gateway/session-message-events.exec-completion.test.ts Test Files 36 passed (36) / Tests 574 passed (574), projects infra and gateway-core
existing contract heartbeat-runner.returns-default-unset.test.ts runs an exec-event wake for a configured agent when cadence is disabled and runs the agent when an explicit heartbeat target is rejected both pass

Not run: full pnpm lint, full test suite.

CI

The CI analysis below is pinned to run 35168002167 on the demonstrated revision 4269449: 8 failing jobs, 143 passing, 16 skipped. The eight are control-ui-performance, six checks-node-compact-* shards, and the openclaw/ci-gate aggregate that rolls them up. The newer run on head cb4e63b5 reports additional failures that are not analysed here.

control-ui-performance is a repo-wide budget failure

The shortcut here would be to call it pre-existing on this branch, and that is not true: the earlier head 1148b94e7e77 passed this check at 2026-09-16T22:41:46Z measuring 360695 B (job 105004415143), and it first went red at 4572570. The accurate claim is narrower. main itself fails the same check, with the identical violation:

main head run job completed (UTC) startup JS gzip
4e44dbfb 35167537979 105033483035 2026-09-17T00:50:41Z 362706 B
74345aa2 35167458744 105032230178 2026-09-17T00:45:11Z 362716 B
6dbf1873 35166207851 105028014818 2026-09-17T00:24:38Z 362706 B

main at 4e44dbfb is exactly the base revision this PR's run merged against, and it measures 362706 B standalone, already past the 362588 B enforcement limit, with none of this PR's code in the tree. Three unrelated branches fail identically in the same window:

Every one of them, and this PR, emits the same line verbatim:

    - startup JS gzip: 354.2 KiB exceeds 354.1 KiB

Nothing in this PR feeds that bundle. All 17 changed files are absent from all three lists in the committed boot-module manifest ui/config/control-ui-boot-modules.json (shared 2036, new 86, chat 24, total 2146 entries), no file under ui/ imports any of the changed modules, and the PR does not touch config/control-ui-startup-budget-baseline.json. It touches config/assertion-safety-baseline.txt, which is a different file.

Baseline arithmetic, per-head measurements, and the growth explanation

Against the committed baseline in config/control-ui-startup-budget-baseline.json (startupJsGzipBytes: 362012, last updated 2026-09-14 in #148010):

  startup JS gzip vs baseline: 362706 B (baseline 362012 B + growth allowance 512 B = growth limit 362524 B; build-variance allowance 64 B; enforcement limit 362588 B; max committed baseline 362496 B)

That is 694 B of drift on main, 118 B past the enforcement limit.

Per head on this branch:

head run job conclusion startup JS gzip
1148b94e7e77 35158696526 105004415143 success 360695 B
4572570 35165757985 105026577881 failure 362706 B
4269449 35168002167 105033508015 failure 362716 B

The growth from 360695 B to 362706 B tracks the advancing main base rather than anything on the branch. Scoping the toolchain claim precisely: the three runs on this branch are constant at Node v24.19.0, Vite 8.2.2, Pako 3.0.1. The main perf jobs quoted above ran Node v24.20.0, so the branch-to-main comparison is not on a constant toolchain and is not being presented as one. What the main jobs do establish independently is that main alone exceeds the limit, and that main alone produces both 362706 B and 362716 B on different runs, which is the same 10 B spread seen between 4572570 and 4269449 and sits inside the check's own documented build-variance allowance 64 B.

Not every branch is red, which is consistent with the merge-base explanation: codex/claw-882-contextual-help (job 105031877326) and an earlier main run (job 105030093589) both passed in the same window, having merged against an older main.

Which main commit introduced the roughly 694 B of growth has not been established. There are 9 main commits between the two run bases a11a431e and 4e44dbfb, and the builds were not diffed across them.

Five of six shard failures have a named cause

job check failing test file status
105033510640 checks-node-compact-large-13 src/skills/loading/plugin-skill-read.test.ts reproduced on main and on 4 unrelated branches
105033512454 checks-node-compact-small-26 test/scripts/pr-main-refresh.test.ts merge-base drift, reproduced on 4 unrelated branches
105033512339 checks-node-compact-small-24 test/scripts/pr-operation-lock.test.ts merge-base drift, reproduced on 4 unrelated branches
105033514283 checks-node-compact-small-39 test/scripts/pr-worktree-provision.test.ts merge-base drift, reproduced on 4 unrelated branches
105033514342 checks-node-compact-small-40 test/scripts/pr-wrappers.test.ts merge-base drift by path, no independent reproduction
105033512462 checks-node-compact-large-29 src/gateway/server-methods/models-auth-login.catalog.integration.test.ts unexplained

The test/scripts/pr-* group is merge-base drift, not this branch. main commit 387f69830a8 (#149585), "improve(pr): reuse managed source clones for cold worktrees", landed 2026-09-17T00:17:15Z. It sits in the 9-commit window between the base of the 4572570 run (a11a431e) and the base of this run (4e44dbfb), so it entered this PR's merge base between the two CI runs and was absent from the earlier one. It modifies scripts/pr, scripts/pr-lib/worktree-provision.mts and exactly the four test/scripts/pr-*.test.ts files that fail here.

Three of those four, plus plugin-skill-read.test.ts, fail identically on four unrelated branches whose runs merged against the same main in the same window:

The failure mode there is the provisioning change, not a test assertion:

Error: Cannot find module '/tmp/oc-vt-.../openclaw-pr-main-refresh-.../canonical/src/shared/immutable-data.js'
  code: 'ERR_MODULE_NOT_FOUND'

test/scripts/pr-wrappers.test.ts is modified by the same commit but did not reproduce on those four branches, so it has a named cause and no independent reproduction. I am not claiming more for it than that.

models-auth-login.catalog.integration.test.ts is unexplained. It passed on 4572570 (job 105026582011) and did not reproduce on main or on any of the four unrelated branches. This PR touches no file under src/gateway/server-methods/, which is an argument from paths rather than from a reproduction, and it is flagged as such.

Happy to rebase once the startup budget baseline is refreshed on main.

Review status

ClawSweeper posted Revision 5 at 2026-09-17T01:52Z against head cb4e63b5. Patch quality is now platinum hermit (4/6) with no actionable review findings; the publication, explicit-suppression and legacy-media replay findings are all recorded as addressed. The single remaining gate is proof confidence (2/6), whose text asks for successful real Control UI background-exec delivery, settlement and reconnect diagnostics, and inspected sanitized before/after screenshots. The live arms above are offered against exactly that item.

Limitations

Stated plainly rather than buried:

  • The live arms were re-run on the current head cb4e63b5 (scripted control plus Claude Sonnet 5 on the relay turn); the earlier parent-only limitation no longer applies.
  • The scripted control arms script only the model call. The h-arms use a real model on the heartbeat relay turn; a real model on the exec-starting turn is not reachable through the claude-cli backend (it does not expose OpenClaw exec).
  • The unresolvable-target regression is not reachable from a static schema-valid config, as far as I could establish. See Blast radius.
  • No full pnpm lint, no full test suite. A type-aware oxlint pass over src/infra and a 36-file heartbeat plus gateway vitest run were used instead.
  • The gateway boundary test has no target: "none" case. It runs with heartbeat: { every: "5m", target: "last" }. The suppression proof sits one layer below the WebSocket, at the onSessionTranscriptUpdate listener that feeds it, and is now also shown end to end by arm 3. Happy to add the boundary case if the assertion is wanted at the WebSocket layer.
  • The receipt reconciliation branches are covered at unit level only. The assistantTranscriptOwned and source-mirror paths are exercised by heartbeat-session-publication.test.ts fixtures, not by a run against a real CLI or Codex runtime. "Closes [Bug]: exec-completion wake succeeds but visible reply is dropped in WebChat / Companion #147387" is claimed on the basis that the settlement path is shared, not on a reproduction against the reporter's own runtime.

No merge is being attempted.


View the OpenClaw team session

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. size: S labels Sep 14, 2026
@vincentkoc vincentkoc self-assigned this Sep 14, 2026

@vincentkoc vincentkoc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still does not safely deliver an exec completion to WebChat.

  1. The no-channel path cannot settle success. src/infra/heartbeat-dispatch.ts:564-572 returns visibleReplySent: false; src/auto-reply/reply/reply-dispatch-outcome.ts:56-68 maps that to delivered-not-visible; and src/infra/heartbeat-dispatch.ts:516-555 consequently calls finish(..., false). The run reports ran, but the exact exec event is not consumed (src/infra/heartbeat-dispatch.ts:276-306), so a later wake can rerun the turn and duplicate the completion.

  2. conversationEntry.delivery.kind === "internal" is not a WebChat discriminator. src/config/sessions/types.ts:71-80 uses this state for internal sessions generally, including hidden internal-effects sessions (src/agents/internal-session-effects.ts:63-108). Please use an explicit client-visible internal projection fact instead of widening relay eligibility for all internal sessions.

  3. The new tests in src/infra/heartbeat-runner.webchat-exec-completion.test.ts:8-82 prove only prompt wording. They do not prove transcript/Gateway projection, exact-event consumption, dedupe, reconnect history, stale-session fencing, or hidden-session exclusion.

Please revise at the owning boundary: carry an explicit client-visible internal projection target or receipt, deliver through the canonical session transcript/Gateway projection path, and consume the exact event only after the owner confirms an idempotent accepted write for the current session lifecycle.

Required proof: exactly one completion for an active subscriber; exactly one history entry after disconnected reconnect; event consumption only after success; no duplicate on a second wake; stale/reset and hidden-internal sessions remain fenced; external-channel, cron, and failed-turn behavior remains unchanged.

Exact-head CI is also red for related lint and test-type failures:

The PR-context gate requires an authored ## What Problem This Solves section:

ClawSweeper produced no verdict because its exact-head input scan timed out:

@etzelm

etzelm commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review — all three points are addressed in d80e6ff:

  1. Event consumption / duplicate-relay risk: deliverHeartbeatDispatch returned visibleReplySent: false unconditionally for delivery.channel === "none", which the settle callback maps to consume: false, leaving the triggering exec-completion system event pending for a later wake to relay again. Fixed by reporting visibleReplySent: isWebChatExecCompletion === true in that branch — the reply already lands in the session's own transcript via the normal turn-completion path (independent of this function, which is specifically about external-channel sends), so the event is now correctly consumed here too.

  2. delivery.kind === "internal" was too broad: it also covers hidden internal-effects sessions (internal-session-effects.ts, voice bare rows). isWebChatExecCompletion now additionally requires createdVia !== "internal" — the provenance field those hidden sessions stamp at creation, which a real WebChat/Companion session never has. Added a regression test (does not relay into a hidden internal-effects session sharing the same delivery.kind) proving it still gets the suppressed prompt.

  3. Test depth: added the hidden-session test above for the scoping question. I don't yet have a direct unit test asserting deliverHeartbeatDispatch's return value or an integration test proving "no duplicate on a second wake" end-to-end — deliverHeartbeatDispatch's inputs are large derived types (not simple hand-constructible interfaces), so a clean direct test needs either a builder helper or the real-gateway integration harness I documented as a stretch goal in the PR body. Flagging this as still open rather than claiming coverage that isn't there — let me know if it's blocking and I'll build it.

Also fixed the exact-head CI failures from the same push: an unnecessary Boolean() wrapper (no-unnecessary-type-conversion), two test seed calls missing fields that became required on HeartbeatSessionSeed upstream since this branch's base, and renamed the PR body's ## Summary to ## What Problem This Solves for the required-section gate.

Full re-verification (targeted tests, full heartbeat suite 501/501, gateway chat suite 235/235, both failing CI type-check stripes, both failing lint stripes, full build) is in the updated PR body under "Review Response (2026-09-14)".

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. 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 Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 17, 2026, 5:32 PM ET / 21:32 UTC (Revision 12).

ClawSweeper review

What this changes

The PR publishes background-command completion replies into eligible WebChat sessions, settles their events after transcript acceptance, and preserves legacy media replay.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: the defect remains on main, and this PR provides a useful repair with sufficient current-head proof and no actionable patch findings.

Priority: P1
Reviewed head: 7e22264fa0ee40084afa45f59825a7e4510fd0d5
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong production-path proof and meaningful lifecycle/replay coverage support a good patch with no remaining correctness finding.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The exact-head AWS run exercised browser approval, real background exec, heartbeat publication, SQLite persistence, and Gateway history, observing one reply connected and after reopening/reload. Reported runtime diagnostics and four inspected screenshots resolve the prior proof gap; the provider was deterministic, and historical live-model and upgrade observations retain their original revision scope.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The exact-head AWS run exercised browser approval, real background exec, heartbeat publication, SQLite persistence, and Gateway history, observing one reply connected and after reopening/reload. Reported runtime diagnostics and four inspected screenshots resolve the prior proof gap; the provider was deterministic, and historical live-model and upgrade observations retain their original revision scope.
Evidence reviewed 9 items Pinned source and complete body: The checkout and live PR head are 7e22264. The full 37,527-unit body was read; its SHA-256 matches the supplied snapshot, 69aa3b6e1195b878581b4bb03ded24719e9b06cd0491a203247b31621f58bc67. Review used the pinned merge-base delta, not the stale test merge.
Repair remains necessary on main: Current main still requires an external channel and recipient for relay eligibility, and its channel-less dispatcher returns visibleReplySent:false. The supplied merged related PRs concern other repairs; the historical WebChat proposal was closed unmerged.
Latest release retains the defect: The v2026.9.4 source also requires delivery.channel !== "none", delivery.to, and visibility.showAlerts at lines 397–399. The repair is not established as shipped.
Findings None None.
Security None None.

How this fits together

Background command completions wake OpenClaw’s heartbeat runner, which prepares a reply and chooses its delivery path. This change connects eligible internal conversations to the existing transcript owner, feeding live Gateway notifications and reconnect history.

flowchart TD
  A[Background command completes] --> B[Heartbeat wake]
  B --> C{Eligible conversation and delivery enabled}
  C -->|No| D[Preserve suppression]
  C -->|Yes| E[Validate session and writer]
  E --> F[Commit or reconcile transcript reply]
  F --> G[Live notification and reconnect history]
  F --> H[Settle accepted completion event]
Loading

Decision needed

Question Recommendation
Does the revised publication implementation and current-head connected/reconnect proof satisfy vincentkoc’s outstanding changes-requested review? Accept the revised repair: Update the blocking review if the receipt-based settlement, session exclusions, and supplied proof satisfy the original requests.

Why: The concrete concerns appear addressed, but an automated review cannot replace the human reviewer’s disposition.

Before merge

  • Complete next step (P2) - Have vincentkoc reassess and disposition the outstanding changes-requested review against the current implementation and fresh Gateway/UI evidence.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +383, Tests +1915, Other 0. Total +2298 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 12 448 65 +383
Tests 5 1915 0 +1915
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 18 2364 66 +2298

Review metrics

Metric Value Why it matters
Production versus regression coverage production +383 net lines; tests +1,915 net lines Production growth implements guarded publication and replay compatibility, with most added code devoted to regression coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #147387
Summary: This PR is the implementation candidate for the current WebChat completion report; historical routing proposals do not supersede it.

Members:

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

Technical review

Best possible solution:

Keep completion publication under the canonical transcript owner, with one accepted reply per occurrence and preserved suppression, session fencing, and legacy replay.

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

Yes: an internal WebChat session with target:last reaches main’s external-route-only relay check and channel-less rejection. The report and historical browser differential corroborate this; no current-main execution was performed in this review.

Is this the best way to solve the issue?

Yes: the repair uses the existing transcript and delivery owners, confirms an accepted receipt before settlement, and preserves explicit suppression and upgrade replay behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 928dba98c56a.

Labels

Label justifications:

  • P1: Background commands complete successfully but their results remain invisible to affected WebChat users on the current release.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The exact-head AWS run exercised browser approval, real background exec, heartbeat publication, SQLite persistence, and Gateway history, observing one reply connected and after reopening/reload. Reported runtime diagnostics and four inspected screenshots resolve the prior proof gap; the provider was deterministic, and historical live-model and upgrade observations retain their original revision scope.
  • proof: sufficient: Contributor real behavior proof is sufficient. The exact-head AWS run exercised browser approval, real background exec, heartbeat publication, SQLite persistence, and Gateway history, observing one reply connected and after reopening/reload. Reported runtime diagnostics and four inspected screenshots resolve the prior proof gap; the provider was deterministic, and historical live-model and upgrade observations retain their original revision scope.

Evidence

What I checked:

  • Pinned source and complete body: The checkout and live PR head are 7e22264. The full 37,527-unit body was read; its SHA-256 matches the supplied snapshot, 69aa3b6e1195b878581b4bb03ded24719e9b06cd0491a203247b31621f58bc67. Review used the pinned merge-base delta, not the stale test merge. (7e22264fa0ee)
  • Repair remains necessary on main: Current main still requires an external channel and recipient for relay eligibility, and its channel-less dispatcher returns visibleReplySent:false. The supplied merged related PRs concern other repairs; the historical WebChat proposal was closed unmerged. (src/infra/heartbeat-runner-execution.ts:394, 928dba98c56a)
  • Latest release retains the defect: The v2026.9.4 source also requires delivery.channel !== "none", delivery.to, and visibility.showAlerts at lines 397–399. The repair is not established as shipped. (src/infra/heartbeat-runner-execution.ts:397, 3a9d69db306c)
  • Publication and authority boundary: Publication revalidates the captured session generation, writer, cancellation, and active transcript before persistence, inside the transaction, and before synchronous notification. Dispatch reports success only after acceptance. Production-owner tests cover foreign receipt targets, writer replacement, cancellation, reset, archive, and abandoned rows. (src/infra/heartbeat-session-publication.ts:224, 7e22264fa0ee)
  • Fresh production-path proof: fix(infra): relay exec-completion replies on WebChat-internal sessions #148360 (comment) records the exact-head AWS run through browser approval, real background processes, heartbeat dispatch, SQLite persistence, and Gateway sockets. It observed one connected notification and one persisted reply after disconnected reopening and reload. All four linked screenshots were independently fetched and visually inspected; their visible states match those scenarios. The provider was a deterministic fixture. The comment records successful execution of 569 regression tests and screenshot delivery in the originating chat. (src/infra/heartbeat-dispatch.ts:582, 7e22264fa0ee)
  • Prior replay finding addressed: Legacy mirrors without media identity compare using their original representation while preserving accepted bytes; new explicit media identity remains strict. The tests cover reopen, identical replay, and conflicting text/media. fix(infra): relay exec-completion replies on WebChat-internal sessions #148360 (comment) supplies the historical v2026.9.4-store replay observations on cb4e63b; the two relevant production files are unchanged between that revision and the reviewed head. (src/config/sessions/session-accessor.sqlite-transcript-message-append.ts:42, 7e22264fa0ee)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

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

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-17T00:55:07.832Z sha 4269449 :: needs real behavior proof before merge. :: [P2] Preserve identical replay of pre-upgrade media mirrors
  • reviewed 2026-09-17T01:52:47.582Z sha cb4e63b :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-17T02:43:26.267Z sha cb4e63b :: blocked before merge. :: none
  • reviewed 2026-09-17T02:52:42.918Z sha cb4e63b :: blocked before merge. :: none
  • reviewed 2026-09-17T03:56:13.556Z sha cb4e63b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T19:08:35.326Z sha c6bb459 :: blocked before merge. :: none
  • reviewed 2026-09-17T19:17:04.380Z sha c6bb459 :: blocked before merge. :: none
  • reviewed 2026-09-17T20:08:24.839Z sha 7e22264 :: blocked before merge. :: none

etzelm and others added 4 commits September 16, 2026 14:56
- Extract the indicatorType condition from prepareHeartbeatDispatchReply
  into a named helper function shouldSetIndicator for improved readability

- The helper clearly documents when each indicator type is returned:
  'alert' when alerts are disabled, 'sent' when delivery succeeds,
  undefined in all other cases
- Consume the triggering system event for a WebChat exec-completion
  reply too. deliverHeartbeatDispatch previously reported
  visibleReplySent: false unconditionally for channel === "none",
  which the settle callback maps into consume: false, leaving the
  event pending and letting a later wake relay the same completion
  again. Report it as visibly sent specifically for the
  isWebChatExecCompletion case, since the reply already reached the
  session's own transcript via the ordinary turn-completion path.

- Narrow isWebChatExecCompletion so it cannot match hidden
  internal-effects sessions. delivery.kind === "internal" also covers
  sessions created by internal-session-effects.ts and voice bare rows,
  which are never a real WebChat/Companion client. Exclude sessions
  explicitly created via that path (createdVia === "internal").

- Add a regression test proving a hidden internal-effects session
  (createdVia: "internal") still gets the original suppressed prompt,
  not the relay prompt.

- Fix two exact-head CI failures: an unnecessary Boolean() wrapper
  flagged by no-unnecessary-type-conversion, and two test-file
  HeartbeatSessionSeed seed calls missing the now-required
  lastProvider/lastTo fields (upstream main added them as required
  since this branch's base).
@jalehman
jalehman force-pushed the fix/webchat-exec-completion-reply branch from d80e6ff to 1148b94 Compare September 16, 2026 22:38
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: XL and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. size: S labels Sep 16, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Sep 16, 2026
@etzelm

etzelm commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for picking this up @jalehman — the publication-receipt approach is right, and it matches where I'd independently landed after a few iterations (settling on a confirmed transcript write rather than inferring delivery).

I'm still actively working this one and have a revision close. Specifically I'm on the target: "none" suppression bypass ClawSweeper just flagged at heartbeat-runner-execution.ts:417-419, plus the before/after WebChat proof it's asking for.

So we don't duplicate effort or race each other's pushes: I'd like to take the next revision. Very happy to hand it over if you'd rather own it — just want to avoid us both writing the same patch. Either way, shout and I'll follow your lead.

Should have something up shortly.

@jalehman

jalehman commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

@etzelm — thanks for flagging the overlap. Please take the next revision; I am holding my push so we do not race. I have a reviewed follow-up against 1148b94e7e77731d590fc9ed87403247c95a931d ready for you to incorporate or compare below.

It covers both the explicit target:none regression and the broader CI media-conflict regression:

  • Exclude explicit suppression at internalProjection eligibility, with the same WebChat session exercised under none then last.
  • Record media identity in the canonical assistant-message constructor rather than a metadata-only beforeMessageWrite hook. That hook was selecting the replay exception and disabling the conflicting-writer rejection.
  • Use strict replay identity for all explicitly keyed mirrors; retain text-only suppression for unkeyed mirrors. Added changed-media/changed-text rejection and identical replay coverage.

Validation: the suppression regression failed before repair (1 failed / 20 passed); the repaired runtime snapshot passed 190 focused tests. After correcting the new test's typed event reader and formatter output, the final patch passed every changed-file gate, including core and core-test types, lint, dead exports, boundaries and ratchets (sanitized direct AWS run run_444648ef9d69, exit 0). Fresh independent static review is scoped-clean through P2. The validation lease has been released. Follow-up production delta: −17 lines.

Patch SHA256: aeaa490fb16bf63e805576a3182225a6b9ad186619fb3247cc936ff04eee8fc7.

Real Control UI proof remains outstanding: my previous attempt reached the UI but the exec failed before the expected approval, so it is not successful completion proof. I will not start a competing proof run while you own the next revision. Once your revision/proof is posted, I can reconcile the remaining checks and evidence against that exact head. No merge is being attempted.

Additional current-head CI result

The remaining checks-node-compact-small-39 failure is separate from the repaired media-conflict case: test/scripts/package-acceptance-workflow.test.ts:6241, case keeps verifier success separate from postpublish success completion, returned subprocess status null instead of 0 (1 failed / 1500 passed). Its fixture has a 10-second subprocess deadline; the case took 11.24 seconds, but the log does not expose the process error/signal, so timeout causality remains unverified. The test and inspected release workflow/helper paths are unchanged against pinned base 75ba5e3fae5c8aa543e65557db51ce0d0f7b1199. That base's CI run 35158514283 was canceled with zero jobs, so I cannot claim it passed or failed there. No rerun, rebase, or competing source edit has been started.

Validated six-file follow-up patch against 1148b94
diff --git a/config/assertion-safety-baseline.txt b/config/assertion-safety-baseline.txt
index d170d0f8d57..6aa9de15e2c 100644
--- a/config/assertion-safety-baseline.txt
+++ b/config/assertion-safety-baseline.txt
@@ -2526,7 +2526,7 @@ src/config/sessions/transcript-recent-window.ts	1
 src/config/sessions/transcript-replay.ts	1
 src/config/sessions/transcript-stream.ts	1
 src/config/sessions/transcript-tree.ts	3
-src/config/sessions/transcript.ts	15
+src/config/sessions/transcript.ts	14
 src/config/sessions/types.ts	1
 src/config/state-dir-dotenv.ts	1
 src/config/talk.ts	1
diff --git a/src/config/sessions/transcript.ts b/src/config/sessions/transcript.ts
index fa0f067ec27..e31eca4cbc9 100644
--- a/src/config/sessions/transcript.ts
+++ b/src/config/sessions/transcript.ts
@@ -49,6 +49,7 @@ import type {
   SessionLifecycleRevisionExpectation,
   SessionTranscriptTurnLifecyclePatch,
 } from "./session-transcript-turn-lifecycle.types.js";
+import { recordAssistantManagedMediaUrls } from "./transcript-assistant-delivery.js";
 import {
   applyBeforeMessageWriteToAssistant,
   type AssistantBeforeMessageWrite,
@@ -454,7 +455,7 @@ export async function appendAssistantMessageToSessionTranscript(params: {
     config: params.config,
     ...(params.beforeMessageWrite ? { beforeMessageWrite: params.beforeMessageWrite } : {}),
     message: {
-      role: "assistant" as const,
+      ...recordAssistantManagedMediaUrls({ role: "assistant" as const }, params.mediaUrls),
       content,
       ...(displayContent ? { [ASSISTANT_DISPLAY_CONTENT_FIELD]: displayContent } : {}),
       api: OPENCLAW_TRANSCRIPT_ARTIFACT_API,
@@ -580,22 +581,20 @@ export async function appendExactAssistantMessageToSessionTranscript(params: {
         reason: "blocked by before_message_write",
       };
     }
-    const identifiedDeliveryMirror =
-      Boolean(explicitIdempotencyKey) && isIdentifiedDeliveryMirror(params.message);
     const target: SessionTranscriptAppendTarget = {
       ...(transcriptAgentId ? { agentId: transcriptAgentId } : {}),
       sessionId: currentEntry.sessionId,
       sessionKey: resolved.normalizedKey,
       storePath,
     };
-    if (isRedundantDeliveryMirror(params.message) && !identifiedDeliveryMirror) {
+    if (isRedundantDeliveryMirror(params.message) && !explicitIdempotencyKey) {
       // Reconciliation needs the writer queue. Wait before entering it, then
       // read the current projected tail again inside the guarded append.
       await waitForSessionTranscriptProjection(target);
     }
     let latestEquivalentAssistantId: string | undefined;
-    // Identified delivery mirrors, including suppressed finals, dedupe only by
-    // key so same-text markers from different source ids remain separate rows.
+    // Keyed mirrors use strict replay identity; text-only suppression must not
+    // hide conflicting media or collapse distinct source messages.
     const turn = await persistSessionTranscriptTurn(
       {
         sessionId: currentEntry.sessionId,
@@ -642,7 +641,7 @@ export async function appendExactAssistantMessageToSessionTranscript(params: {
               : {}),
             shouldAppend: async (appendTarget) => {
               latestEquivalentAssistantId =
-                isRedundantDeliveryMirror(params.message) && !identifiedDeliveryMirror
+                isRedundantDeliveryMirror(params.message) && !explicitIdempotencyKey
                   ? await findLatestEquivalentAssistantMessageId(
                       appendTarget,
                       preparedUnkeyedMessage as SessionTranscriptAssistantMessage,
@@ -761,18 +760,6 @@ async function readLatestVisibleTranscriptMessage(scope: {
   }
 }
 
-function isIdentifiedDeliveryMirror(message: SessionTranscriptAssistantMessage): boolean {
-  const marker = (message as { openclawDeliveryMirror?: InternalSessionTranscriptDeliveryMirror })
-    .openclawDeliveryMirror;
-  return (
-    isRedundantDeliveryMirror(message) &&
-    (marker?.kind === "channel-final" ||
-      marker?.kind === "channel-final-suppressed" ||
-      marker?.kind === "message-tool-source-reply" ||
-      marker?.kind === CRON_DIRECT_DELIVERY_CONTEXT_KIND)
-  );
-}
-
 function extractAssistantMessageText(message: AgentMessage): string | null {
   if (message.role !== "assistant" || !Array.isArray(message.content)) {
     return null;
diff --git a/src/gateway/internal-source-reply-persistence.ts b/src/gateway/internal-source-reply-persistence.ts
index 0188666f2bc..f597f78390b 100644
--- a/src/gateway/internal-source-reply-persistence.ts
+++ b/src/gateway/internal-source-reply-persistence.ts
@@ -14,7 +14,6 @@ import {
   readTranscriptEventMessage,
 } from "../config/sessions/session-accessor.sqlite-read.js";
 import { sessionMatchesExpectedTranscriptTurn } from "../config/sessions/session-transcript-turn-state.js";
-import { recordAssistantManagedMediaUrls } from "../config/sessions/transcript-assistant-delivery.js";
 import { getOwnedSessionTranscriptWriterFence } from "../config/sessions/transcript-write-context.js";
 import type { OpenClawConfig } from "../config/types.openclaw.js";
 import { getAgentScopedMediaLocalRootsForSources } from "../media/local-roots.js";
@@ -188,11 +187,7 @@ export async function persistInternalSourceReply(params: {
         ...(writerFence ? { expectedWriterRunId: writerFence.expectedWriterRunId } : {}),
         content: retainAssistantModelContent(content),
         displayContent: content,
-        beforeMessageWrite: ({ message }) =>
-          recordAssistantManagedMediaUrls(
-            message,
-            media.map((item) => item.url),
-          ),
+        mediaUrls: media.map((item) => item.url),
         idempotencyKey: params.idempotencyKey,
         runId: params.runId,
         ...(params.sourceReplyFinal !== undefined
diff --git a/src/infra/heartbeat-runner-execution.ts b/src/infra/heartbeat-runner-execution.ts
index 6d1ecc4150d..c158d6ce334 100644
--- a/src/infra/heartbeat-runner-execution.ts
+++ b/src/infra/heartbeat-runner-execution.ts
@@ -338,6 +338,7 @@ export async function prepareHeartbeatRunStage(wake: ReadyHeartbeatWake) {
   // Capture the client-owned generation before routing can await. The inspected
   // completion queue owns publication eligibility, not the coalesced wake source.
   const internalProjection =
+    heartbeat?.target !== "none" &&
     scheduledTasks.length === 0 &&
     preflight.shouldInspectPendingEvents &&
     preflight.pendingEventEntries.some((event) => isExecCompletionEvent(event.text)) &&
diff --git a/src/infra/heartbeat-runner.webchat-exec-completion.test.ts b/src/infra/heartbeat-runner.webchat-exec-completion.test.ts
index 68b1fb33a71..3975e472fdd 100644
--- a/src/infra/heartbeat-runner.webchat-exec-completion.test.ts
+++ b/src/infra/heartbeat-runner.webchat-exec-completion.test.ts
@@ -309,6 +309,42 @@ async function readProjectionMessages(scenario: ProjectionScenario) {
   return events.map(readTranscriptEventMessage).filter((message) => message?.role === "assistant");
 }
 
+it("preserves explicit target:none before target:last delivers in the same WebChat session", async () => {
+  await withProjectionScenario(async (scenario) => {
+    const heartbeat = scenario.cfg.agents?.defaults?.heartbeat;
+    if (!heartbeat) {
+      throw new Error("projection scenario heartbeat is missing");
+    }
+    for (const target of ["none", "last"] as const) {
+      heartbeat.target = target;
+      const marker = `EXPLICIT_TARGET_${target}`;
+      enqueueSystemEvent(`Exec completed (target-proof, code 0) :: ${marker}`, {
+        sessionKey: scenario.sessionKey,
+      });
+      const reply = vi.fn<NonNullable<HeartbeatDeps["getReplyFromConfig"]>>().mockResolvedValue(
+        createHeartbeatToolResponsePayload({
+          outcome: "done",
+          notify: true,
+          summary: "private",
+          notificationText: marker,
+        }),
+      );
+      await runProjectionWake(scenario, reply);
+      expect(reply).toHaveBeenCalledOnce();
+      const context = reply.mock.calls[0]?.[0];
+      const messages = await readProjectionMessages(scenario);
+      if (target === "none") {
+        expect(messages).toEqual([]);
+        expect(context?.Body).toContain("user delivery is disabled");
+      } else {
+        expect(messages).toHaveLength(1);
+        expect(JSON.stringify(messages[0]?.content)).toContain(marker);
+        expect(context?.Body).toContain("Please relay the command output to the user");
+      }
+    }
+  });
+});
+
 it.each([
   {
     name: "queued exec completion inspected by a manual wake",
diff --git a/src/config/sessions/transcript.media-identity.test.ts b/src/config/sessions/transcript.media-identity.test.ts
new file mode 100644
index 00000000000..a8384cb7123
--- /dev/null
+++ b/src/config/sessions/transcript.media-identity.test.ts
@@ -0,0 +1,55 @@
+import { describe, expect, it } from "vitest";
+import { loadTranscriptEvents, replaceSessionEntry } from "./session-accessor.js";
+import { readTranscriptEventMessage } from "./session-accessor.sqlite-read.js";
+import { useTempSessionsFixture } from "./test-helpers.js";
+import { appendAssistantMessageToSessionTranscript } from "./transcript.js";
+
+describe("assistant mirror media identity", () => {
+  const fixture = useTempSessionsFixture("transcript-media-identity-");
+
+  it.each([false, true])("records media identity with content=%s", async (explicitContent) => {
+    const scope = {
+      agentId: "main",
+      sessionId: "media-session",
+      sessionKey: "agent:main:media",
+      storePath: fixture.storePath(),
+    };
+    await replaceSessionEntry(scope, { sessionId: scope.sessionId, updatedAt: 1 });
+    const params = {
+      ...scope,
+      expectedSessionId: scope.sessionId,
+      idempotencyKey: "media-reply",
+      text: "Chart",
+      ...(explicitContent ? { content: [{ type: "text" as const, text: "Chart" }] } : {}),
+      mediaUrls: ["https://example.com/chart.png"],
+    };
+    const first = await appendAssistantMessageToSessionTranscript(params);
+    expect(first.ok).toBe(true);
+    expect(await appendAssistantMessageToSessionTranscript(params)).toEqual(first);
+    await expect(
+      appendAssistantMessageToSessionTranscript({
+        ...params,
+        mediaUrls: ["https://different.example/chart.png"],
+      }),
+    ).rejects.toThrow("conflicts with the admitted message");
+    await expect(
+      appendAssistantMessageToSessionTranscript({
+        ...params,
+        text: "Different",
+        ...(explicitContent ? { content: [{ type: "text" as const, text: "Different" }] } : {}),
+      }),
+    ).rejects.toThrow("conflicts with the admitted message");
+    const events = await loadTranscriptEvents(scope);
+    expect(
+      events.filter((event) => readTranscriptEventMessage(event)?.role === "assistant"),
+    ).toEqual([
+      expect.objectContaining({
+        message: expect.objectContaining({
+          role: "assistant",
+          openclawDelivery: { mediaUrls: params.mediaUrls },
+          content: [{ type: "text", text: explicitContent ? "Chart" : "Chart\nchart.png" }],
+        }),
+      }),
+    ]);
+  });
+});

@jalehman

Copy link
Copy Markdown
Contributor

@etzelm — updating our coordination: I am taking the next repair revision back now to publish the validated suppression/media-replay fixes and address the remaining CI feedback. Please hold branch pushes while I publish; I will check the remote head and use an explicit expected-head lease so your work cannot be overwritten. Please share any additional local changes or proof you have prepared so I can reconcile them. I will post the resulting SHA and remaining evidence here. No merge is being attempted.

jalehman and others added 2 commits September 16, 2026 17:14
- Replaces the config-level `heartbeat?.target !== "none"` guard added in
  4572570 with a resolver-level gate: `projectionCandidate` is still captured
  before the routing await, and `internalProjection` is derived after it from
  `delivery.reason === "target-none"`.
- The config check missed the explicit-but-unresolvable target. In
  src/infra/outbound/targets.ts:231 an explicit `target` string starts at
  "none"; a value that is not none/last/owner and not a deliverable channel
  falls through :236-241 with no `to`, so :257-260 returns
  `reason: "target-none"` while `heartbeat.target` is still that string.
  Such a run projected the completion into the WebChat session.
- Gating on the resolver verdict suppresses both cases at once, covering the
  relay prompt, `deliverHeartbeatDispatch` publication, and settlement
  bookkeeping, which all read `internalProjection`.
- Adds three arms asserting `getLastHeartbeatEvent()` and the
  `onSessionTranscriptUpdate` emission the gateway fans out as
  `session.message`, layers the existing prompt/row test does not reach.
  The unresolvable-target arm fails on 4572570 and passes here.
- Keeps jalehman's prompt/row test and media-identity work unchanged.
@clawsweeper clawsweeper Bot added 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. labels Sep 17, 2026
@etzelm

etzelm commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

CI triage for run 35171694990 (head cb4e63b5)

Zero of the 11 failing checks are attributable to this PR's code. I went through all 11 job logs. No failing test or lint rule names any file this branch touches, and the two that look most damning are both main-side regressions that main has already fixed.

The structural fact that explains it

CI does not test the PR head. It tests a merge commit, and main moved between the two runs on this branch:

$ git log -1 --format='%H %P' 967c6e06de44fb77b86c20ca9e6342175be8699a   # run 35171694990
967c6e06de44... 1fbb41545ec513156ec8da020bb61852f519c8cf cb4e63b5e052...

$ git log -1 --format='%H %P' f955ce1afc6bfb2b672e515d4462fb1550234cb4   # run 35168002167
f955ce1afc6b... 4e44dbfb428ad11cb20dbaf9ba82b87be7853651 4269449199...

Run 35168002167 merged against main at 4e44dbfb. Run 35171694990 merged against 1fbb41545ec. Every check that is newly failing versus the earlier run is explained by that advance. The breakage was also fixed on main about 36 minutes later, so this is a narrow window rather than a standing problem.

The two that look worst, resolved

Both fire on extensions/slack/src/monitor/**. This PR touches 17 files, none of them under extensions/ or scripts/.

check-lint-core-5 is typescript(unbound-method) at extensions/slack/src/monitor/message-handler/dispatch.ts:623:49:

extensions/slack/src/monitor/message-handler/dispatch.ts
  623:49  error  Avoid referencing unbound methods which may cause unintentional scoping of `this`.  typescript(unbound-method)

Line 623 at the merge head is onApprovalEvent: progress.progressDraft.pushApprovalEvent,, added by a90b969ae26 (#150407). Fixed on main by a13ecd23b32, which rewrites it to onApprovalEvent: (payload) => progress.progressDraft.pushApprovalEvent(payload),.

A job-name trap worth flagging, because it will otherwise mislead anyone reading this job. check-lint-core-5 passed its own core stripe and failed in an extensions stripe:

[oxlint:core:stripe:5] passed
[oxlint:extensions:04] passed
[oxlint:extensions:10] passed
[oxlint:extensions:16] failed

The job name says "core" while the failure is in extensions shard 16. Shard numbers and job names are not comparable across runs. Compare by test name and by rule.

check-additional-runtime-topology-architecture is pnpm check:madge-import-cycles:

Import cycle check: 0 runtime value cycle(s).
Madge import cycle check: 1 cycle(s).

# cycle 1
  extensions/slack/src/monitor/ingress.ts
  -> extensions/slack/src/monitor/thread-resolution.ts

The closing edge is ingress.ts:19 import { isTransientSlackThreadLookupError } from "./thread-resolution.js", added by edc1fa85c6c (#150457). The back edge is thread-resolution.ts:25 import type { SlackIngressTurnLifecycle } from "./ingress.js". The back edge being type-only is why check:import-cycles reports 0 runtime cycles while madge reports 1. Fixed on main by the same a13ecd23b32, which extracts extensions/slack/src/monitor/ingress.types.ts and repoints the type import.

a13ecd23b32 lands under #111148, whose title is about Discord thread rejoin, but its diff carries both Slack fixes. It is not an ancestor of merge head 967c6e06, which is exactly why this run still sees both.

All 11 checks

Check Failing test or rule Verdict Evidence
check-lint-core-5 typescript(unbound-method) at dispatch.ts:623:49 caused by main, already fixed Introduced by a90b969ae26 (#150407), fixed by a13ecd23b32. Job 105044773505
check-additional-runtime-topology-architecture madge: 1 cycle, ingress.ts -> thread-resolution.ts caused by main, already fixed Introduced by edc1fa85c6c (#150457), fixed by a13ecd23b32. Job 105044773603
checks-node-compact-small-15 test/scripts/worktree-setup.test.ts, 16 tests, Cannot find module .../scripts/lib/bundled-plugin-source-utils.mts caused by main Import added by aceff326809 (#148907); the synthetic fixture repo does not copy the new file. In this merge head, absent from the prior run's base. Job 105044777240
checks-node-compact-small-40 test/scripts/pr-wrappers.test.ts:886, ERR_MODULE_NOT_FOUND for src/plugins/discovery-availability.js caused by main, already fixed scripts/pr-lib/wrapper-components.txt was missing the entry; c5cff2f122e (#150453) adds it. Job 105044779123
checks-node-compact-small-24 test/scripts/pr-operation-lock.test.ts, 2 tests pre-existing Identical test names failed in run 35168002167 job 105033512339, before cb4e63b5 existed. Job 105044777195
checks-node-compact-small-26 test/scripts/pr-main-refresh.test.ts, 7 tests pre-existing Identical test names in prior run job 105033512454. Job 105044777196
checks-node-compact-small-42 test/scripts/pr-worktree-provision.test.ts, 17 tests pre-existing Identical test names in prior run job 105033514283 (shard small-39, different number, same tests). Job 105044779180
checks-node-changed-extensions-bundle-11 extensions/qwen/video-generation-provider.test.ts:74, expected 119999 to be 120000 repo-wide flake Same assertion and same numbers on unrelated branch fix/session-projection-convergence, run 35173901358 job 105051431092. Job 105044774837
checks-node-compact-large-20 src/infra/session-delivery-queue-runtime.test.ts:709, expected "vi.fn()" to be called 1 times, but got 0 times flake, not this PR Fake-timer retry race. The module under test imports nothing in this diff; this PR's only src/infra/ files are heartbeat-*. Job 105044775064
control-ui-performance startup JS gzip: 354.2 KiB exceeds 354.1 KiB repo-wide baseline drift Measured 362706 B against limit 362588 B. Fails on five unrelated branches in the same window. Job 105044773470
openclaw/ci-gate rollup only derived, no independent signal Body is failures=0 ... exit "$failures" over other jobs' results. Clears automatically once its inputs clear. Job 105049942664
Longer evidence strings

checks-node-compact-small-15, at test/scripts/worktree-setup.test.ts:324:44:

AssertionError: Cannot find module '<tmp>/repo/scripts/lib/bundled-plugin-source-utils.mts'
imported from '<tmp>/repo/scripts/lib/static-extension-assets.mts'

The edge comes from aceff326809:

+import { collectTrackedBundledPluginSourceCandidates } from "./bundled-plugin-source-utils.mts";

checks-node-compact-small-40, at test/scripts/pr-wrappers.test.ts:886:37:

AssertionError: expected 'node:internal/modules/esm/resolve:271...' to contain 'Usage: worktree-provision.mts'
+ Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../src/plugins/discovery-availability.js'
  imported from .../src/plugins/discovery.ts

The entire diff of c5cff2f122e (#150453) is three added lines to scripts/pr-lib/wrapper-components.txt, one of which is +src/plugins/discovery-availability.ts.

control-ui-performance enforcement math: baseline 362012 B in config/control-ui-startup-budget-baseline.json, plus 512 B growth allowance, plus 64 B build variance, gives 362588 B. Measured 362706 B. The five unrelated branches failing it in the same window are runs 35174188849 (codex/sqlite-mcp-prefix-filter-0916), 35173963121 (fix/show-categorized-spawned-sessions), 35173901358 (fix/session-projection-convergence), 35173683868 (fix/chat-history-sanitize-input-image) and 35174266725 (refactor/ui-config-factory-contracts).

openclaw/ci-gate emits ::error title=CI job did not succeed for control-ui-performance, checks-node-core-test-nondist-shard, check-lint-hosted-core-shard and check-additional-shard.

What clears on a rebase, and what does not

main at a434e7f53f5 carries a13ecd23b32 (Slack cycle and unbound method), c5cff2f122e (pr-wrappers manifest) and the tooling fixture fixes. Main push run 35174052050 at that SHA is green on all 49 compact shards, both check-lint-core-* jobs, and check-additional-runtime-topology-architecture.

Everything except control-ui-performance should clear on a rebase onto main at or after a434e7f53f5.

control-ui-performance will not clear. The committed baseline in config/control-ui-startup-budget-baseline.json has drifted repo-wide and needs a maintainer-approved bump. Two things make it easy to miss: main push runs skip that job entirely (it is skipped on run 35174052050), which is why main never surfaces it, and it fails on five unrelated branches in the same window. It blocks every PR in this window, not just this one.

Two genuine flakes worth their own issues

Both unrelated to this PR:

  1. extensions/qwen/video-generation-provider.test.ts:74 asserts expect(request.timeoutMs).toBe(120_000) against a deadline-derived timeout and loses to 1 ms of clock drift, giving expected 119999 to be 120000.
  2. src/infra/session-delivery-queue-runtime.test.ts:709 races a fake-timer retry: await vi.advanceTimersByTimeAsync(0); await stop(); then asserts the delivery happened.

Correction to my earlier comment

My previous comment said pr-wrappers.test.ts "gets a named cause and no independent reproduction", attributing it to 387f69830a8 (#149585) touching the file by path. That is now resolved, and the attribution was wrong. The real cause is base-state dependent: a missing entry in scripts/pr-lib/wrapper-components.txt, fixed on main by c5cff2f122e (#150453). The lack of reproduction on the comparison branches followed from their different merge bases, not from the cause being unconfirmed.

cc @jalehman, since cb4e63b5 is yours. Nothing here implicates it. The main-side breakage was caught and fixed inside 36 minutes, which is why the surviving signal is this narrow.

etzelm added a commit to etzelm/openclaw that referenced this pull request Sep 17, 2026
- scripted control arms s1-s4 and real-model (claude-cli) arms h1, h2a, h2b, h3
- legacy media replay phases across v2026.9.4, parent 4269449 and head cb4e63b
- sanitized, 1280x900, hosted for the PR body and review comment
@etzelm

etzelm commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Live re-run on the current head cb4e63b5, scripted control plus a real model, receipt variants, legacy media replay

Everything below was measured on cb4e63b5e052f61bbaf53bc36aaadca715f2de87 (the current head), not on its parent. Same harness as the earlier proof: real gateway, real Control UI served by that gateway, real headless Chromium client, real background exec, real heartbeat wake, SQLite store, chat.history read over a second connection in a fresh process. Baseline arms use the merge base 4e44dbf. Every screenshot was opened and checked before it was accepted.

Model arms, stated plainly

  • Scripted control (s-arms): the deterministic OpenAI-compatible server from the earlier rounds. It is compliant: suppression prompt gives NO_REPLY, relay prompt relays. This is the control that gives the crisp differential.
  • Real model (h-arms): the heartbeat turn runs on Claude Sonnet 5 through the bundled claude-cli backend. The first turn is scripted so that OpenClaw's own exec tool starts the background job, then the browser sends /model claude-cli/claude-sonnet-5, which sets the session modelOverride that the heartbeat runner reads (src/infra/heartbeat-runner-config.ts:70). The gateway log confirms cli exec: provider=claude-cli model=claude-sonnet-5 ... trigger=heartbeat. Assertions check for the exec output marker in a new assistant row, never for wording. A pure claude-cli arm (both turns real) cannot start an OpenClaw background exec at all, because the claude-cli backend does not expose OpenClaw exec over its MCP bridge and maps that capability onto Claude's native Bash; that arm (r2a) is reported below as a harness limit, not as a result.
arm image heartbeat.target model on the relay turn expected rendered client chat.history, 2nd connection
s1 merge base 4e44dbf last scripted absent absent 0
s2 head cb4e63b5 last scripted present once present, 1 row 1
s3 head cb4e63b5 none scripted absent absent 0
s4 head cb4e63b5 last scripted, relay carries MEDIA: present once with image present, 1 row, image rendered 1
h1 merge base 4e44dbf last Claude Sonnet 5 (claude-cli) absent absent (model answered NO_REPLY) 0
h2a head cb4e63b5 last Claude Sonnet 5 (claude-cli) marker present once present, 1 row marker present
h2b head cb4e63b5 last Claude Sonnet 5 (claude-cli), repeat marker present once present, 1 row marker present
h3 head cb4e63b5 none Claude Sonnet 5 (claude-cli) absent absent (model answered NO_REPLY) 0

Scripted arms, prompt actually handed to the model: relay prompt count 0 / 1 / 0 / 1, suppression prompt count 1 / 0 / 1 / 0 for s1 / s2 / s3 / s4. delivery.kind was internal and createdVia was operator at wake time in every arm, with no hand seeding.

Real-model nondeterminism, reported as observed: both head runs relayed, with different wording. h2a: "This was a background test/marker job I kicked off earlier: it ran sleep 40; echo EXEC_MARKER_H2A and just finished successfully (exit code 0), printing EXEC_MARKER_H2A as expected ..." h2b: "... It finished successfully (exit code 0), output: EXEC_MARKER_H2B ..." In h2a the model also called the sessions_history MCP tool before replying. Neither ack row contained the marker. h1 and h3 ran once each; h2 ran twice.

Baseline 4e44dbf, scripted (s1): no completion row.

s1 baseline on the merge base: RUN_JOB, background marker job, STARTED, no completion row

Head cb4e63b5, scripted (s2): completion row present once.

s2 on head cb4e63b5: the same conversation plus BACKGROUND JOB DONE :: EXEC_MARKER_S2

Head cb4e63b5, real model on the relay turn (h2a): Sonnet's own wording, marker present once.

h2a on head cb4e63b5 with Claude Sonnet 5 via claude-cli relaying EXEC_MARKER_H2A

Baseline 4e44dbf, real model on the relay turn (h1): suppression prompt, no relay.

h1 on the merge base with Claude Sonnet 5: suppression prompt visible, no relay row

s3 (head, target none, scripted), s4 (head, media relay), h2b (head, real model repeat), h3 (head, target none, real model), r2a (pure claude-cli, harness limit)

s3 on head with target none: STARTED only

s4 on head: completion row with the attached image rendered

h2b on head with Claude Sonnet 5 relaying EXEC_MARKER_H2B

h3 on head with target none and Claude Sonnet 5: no relay row

r2a pure claude-cli arm: Claude used its native Bash, which OpenClaw's exec policy denied, so no OpenClaw exec completion existed

Runtime-owned receipt variants, live

publishHeartbeatSessionReply outcomes and which live client run reached each:

variant live run evidence
owned text-only receipt, replayed (receipt.appended false) s2, h2a, h2b exactly one assistant row carries the completion (transcript rows and chat.history both 1); no automation-result row was written; the receipt row is the runtime's own (provider=scripted or provider=claude-cli, idempotencyKey=cli-assistant:<run id>)
owned receipt with media (matchesMedia, managed media attach) s4 relay carried MEDIA:/state/ws/<marker>.png; one row, image rendered in the client, history 1
suppressed (target: none) s3, h3 no publication, suppression prompt, 0 rows
non-owned automation-result publication; source-reply mirror receipt; the rejection branches not reached live unit coverage only; every live completion was runtime-owned

Legacy media replay (cb4e63b5), one store across three gateways

  1. v2026.9.4 (3a9d69d): a real browser creates the session; the legacy runtime's own constructor (appendAssistantMessageToSessionTranscript, run through the repo's tsx in the container) writes a keyed delivery-mirror row with mediaUrls and idempotencyKey: legacy-media-reply. Stored bytes: provider=openclaw model=delivery-mirror api=openclaw-transcript, no openclawDelivery at all, text Legacy chart\nlegacy-chart.png. The browser renders it; chat.history over a second connection shows it.
  2. parent 4269449 on the migrated store (openclaw doctor --fix, exit 0, the real upgrade step): the browser renders the legacy row, then replaying the identical keyed candidate fails with Transcript idempotency key "legacy-media-reply" conflicts with the admitted message. A changed-media candidate also conflicts.
  3. head cb4e63b5 on the same restored store: the browser renders the legacy row, the identical candidate replays (ok: true, same message id 99197e32-..., still exactly one row), and the changed-media candidate still conflicts. chat.history afterwards: one row.
store written by replayed on identical candidate with mediaUrls changed media
v2026.9.4 parent 4269449 conflict conflict
v2026.9.4 head cb4e63b5 match, no new row conflict

v2026.9.4 renders its own legacy media mirror row

head cb4e63b5 renders the same legacy store after the replay

The replay candidate is produced by the runtime module against the live store rather than by a client action, because no client RPC rebuilds a keyed media mirror for an internal session (chat.inject carries neither idempotencyKey nor mediaUrls, and message-tool source replies short-circuit through completePersistedInternalSourceReply). Browser rendering and the second-connection history read were live at every phase.

Two-destination screenshot gate (AGENTS.md, "Product and validation")

The inspected before/after pair (arm1-03-final.png, arm2-03-final.png) was attached in the originating implementation chat on 2026-09-17 at 02:35 UTC and verified to render there, and is embedded in the PR body, where every image URL was re-checked to return 200 image/png. The PR body's evidence section now states this explicitly.

Not verified

  • A real model on the first, exec-starting turn (see r2a above; a property of the claude-cli backend, not of this PR).
  • Non-owned automation-result publication, source-reply mirror receipts, and the rejection branches were not reached by any live client run.
  • The legacy replay trigger is a runtime-module call on the live store, not a client action.
  • Session key is agent:main:main; only messages.visibleReplies: automatic; the unresolvable-target arm remains unreachable from a schema-valid config.

One observation for maintainers, not caused by this PR: on the claude-cli path the heartbeat prompt itself is rendered as a user row in the Control UI (visible in the h-arm screenshots on both the merge base and the head), because the CLI backend records the prompt as a user message. The scripted arms do not show it.

Sanitization: gateway token is the literal fake-local-token-not-a-secret in a URL fragment only; the claude-cli credential file was bind-mounted read-only at runtime and never copied into an image or printed; no real keys, IPs, phone numbers, private hostnames, or names appear in any image or excerpt.

@etzelm

etzelm commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 17, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@etzelm

etzelm commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor Author

@vincentkoc if you have a chance, would you mind taking another look at this one?

Where it stands:

  • jalehman and I have converged on one implementation. Their commits carry the publication path, settlement, and the legacy media-replay fix; mine is the resolver-level target-none gate on top.
  • The latest ClawSweeper revision puts patch quality at platinum hermit with no actionable findings. Proof confidence is the remaining gate, and I have since posted a live run on a real Control UI client: before/after screenshots, chat.history read from a second connection, and the target: none suppression case.
  • All 11 red checks are main-side rather than from this branch. Triage is in the comment above: the Slack lint and import-cycle failures came from Restore Slack’s quiet preamble previews #150407 and Keep Slack messages through temporary authorization failures #150457 and main has already fixed them, the tooling-fixture failures are fixed by fix: restore initialization in fresh PR wrappers #150453, and control-ui-performance is a repo-wide startup budget baseline drift that needs a maintainer-approved bump.

No rush at all, and happy to rebase or drop anything that is in the way. I also posted in the clawtributor channel on Discord. Thanks!

@jalehman

jalehman commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Attachment publication pending: the six screenshots were visually inspected and the selected proof images delivered in the originating chat. The GitHub attachment upload timed out; no image attachments are present in this comment yet.

Inspected exact-head Gateway / Control UI evidence

Source: cb4e63b5e052f61bbaf53bc36aaadca715f2de87, clean worktree. Existing run captured September 17, 2026, 02:48–02:49 UTC; no new proof run was needed for this publication.

Real Gateway, built Control UI, browser approval (allow-once), and real background exec; deterministic provider fixture, not live-model proof. The no-role AWS worker reported IMDSv2 IAM role endpoint 404. Run evidence records browser/provider/subprocess cleanup; owned lease release was independently verified in the earlier proof closeout.

  • Connected: real process exited 0 with the expected marker; accepted heartbeat result and normal settlement status sent; exactly one persisted completion, one live notification event, and one completion after reload.
  • Disconnected: Gateway confirmed the original connection closed before process release; real process exited 0; settlement sent; zero live notification events while closed, exactly one persisted completion and one history/DOM completion after reopening and reloading.

These six existing screenshots were individually visually inspected after authorized media staging. No visible credentials or private user data were found; no redaction was necessary. The first image is the pre-action state on the fixed head, not an unfixed-code baseline. The remaining images show connected completion/reload, and the disconnected case running/reopened/reloaded. These are our own worker artifacts, distinct from the contributor's previously published screenshots.

Scope: these images and this run substantiate the connected/disconnected cases above. They do not independently establish every sibling/reset/second-wake case, historical CI failure causality, or overall CI success. Current CI failures and the maintainer's blocking review remain unresolved. This is evidence publication, not merge approval.

@jalehman

Copy link
Copy Markdown
Contributor

CI recovery integrated — new candidate, validation pending

Published c6bb45952c185ca3125989ae62a39b48b9b9307b as an ancestry-preserving merge of prior PR head cb4e63b5e052f61bbaf53bc36aaadca715f2de87 and fixed main 0863f26bf3f2bac266200e20f3676393061d87d5. Existing contributor history remains intact.

This incorporates the landed Qwen, cold-fixture, wrapper-closure, UI performance, Slack, and exact queue-test-site repairs. The only manual integration resolves the two independently extracted assistant-answer selectors into one shared implementation used by payload construction, canonical-silence classification, and heartbeat receipt validation. Main's silence/unfinished-work guards are preserved.

Fresh isolated static review of the resulting candidate reported no actionable P0–P2 findings. This is not runtime validation. The new-head CI has started. The previous cb4 test/browser evidence remains evidence for cb4 only; fresh c6bb validation is pending.

The credential-free public-PR identity prerequisite for the sanitized AWS run currently returns HTTP403 with rate remaining0 and reset September17,2026 at19:38:29UTC. No validation worker was allocated after that failed prerequisite. The prepared run will only proceed after fresh identity admission succeeds; credentials will not be forwarded as a workaround.

The prior queue baseline/trace did not prove historical CI failure causality; the integrated150631 repair is an exact-site upstream test correction, not a retrospective proof. GitHub publication of our inspected screenshots also remains incomplete after an upload timeout. No merge readiness or maintainer approval is claimed.

@jalehman

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 17, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@jalehman

Copy link
Copy Markdown
Contributor

The new check-additional-boundaries failure is attributed to main's Slack test importing core internals. The extension test and checker are byte-identical on the failed merge candidate and inspected main; the offending import entered with #151069.

Separate upstream repair: #151083 at 08db30c1911f11df6705fae4fdf2d7bd2939c478. It relocates the inherited-thread regression to root integration scope through the existing public Slack facade and deps.slack sender seam. No production change, SDK expansion, or boundary-rule exception. Static autoreview is clean; runtime validation is pending CI.

This PR remains at c6bb45952c185ca3125989ae62a39b48b9b9307b. After the upstream fix is verified and lands through its authorized gates, fixed main will be merged into this branch and exact-head checks/proof repeated. No merge of this PR is authorized. Earlier cb4 runtime/UI proof does not validate c6bb or subsequent source heads; new-head sanitized AWS proof and screenshot publication remain outstanding.

@jalehman

Copy link
Copy Markdown
Contributor

Published 7e22264fa0ee40084afa45f59825a7e4510fd0d5, merging pinned main 4520c88d8c9e0146f05a9ab5ae0431f57f884e65 into prior head c6bb45952c185ca3125989ae62a39b48b9b9307b without rebasing or replacing contributor history.

The reused main commits are #151080 (c9ab1cff77ecd3986b46078243a5c7c8498e9f42) and #151086 (cc4eca4066d7ca74dfbba1a50b0276160e25ccf7). I verified ancestry and inspected the preserved composed regression. Separate #151083 is superseded; I documented that rather than landing duplicate coverage.

Integration was conflict-free, with no path overlap between this feature and incoming main changes. The 18-file feature delta remains +2364/-66. Fresh static integration autoreview: scoped-clean, no actionable P0–P2 findings. This does not establish runtime or UI success on the new commit.

Current-head CI/re-review, the human changes-requested disposition, and final-head sanitized direct-AWS Gateway/UI proof remain outstanding. The credential-free public identity preflight is paused until September 17 at 20:41:56 UTC (13:41:56 PDT) following HTTP403/rate-limit exhaustion. No worker was allocated. No PR merge is authorized or performed.

@jalehman

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Current head 7e22264 integrates landed main CI/regression repairs. The PR body now preserves historical proof attribution and explicitly records new-head runtime/UI proof as pending. Human changes-requested review remains separate.

@clawsweeper

clawsweeper Bot commented Sep 17, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@jalehman

Copy link
Copy Markdown
Contributor

Exact-head Gateway / Control UI proof — PASS

Tested head: 7e22264fa0ee40084afa45f59825a7e4510fd0d5 (clean checkout; no candidate patch).
Run: direct AWS Crabbox run_5c2bc8d34a10, September 17, 2026. Terminal result: exit 0 / succeeded. Command duration 22m02s; total 23m01s.

This uses the actual Gateway, served Control UI, browser approval, background shell processes, transcript persistence, and WebSocket/history paths. The model/provider is a deterministic local fixture, not a live-model proof. The fixture does not synthesize completion events or replace the UI/history assertions.

Results

Scope Observed result
Connected browser UI allow-once; no PID before approval; real running PID; actual exec completion code 0 and matching marker; accepted heartbeat response and sent settlement receipt; 1 persisted assistant reply and 1 browser notification; reload still shows 1 reply.
Browser closed during execution Browser closed and matching Gateway socket-close record observed before releasing the real process; completion code 0; accepted response and sent receipt; 1 persisted assistant reply, no notification received by a closed browser; reopen and subsequent reload each show 1 reply.
Focused runtime regression suite 569 tests across 22 files passed, including receipt/media identity, terminal silence and recovery, queue behavior, restored Slack threading coverage, and boundary enforcement.
Second wake / history boundary The executed Gateway WebSocket regression verifies that the second wake skips an already accepted completion and reconnect history contains the persisted reply.
Suppression / generation / sibling coverage Executed heartbeat integration regressions cover hidden/internal-effects sessions, reset/replacement generations, target:none and unresolved targets, non-exec wake handling, distinct same-text occurrences, failed turns, and retry behavior. These are runtime regression results, not additional browser screenshots.
Checks and builds Changed-file checks against pinned main 4520c88d8c9e0146f05a9ab5ae0431f57f884e65, production build, Control UI build, and browser installation completed successfully.

Isolation and cleanup

Credential-free live-head checks accepted this exact SHA before allocation and again inside the worker before installation. The worker verified IMDSv2 and IAM role endpoint HTTP 404. No hydration, Tailscale, production credentials, or local candidate execution. Toolchain: Node 24.19.0 / pnpm 12.4.0.

Browser, subprocess, and fixture-server cleanup passed. Owned AWS lease cbx_c9c0b1a355d8 was released; a separate completed AWS lease listing independently confirmed its absence.

Screenshots and provenance

The attached images are exact-head captures, individually visually inspected with no secrets/private user data found and no redaction required. They were also delivered in the originating chat. In order: connected before launch; connected after reload; disconnected while running; disconnected after reopening. The first image is a before-action view, not a reproduction on an older source revision.

  • UI source snapshot: clean 7e22264fa0ee40084afa45f59825a7e4510fd0d5.
  • UI observation interval: 2026-09-17T21:06:48.545Z–2026-09-17T21:07:44.645Z.
  • Combined trusted fixture SHA-256: 880db5878a4ffc803b93666f2847c52e0b53ec902e946ae762840fcb191d6ec2.
  • Unchanged reviewed UI-driver SHA-256: 5804ee081a7a503f64e719a06e851f27638c102b7d876c4a1fd03a6b58dd7d9e.
  • Downloaded evidence archive SHA-256: 1d8e50bca3ddefd53827fcf0b0658414fdc690890f2dd905a8c46b0bfba5ba6d.

Exact-head CI was green (178 successful, 1 neutral, 42 skipped; aggregate gate successful). This proof supplies the current-head runtime evidence requested by revision 11 of the automated review. The separate human changes-requested review remains unresolved; nothing here dismisses it or authorizes a merge.

Connected: before launch

Connected: one reply after reload

Disconnected case: process running before browser close

Disconnected case: one reply after reopening

@jalehman

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

New evidence for unchanged head 7e22264: #148360 (comment) now contains the completed exact-head sanitized AWS Gateway/UI run and four inspected screenshots, also delivered in the originating chat. Public image bytes were verified against the inspected originals. The PR body preserves historical proof and now identifies current-head execution. Please reassess the previously missing new-head runtime evidence.

@vincentkoc — the revised implementation now has green exact-head CI and the linked fresh runtime/connected/reconnect proof. Please disposition your outstanding changes-requested review against this head and evidence when available. I have not dismissed it or attempted a merge.

@clawsweeper

clawsweeper Bot commented Sep 17, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@jalehman
jalehman merged commit 06e6c06 into openclaw:main Sep 17, 2026
227 checks passed
@jalehman

Copy link
Copy Markdown
Contributor

Merged via squash.

@etzelm
etzelm deleted the fix/webchat-exec-completion-reply branch September 17, 2026 23:43
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
openclaw#148360)

* fix(infra): relay exec-completion replies on WebChat-internal sessions

Closes openclaw#147387

* refactor(heartbeat-dispatch): extract indicator type logic into helper

- Extract the indicatorType condition from prepareHeartbeatDispatchReply
  into a named helper function shouldSetIndicator for improved readability

- The helper clearly documents when each indicator type is returned:
  'alert' when alerts are disabled, 'sent' when delivery succeeds,
  undefined in all other cases

* fix: address maintainer review on openclaw#148360

- Consume the triggering system event for a WebChat exec-completion
  reply too. deliverHeartbeatDispatch previously reported
  visibleReplySent: false unconditionally for channel === "none",
  which the settle callback maps into consume: false, leaving the
  event pending and letting a later wake relay the same completion
  again. Report it as visibly sent specifically for the
  isWebChatExecCompletion case, since the reply already reached the
  session's own transcript via the ordinary turn-completion path.

- Narrow isWebChatExecCompletion so it cannot match hidden
  internal-effects sessions. delivery.kind === "internal" also covers
  sessions created by internal-session-effects.ts and voice bare rows,
  which are never a real WebChat/Companion client. Exclude sessions
  explicitly created via that path (createdVia === "internal").

- Add a regression test proving a hidden internal-effects session
  (createdVia: "internal") still gets the original suppressed prompt,
  not the relay prompt.

- Fix two exact-head CI failures: an unnecessary Boolean() wrapper
  flagged by no-unnecessary-type-conversion, and two test-file
  HeartbeatSessionSeed seed calls missing the now-required
  lastProvider/lastTo fields (upstream main added them as required
  since this branch's base).

* fix: confirm WebChat exec completion publication before settlement

* fix: preserve silent exec delivery and strict media replay

* fix(heartbeat): gate exec-completion projection at the delivery resolver

- Replaces the config-level `heartbeat?.target !== "none"` guard added in
  4572570 with a resolver-level gate: `projectionCandidate` is still captured
  before the routing await, and `internalProjection` is derived after it from
  `delivery.reason === "target-none"`.
- The config check missed the explicit-but-unresolvable target. In
  src/infra/outbound/targets.ts:231 an explicit `target` string starts at
  "none"; a value that is not none/last/owner and not a deliverable channel
  falls through :236-241 with no `to`, so :257-260 returns
  `reason: "target-none"` while `heartbeat.target` is still that string.
  Such a run projected the completion into the WebChat session.
- Gating on the resolver verdict suppresses both cases at once, covering the
  relay prompt, `deliverHeartbeatDispatch` publication, and settlement
  bookkeeping, which all read `internalProjection`.
- Adds three arms asserting `getLastHeartbeatEvent()` and the
  `onSessionTranscriptUpdate` emission the gateway fans out as
  `session.message`, layers the existing prompt/row test does not reach.
  The unresolvable-target arm fails on 4572570 and passes here.
- Keeps jalehman's prompt/row test and media-identity work unchanged.

* fix: preserve legacy delivery mirror replay identity

---------

Co-authored-by: etzelm <[email protected]>
Co-authored-by: jalehman <[email protected]>
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 3, 2026
Block: inline raw-answer resolver in run/payloads.ts (drift residue).
Home: restored to upstream (drift residue).

Upstream moved resolveRawAssistantAnswerText into its owner
src/shared/assistant-answer-text.ts (0863f26 openclaw#150539, then
06e6c06 openclaw#148360). Our payloads.ts kept a private copy
(isAssistantTextContentBlockType, readAssistantTextContentBlock,
sanitizeCanonicalAssistantItemText, resolveRawAssistantAnswerParts).
It also kept assistantTextsHaveMedia / normalizedRawAnswerText and a
redundant !assistantTextsHaveMedia guard that 162c33e (openclaw#133264)
removed.

Restore upstream's import and media-comparison bytes. The continuation
need (one raw part per final-answer block, optionally keeping item
whitespace) moves to the owner as resolveRawAssistantAnswerParts;
resolveRawAssistantAnswerText now joins its parts and keeps upstream's
output for every input. payloads.ts keeps only rawAnswerHasContinuation,
the earlier-continuation per-hop split and preserveTextWhitespace.

Refs #1418

Co-Authored-By: Claude Opus 5.5 <[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 P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: exec-completion wake succeeds but visible reply is dropped in WebChat / Companion

3 participants