fix(reply): accumulate media blocks instead of sending immediately when streaming disabled#27
Open
EronFan wants to merge 1734 commits into
Open
fix(reply): accumulate media blocks instead of sending immediately when streaming disabled#27EronFan wants to merge 1734 commits into
EronFan wants to merge 1734 commits into
Conversation
…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.
…roken by prior diff
…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]>"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.