Repository navigation
fix(agents): reject synchronous sessions_send self-targets, break down missing-cost entries, dedup usage merges - #108354
Merged
Merged
Conversation
…n missing-cost entries, dedup usage merges - sessions_send fails fast with a clear error when a synchronous send resolves to the calling session's own key, instead of enqueueing behind the sender's own lane until timeout and falling back to an empty reply; fire-and-forget (timeoutSeconds: 0) self-delivery keeps working (#107172) - missingCostEntries now carries a provider/model breakdown surfaced on the status runtime line and gateway CLI cost line, so zero-priced usage (e.g. openai-codex/*) is attributable instead of an opaque counter (#98348) - codex-synthetic-usage merge helpers share one precedence helper; behavior unchanged, duplicate ranking logic deleted (#107497)
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 16, 2026
…n missing-cost entries, dedup usage merges (openclaw#108354) * fix(agents): reject synchronous sessions_send self-targets, break down missing-cost entries, dedup usage merges - sessions_send fails fast with a clear error when a synchronous send resolves to the calling session's own key, instead of enqueueing behind the sender's own lane until timeout and falling back to an empty reply; fire-and-forget (timeoutSeconds: 0) self-delivery keeps working (openclaw#107172) - missingCostEntries now carries a provider/model breakdown surfaced on the status runtime line and gateway CLI cost line, so zero-priced usage (e.g. openai-codex/*) is attributable instead of an opaque counter (openclaw#98348) - codex-synthetic-usage merge helpers share one precedence helper; behavior unchanged, duplicate ranking logic deleted (openclaw#107497) * test: use a valid billing type in synthetic-usage precedence case * test: fix billing expectation to match valid type
zooqueen
pushed a commit
to zooqueen/openclaw
that referenced
this pull request
Sep 11, 2026
…n missing-cost entries, dedup usage merges (openclaw#108354) * fix(agents): reject synchronous sessions_send self-targets, break down missing-cost entries, dedup usage merges - sessions_send fails fast with a clear error when a synchronous send resolves to the calling session's own key, instead of enqueueing behind the sender's own lane until timeout and falling back to an empty reply; fire-and-forget (timeoutSeconds: 0) self-delivery keeps working (openclaw#107172) - missingCostEntries now carries a provider/model breakdown surfaced on the status runtime line and gateway CLI cost line, so zero-priced usage (e.g. openai-codex/*) is attributable instead of an opaque counter (openclaw#98348) - codex-synthetic-usage merge helpers share one precedence helper; behavior unchanged, duplicate ranking logic deleted (openclaw#107497) * test: use a valid billing type in synthetic-usage precedence case * test: fix billing expectation to match valid type
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.
What Problem This Solves
Three Codex-adjacent reporting/behavior bugs:
sessions_sendwith a target that resolved to its own active session key. The message enqueued on the sender's own lane (held by the in-flight turn), blocked until the lane timeout, and surfaced as a "Done." empty-reply fallback.cost: 0, whichisModelPricingKnowntreats as unknown) incremented an opaquemissingCostEntriescounter with no way to see which provider/model was unattributed.codex-synthetic-usage.tsrepeated the same preferred-vs-secondary precedence ranking across three merge helpers.Why This Change Was Made
timeoutSeconds !== 0) whose resolved target equals the requester's key fails fast with "sessions_send cannot target the calling session; use your own reply instead". The legitimate self-send path is preserved:timeoutSeconds: 0fire-and-forget channel-delivery/A2A flow is untouched, and cron/system-event delivery uses a separate mechanism.missingCostByModel: Record<"provider/model", count>rides alongside the existing scalar (kept for compatibility), aggregated where raw provider attribution already exists, with a cache-version bump and clone/merge support; the status runtime line and gateway CLI cost line render it compactly (Missing cost: 3 (openai/gpt-5.6-sol 2, openai-codex/gpt-5.5 1)).User Impact
/statusandopenclaw gatewaycost output attribute missing-cost turns to concrete provider/model pairs.Evidence
Fixes #107172
Fixes #98348
Fixes #107497