Skip to content

fix(usage): forward cached_tokens via prompt_tokens_details on chat-completions#82062

Merged
steipete merged 4 commits into
openclaw:mainfrom
caz0075:fix-usage-forward-cached-tokens
May 27, 2026
Merged

fix(usage): forward cached_tokens via prompt_tokens_details on chat-completions#82062
steipete merged 4 commits into
openclaw:mainfrom
caz0075:fix-usage-forward-cached-tokens

Conversation

@caz0075

@caz0075 caz0075 commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

toOpenAiChatCompletionsUsage was burying cacheRead into
prompt_tokens without emitting the canonical OpenAI
prompt_tokens_details.cached_tokens field. Any chat-completions
client (e.g. an iOS app showing per-reply cost) saw cached=0
on every turn even though the upstream OpenAI cache was hitting
80%+. Per-turn cost reporting was ~10x over-stated on cached
turns.

This PR adds the missing field when cacheRead > 0 and omits it
otherwise, keeping the wire shape compatible for non-cached
responses.

Field name and shape match OpenAI's documented chat-completions
usage breakdown:
https://platform.openai.com/docs/guides/prompt-caching

Real behavior proof

  • Behavior or issue addressed: When OpenAI's prompt cache
    hit on a chat-completions request through OpenClaw, cacheRead
    was being folded into prompt_tokens and the canonical
    prompt_tokens_details.cached_tokens field was NOT emitted on
    the SSE wire. iOS / dashboard clients that compute per-reply
    cost using the OpenAI-documented usage shape treat all of
    prompt_tokens as uncached → ~10x over-statement on a
    cached-heavy chat session. The OpenAI dashboard billed
    correctly (cache hit); the OpenClaw chat-completions wire
    shape just dropped the breakdown.

  • Real environment tested: OpenClaw gateway openclaw@2026.5.12
    running on macOS Sequoia (real install at
    ~/Library/pnpm/global/...). Upstream model openai/gpt-5.4
    via the main agent. Client is a custom iOS chat client
    posting POST /v1/chat/completions with
    stream_options: { include_usage: true } and consuming the
    SSE stream including the final usage chunk. Single-user
    setup, no fixtures.

  • Exact steps or command run after this patch: (1) Patched
    the compiled usage-*.js in the locally-installed
    openclaw@2026.5.12 package with the same edit this PR makes
    to src/agents/usage.ts. (2) Ran openclaw gateway restart
    to load the patched module. (3) From the iOS client, sent
    two consecutive casual chat turns ~9 seconds apart against
    the main agent. First turn establishes the OpenAI
    prompt-cache prefix; second turn hits it. (4) Captured the
    raw SSE usage frame from the iOS client's debug log.

  • Evidence after fix: Raw SSE usage frame as observed at
    the iOS client (warm-cache turn, copied verbatim from the
    live debug log on the patched gateway):

    EventStreamDecoder: raw usage JSON =
      {"total_tokens":31521,"prompt_tokens":31442,
       "prompt_tokens_details":{"cached_tokens":30848},
       "completion_tokens":79}
    performSend: usage frame — model=openclaw in=31442 cached=30848 out=79
    

    For comparison, the same client on the unpatched gateway
    emitted (same chat, prior turn that warmed the cache):

    EventStreamDecoder: raw usage JSON =
      {"prompt_tokens":74915,"completion_tokens":158,"total_tokens":75073}
    performSend: usage frame — model=openclaw in=74915 cached=0 out=158
    

    The OpenAI billing dashboard for the same period independently
    confirms ~98% of input tokens were cache reads, matching the
    30,848 / 31,442 figure now reaching the client.

  • Observed result after fix: The chat-completions SSE final
    chunk now includes prompt_tokens_details: { cached_tokens: N }
    when the gateway has a non-zero cacheRead for the turn.
    Per-reply cost calculation on the iOS client dropped from the
    inflated cache-blind figure ($0.08 USD) to the cache-aware
    blended figure (
    $0.01 USD) — matching the amount the OpenAI
    dashboard actually billed. Non-cache-hit responses (e.g. the
    first turn after a >5min gap) continue to emit the existing
    lean shape with no prompt_tokens_details key, verified by
    inspecting the cold-cache turn in the same session.

  • What was not tested: Anthropic / Vertex provider paths.
    Their usage shapes go through normalizeUsage first and then
    the same toOpenAiChatCompletionsUsage, so the fix applies
    uniformly to them per the source, but I did not end-to-end
    verify those paths in a real OpenClaw setup. The non-stream
    chat-completions code path was also not end-to-end verified
    (the request in question used stream: true); the same
    function is reached via the non-stream path per the source.

