Skip to content

fix(reply): accumulate media blocks instead of sending immediately when streaming disabled#27

Open
EronFan wants to merge 1734 commits into
mainfrom
fix/70085-media-duplicate-send
Open

fix(reply): accumulate media blocks instead of sending immediately when streaming disabled#27
EronFan wants to merge 1734 commits into
mainfrom
fix/70085-media-duplicate-send

Conversation

@EronFan

@EronFan EronFan commented Apr 22, 2026

Copy link
Copy Markdown
Owner

Fixes openclaw#70085 - MEDIA directive sends duplicate messages on all channels.

When block streaming is disabled, media blocks were sent immediately via onBlockReply, invoking normalizeMediaPaths twice (once here, once in buildReplyPayloads), producing different UUID outbound paths each time and defeating the deduplication key match — causing duplicate delivery.

Now media blocks are accumulated and sent via buildReplyPayloads at end of run, ensuring consistent UUID paths and correct deduplication.

steipete and others added 29 commits April 21, 2026 03:35
…w#69347)

The bug: three persist sites accumulated cost instead of snapshotting
it like tokens. This caused cost to be inflated 1x-72x on multi-persist
sessions because the same cumulative usage was added repeatedly.

Root cause: persistSessionUsageUpdate, updateSessionStoreAfterAgentRun,
and the cron isolated-agent run path all used:
  estimatedCostUsd = existingCost + runCost

But runCost was already computed from cumulative run usage, so this
added the same cost repeatedly on redundant persists.

Fix: snapshot cost directly like tokens already do:
  estimatedCostUsd = runCost

Files affected:
- src/auto-reply/reply/session-usage.ts
- src/agents/command/session-store.ts
- src/cron/isolated-agent/run.ts

Tests added:
- session-store.test.ts: verify cost is snapshotted, not accumulated
- session.test.ts: updated existing test to verify snapshot behavior

Fixes openclaw#69347
* fix: relaunch setup tui in a fresh process

* fix: harden setup tui handoff

* fix: preserve tui hatch exit flow

* Revert "fix: preserve tui hatch exit flow"

This reverts commit f4f119a.

* fix: let setup tui resolve gateway auth

* fix: support packaged tui relaunch

* fix: pin setup tui gateway target

* fix: preserve setup tui auth source
…penclaw#69198)

Forward per-group systemPrompt config into inbound context GroupSystemPrompt so configured group-specific behavioral instructions (for example threaded-reply and tapback conventions) are injected on every turn. Supports "*" wildcard fallback matching the existing requireMention pattern.

Closes openclaw#60665.

Co-authored-by: Omar Shahine <[email protected]>
Root cause: tool runners capture startedAt = Date.now() before calling
createTaskRecord. By the time the registry sets createdAt = Date.now(),
a few ms may have passed, making startedAt < createdAt architecturally.

Fix: in createTaskRecord, clamp createdAt to be at least startedAt when
startedAt is provided and already in the past. This ensures the invariant
createdAt >= startedAt is always true for new records, eliminating the
false positive from the inconsistent_timestamps audit check.

Tests: new regression tests in task-registry.audit.test.ts covering:
- startedAt captured before registration (pre-clamp legacy input)
- terminal task with pre-createdAt startedAt (genuine ordering bug still caught)
- non-consecutive duplicate suppression in system-events (bundled fix)

Fixes openclaw#69229
…penclaw#69831)

Root cause: gramyy declared as ^1.42.0 but installed version is 1.41.1.
The staging script skips deps when installed version doesn't satisfy the
semver spec, causing runtime module not found.
…en streaming disabled

Fixes openclaw#70085 - MEDIA directive sends duplicate messages on all channels.
When block streaming is disabled, media blocks were sent immediately via
onBlockReply, invoking normalizeMediaPaths twice (once here, once in
buildReplyPayloads), producing different UUID outbound paths each time
and defeating the deduplication key match — causing duplicate delivery.

Now media blocks are accumulated and sent via buildReplyPayloads at end
of run, ensuring consistent UUID paths and correct deduplication.

--author="EronFan <[email protected]>"
@EronFan EronFan self-assigned this Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MEDIA: directive delivers voice/audio messages twice on all channels (4.15)