AI-assisted

This patch was prepared with the assistance of an AI coding
agent (Claude Code) driven from a real cost-reporting
investigation on my OpenClaw instance. The "Evidence after fix"
and "Observed result after fix" blocks above are copied
verbatim from my own iOS client's live debug log on the
patched gateway, not generated.

…ompletions

toOpenAiChatCompletionsUsage was burying cacheRead into prompt_tokens
without emitting the canonical OpenAI prompt_tokens_details.cached_tokens
field. Any chat-completions client (e.g. an iOS app showing per-reply
cost) consequently saw cached=0 on every turn even though the upstream
OpenAI cache was hitting at 80%+, leading to a ~10x over-statement of
cost on cached turns.

Adds the missing prompt_tokens_details when cacheRead > 0; omits it
when zero so requests with no cache contribution keep the lean shape
they have today. Field name and shape match OpenAI's documented
chat-completions usage breakdown:
https://platform.openai.com/docs/guides/prompt-caching
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 15, 2026
@clawsweeper

clawsweeper Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed May 27, 2026, 5:46 AM ET / 09:46 UTC.

Summary
The PR adds prompt_tokens_details.cached_tokens to OpenAI-compatible chat-completions usage when normalized cacheRead is positive and updates helper and gateway assertions.

PR surface: Source +2, Tests +37. Total +39 across 5 files.

Reproducibility: yes. Source inspection shows current main folds cacheRead into prompt_tokens without emitting prompt_tokens_details, and the PR body includes before/after real SSE logs for the same behavior.

Review metrics: 1 noteworthy metric.

  • OpenAI usage response fields: 1 optional field added. The changed surface is a user-visible OpenAI-compatible response shape, so maintainers should confirm it matches the upstream usage contract before merge.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦀 challenger crab
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • Provided PR metadata marks the merge state as unstable, so maintainers should wait for required checks before landing even though no code-level blocker was found.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused additive usage-shape fix once required checks pass, keeping cache-zero responses on the existing lean shape unless maintainers choose a broader OpenAI-shape change later.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
No ClawSweeper repair lane is needed; the PR is focused, has sufficient real behavior proof, and has no blocking findings from this review.

Security
Cleared: The diff only changes in-process usage serialization types and tests; it does not touch dependencies, workflows, secrets, permissions, or code-execution surfaces.

Review details

Best possible solution:

Land the focused additive usage-shape fix once required checks pass, keeping cache-zero responses on the existing lean shape unless maintainers choose a broader OpenAI-shape change later.

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

Yes. Source inspection shows current main folds cacheRead into prompt_tokens without emitting prompt_tokens_details, and the PR body includes before/after real SSE logs for the same behavior.

Is this the best way to solve the issue?

Yes. The PR fixes the centralized usage mapper used by both streaming and non-streaming chat-completions responses, rather than duplicating serialization logic at individual call sites.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against c89298f9f800.

Label changes

Label justifications:

  • P2: This fixes incorrect usage/cost reporting for OpenAI-compatible chat-completions clients, with limited blast radius and no core availability impact.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦀 challenger crab and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The PR body contains after-fix real gateway/client log output showing the new cached-token field in the SSE usage frame and the observed cost-reporting improvement.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains after-fix real gateway/client log output showing the new cached-token field in the SSE usage frame and the observed cost-reporting improvement.
Evidence reviewed

PR surface:

Source +2, Tests +37. Total +39 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 21 19 +2
Tests 3 37 0 +37
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 58 19 +39

What I checked:

  • Current main drops the cached-token detail: toOpenAiChatCompletionsUsage on current main adds cacheRead into prompt_tokens, but its return type and returned object only include prompt/completion/total plus optional completion reasoning details, so chat-completions clients cannot see cached prompt tokens separately. (src/agents/usage.ts:199, c89298f9f800)
  • Both chat-completions response paths use the same helper: The non-stream response stores resolveChatCompletionUsage(result) in usage, and the streaming final usage chunk writes finalUsage, so fixing the central helper reaches both paths. (src/gateway/openai-http.ts:993, c89298f9f800)
  • PR head adds the optional OpenAI usage detail: The PR introduces OpenAiChatCompletionsUsage, emits prompt_tokens_details: { cached_tokens: cacheRead } only when cacheRead > 0, and threads that wider type through the gateway usage writer and resolver. (src/agents/usage.ts:52, b5112714d04a)
  • Focused regression coverage is included: The PR adds helper coverage for cache-hit and cache-zero behavior, plus gateway assertions for non-stream and streaming usage payloads that contain nonzero cacheRead. (src/agents/usage.test.ts:264, b5112714d04a)
  • Dependency contract matches the field shape: The official OpenAI prompt caching guide says cache hits are reported as usage.prompt_tokens_details.cached_tokens, and OpenClaw's own prompt-caching docs map that field to cacheRead. Public docs: docs/reference/prompt-caching.md. (docs/reference/prompt-caching.md:109, c89298f9f800)
  • Feature history points to the same usage surface: The OpenAI-compatible usage mapper was added by the prior real-usage fix, and later cache-normalization commits added the cached-token inputs that this PR now forwards back out. (src/agents/usage.ts:199, 2ccd1839f212)

Likely related people:

  • steipete: Current main blame for the usage mapper and gateway compat helper points to Peter Steinberger's recent snapshot commit, and the PR head also includes a typing cleanup commit by the same maintainer handle. (role: recent area contributor; confidence: high; commits: cf399d65d847, b5112714d04a; files: src/agents/usage.ts, src/gateway/openai-http.ts)
  • Lellansin Huang: The OpenAI-compatible chat-completions real usage mapper was introduced in the prior gateway usage fix, which is the direct surface this PR extends. (role: feature-history owner; confidence: high; commits: 2ccd1839f212; files: src/agents/usage.ts, src/gateway/openai-http.ts, src/gateway/openai-http.test.ts)
  • Tak Hoffman: Recent cache accounting history changed how cached prompt token totals are normalized before this mapper serializes them. (role: adjacent usage contributor; confidence: medium; commits: 079494aee559; files: src/agents/usage.ts, src/agents/usage.test.ts)
  • Elarwei: Earlier usage work added parsing for prompt_tokens_details.cached_tokens, which is the same OpenAI-style field family this PR emits for chat-completions clients. (role: adjacent cache-field contributor; confidence: medium; commits: aa2826b5b16e; files: src/agents/usage.ts, src/agents/usage.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 15, 2026
…ens_details field

Three call sites in src/gateway/openai-http.test.ts and one in
src/gateway/openai-http.usage.test.ts asserted the pre-patch
usage-frame shape (3 fields). Now that toOpenAiChatCompletionsUsage
emits prompt_tokens_details: { cached_tokens } when cacheRead > 0,
those assertions are extended to include the new field.

Only assertions where the test input had a non-zero cacheRead were
touched; cache-zero assertions stay on the lean 3-field shape and
continue to pass unchanged.
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label May 15, 2026
Resolves the src/agents/usage.ts conflict with main's new
completion_tokens_details (reasoning_tokens) addition. The two changes
touched the same toOpenAiChatCompletionsUsage return shape; combined so
both detail fields are emitted independently — prompt_tokens_details
{ cached_tokens } when cacheRead > 0, completion_tokens_details
{ reasoning_tokens } when present — using main's spread idiom. Both test
suites' expectations are satisfied.
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels May 27, 2026
@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🌱 uncommon Neon Patch Peep

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🌱 uncommon.
Trait: finds missing screenshots.
Image traits: location diff observatory; accessory tiny test log scroll; palette sunrise gold and clean white; mood celebratory; pose holding its accessory up for inspection; shell starlit enamel shell; lighting subtle sparkle highlights; background small review tokens.
Share on X: post this hatch
Copy: My PR egg hatched a 🌱 uncommon Neon Patch Peep in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@steipete steipete self-assigned this May 27, 2026
@steipete

Copy link
Copy Markdown
Contributor

Landing proof for the maintainer fixup on this PR.

Behavior addressed: forwards provider cache-read token counts through the OpenAI-compatible chat-completions usage shape as prompt_tokens_details.cached_tokens, while keeping completion and total token counts unchanged.

Real environment tested: local OpenClaw checkout on Node/pnpm; Blacksmith Testbox via check:changed; live OpenAI cache behavior using a 1Password-injected OpenAI key; GitHub Actions CI for PR head b511271.

Exact steps or command run after this patch:

pnpm test src/agents/usage.test.ts src/gateway/openai-http.usage.test.ts src/gateway/openai-http.test.ts -- --reporter=verbose
pnpm check:changed
OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_CACHE_TEST=1 OPENCLAW_LIVE_TEST_QUIET=0 node scripts/run-vitest.mjs run --config test/vitest/vitest.live.config.ts --configLoader runner src/agents/pi-embedded-runner.cache.live.test.ts -t "hits the expected OpenAI cache plateau" --reporter=verbose
gh run rerun 26503290013 --failed --repo openclaw/openclaw
gh pr checks 82062 --repo openclaw/openclaw

Evidence after fix: focused Vitest passed 56 tests; check:changed passed in Testbox tbx_01ksmcbxrytbsmwscr121raa4t; live OpenAI cache test passed with cacheRead=4864, input=143, rate=0.971 on the cache-hit turn; rerun CI passed, including build-artifacts job 78053475728.

Observed result after fix: OpenAI-compatible gateway usage can expose cached prompt tokens via prompt_tokens_details.cached_tokens when cacheRead is present.

What was not tested: full packaged-install live HTTP gateway run against OpenAI. The PR's Real behavior proof covers the patched gateway path, and the focused gateway tests cover the wire-shape mapping.

@steipete steipete merged commit 12e5876 into openclaw:main May 27, 2026
171 of 174 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 28, 2026
…82062)

Forward cache-read token counts through the OpenAI-compatible chat-completions usage shape as prompt_tokens_details.cached_tokens so clients can price cached turns correctly.

Align internal gateway usage typing with the expanded wire shape.

Thanks @caz0075.
eleboucher pushed a commit to eleboucher/homelab that referenced this pull request May 28, 2026
…026.5.27) (#698)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/openclaw/openclaw](https://openclaw.ai) ([source](https://github.com/openclaw/openclaw)) | patch | `2026.5.26` → `2026.5.27` |

---

### Release Notes

<details>
<summary>openclaw/openclaw (ghcr.io/openclaw/openclaw)</summary>

### [`v2026.5.27`](https://github.com/openclaw/openclaw/blob/HEAD/CHANGELOG.md#2026527)

[Compare Source](openclaw/openclaw@v2026.5.26...v2026.5.27)

##### Highlights

- Safer local/runtime boundaries: OpenClaw now rejects unsafe command wrappers, malformed CLI numeric options, unsafe Node runtime env overrides, no-auth Tailscale exposure, and non-admin device-role pairing approvals before they can affect live runs. ([#&#8203;87308](openclaw/openclaw#87308), [#&#8203;87305](openclaw/openclaw#87305), [#&#8203;87292](openclaw/openclaw#87292), [#&#8203;87146](openclaw/openclaw#87146))
- Matrix and auto-reply delivery are steadier: mention previews stay inert, final mention replies deliver normally, shared-DM notices are awaited, MXID parsing ignores filenames, and reasoning-prefixed `NO_REPLY` responses stay suppressed.
- Provider and agent reliability improved across OpenAI-compatible embeddings, cached token usage, Anthropic/Codex/Claude runtime state, unsupported tool-schema quarantine, heartbeat templates, and session fallback errors. ([#&#8203;85269](openclaw/openclaw#85269), [#&#8203;82062](openclaw/openclaw#82062), [#&#8203;85416](openclaw/openclaw#85416), [#&#8203;86855](openclaw/openclaw#86855))
- Plugin and package release paths got tighter: Pixverse ships as an external video plugin with region selection, package exclusions and shrinkwrap inventory match the published npm shape, and release/package smoke commands fail bounded instead of hanging.
- Gateway hot paths do less rediscovery by reusing current plugin metadata fingerprints, stable plugin index fingerprints, read-only session metadata, active working stores, status fast paths, and auth/env snapshots. ([#&#8203;86439](openclaw/openclaw#86439))

##### Changes

- Memory: add a core OpenAI-compatible embedding provider for local and hosted OpenAI-style endpoints, with config, doctor, and docs support. ([#&#8203;85269](openclaw/openclaw#85269)) Thanks [@&#8203;dutifulbob](https://github.com/dutifulbob).
- Plugin SDK: mark memory-specific embedding provider registration as deprecated compatibility and surface non-bundled usage in plugin compatibility diagnostics. ([#&#8203;85072](openclaw/openclaw#85072)) Thanks [@&#8203;mbelinky](https://github.com/mbelinky).
- Pixverse: add video generation provider support, API region selection, and external plugin publishing.
- Plugins: expose approval action metadata for plugin-driven approval surfaces.

##### Fixes

- Security/CLI/runtime: harden hostname normalization for repeated trailing dots, block side-effecting command wrappers, reject unsafe Node runtime env overrides, reject loose numeric CLI and gateway options, require admin approval for node device-role pairing, and reject no-auth Tailscale exposure. ([#&#8203;87305](openclaw/openclaw#87305), [#&#8203;87292](openclaw/openclaw#87292), [#&#8203;87308](openclaw/openclaw#87308), [#&#8203;87146](openclaw/openclaw#87146)) Thanks [@&#8203;pgondhi987](https://github.com/pgondhi987).
- Doctor: validate runtime tool schemas for every configured embedded agent while skipping ACP-only profiles, so bad non-default plugin or MCP tools are reported before assistant turns.
- Telegram: route `sendMessage` action replies through durable outbound delivery so completed agent responses remain retryable when the gateway send path times out. ([#&#8203;87261](openclaw/openclaw#87261)) Thanks [@&#8203;mbelinky](https://github.com/mbelinky).
- Matrix/auto-reply: keep draft previews mention-inert, preserve final mention delivery, send mention finals normally, await shared DM notices, ignore filename-embedded MXIDs, and suppress reasoning-prefixed `NO_REPLY` responses.
- Agents/providers: add OpenAI-compatible cache retention, forward cached token usage in chat completions, preserve runtime context before active user turns, strip stale Anthropic thinking, load Claude CLI OAuth for Pi auth profiles, avoid false Codex runtime live switches, and quarantine unsupported tool schemas. ([#&#8203;82062](openclaw/openclaw#82062), [#&#8203;87167](openclaw/openclaw#87167), [#&#8203;86855](openclaw/openclaw#86855))
- Gateway/performance: cache plugin metadata fingerprints and stable plugin index fingerprints, borrow read-only session metadata safely, keep the active session working store hot, keep status on a bounded fast path, and preserve model auth profile suffixes. ([#&#8203;86439](openclaw/openclaw#86439))
- Package/install/release: align npm package exclusions and inventory, omit unpacked test helpers, skip Homebrew until macOS packages need it, cap tsdown heap in containers, bound install/release smoke waits, and harden post-publish verification.
- Codex/Auth: bound ChatGPT OAuth token exchange and refresh requests, and honor cancellation across Codex and Anthropic OAuth login flows.
- QA/E2E/CI: bound Telegram, kitchen-sink, Open WebUI, ClawHub, MCP, Discord, realtime, labeler, and GitHub API waits; fail empty explicit test, live-media, gateway CPU, startup benchmark, plugin gauntlet, and beta-smoke runs instead of false-greening.
- Agents/Codex: keep spawned agent bootstrap files rooted in the agent workspace while running task commands, transcripts, and compaction from the requested cwd. ([#&#8203;87218](openclaw/openclaw#87218)) Thanks [@&#8203;mbelinky](https://github.com/mbelinky).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/698
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
…82062)

Forward cache-read token counts through the OpenAI-compatible chat-completions usage shape as prompt_tokens_details.cached_tokens so clients can price cached turns correctly.

Align internal gateway usage typing with the expanded wire shape.

Thanks @caz0075.
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
…82062)

Forward cache-read token counts through the OpenAI-compatible chat-completions usage shape as prompt_tokens_details.cached_tokens so clients can price cached turns correctly.

Align internal gateway usage typing with the expanded wire shape.

Thanks @caz0075.
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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.

3 participants