You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Windows Desktop v1.24.0 - Saving DeepSeek-v4-flash LLM config throws AttributeError: 'PromptTokensDetailsWrapper' object has no attribute 'cache_creation_tokens' #17785
bugSomething isn't workingfeature-map:mappedLinked from a feature-map note. May be reproduced or blocked; see the note for evidence.priority:lowMinor or narrowly scoped bug with low user or operational impact.
'PromptTokensDetailsWrapper' object has no attribute 'cache_creation_tokens'
Steps to Reproduce
Describe the bug
On the Windows desktop version of OpenHands v1.24.0, when I fill in the correct API key and select deepseek-v4-flash as the model under the DeepSeek provider, clicking the save parameters button immediately triggers an AttributeError. The error message shows that the PromptTokensDetailsWrapper object does not have the cache_creation_tokens attribute, and the configuration cannot be saved successfully.
To Reproduce
Steps to reproduce the behavior:
1.Launch OpenHands Windows desktop client (version 1.24.0).
2.Navigate to the LLM configuration page.
3.Select LLM provider as DeepSeek, fill in the correct API key, and set the model to deepseek-v4-flash.
4.Click the save parameters button.
5.The error pops up directly, and the configuration fails to save.
Expected behavior
The configuration page should verify the API key normally, save the DeepSeek-v4-flash settings successfully, and not crash due to missing cache-related token attributes.
Actual Behavior
When clicking save, the application crashes with the following error: AttributeError: 'PromptTokensDetailsWrapper' object has no attribute 'cache_creation_tokens'
See the attached screenshot for the full error dialog/console output.
Relevant Logs
See Actual Behavior
Acceptance Criteria
No response
Screenshots
No response
Additional Context
Installation Source: Official Windows Desktop Installer (v1.24.0).
LLM Provider: DeepSeek
Model: deepseek-v4-flash
Root Cause Analysis: As noted by the OpenHands AI agent, this is a known issue in the pinned openhands-sdk version (1.49.6) where cache_creation_tokens is accessed without a guard. The fix exists in the SDK main branch but has not yet been released in a version compatible with this desktop build.
The following comments were added by the OpenHands AI agent.
Decision needed
The crash is real, and its source is outside this repository. 'PromptTokensDetailsWrapper' object has no attribute 'cache_creation_tokens' is raised in the SDK's usage telemetry (openhands-sdk/openhands/sdk/llm/utils/telemetry.py, normalize_usage), which reads prompt_tokens_details.cache_creation_tokens behind a model_fields_set membership check but without a hasattr guard. litellm deletes that attribute whenever the value is None — which is what a provider that reports cache reads with no cache-creation count (DeepSeek here) produces — so the attribute access throws. The SDK already fixed this on its main branch (OpenHands/software-agent-sdk#5327, merged 2026-09-28), but the fix is not in any published release yet: the newest openhands-sdk / openhands-agent-server is 1.49.6 (published 2026-09-25), which is the version the 1.24.0 desktop build pins. Canvas' only in-repo remedy is to consume the agent-server/SDK release that contains the fix (the coordinated version bump used in #17701), so no Canvas code change resolves this today.
The repo's bug template requires two things before this issue can be labeled ready-for-dev, and both can only come from you:
### Steps to Reproduce must reference a supported run method (npx @openhands/agent-canvas / agent-canvas, npm run dev or npm run dev:minimal, or app.all-hands.dev/canvas); it currently says "Launch OpenHands Windows desktop client". Please confirm whether the same failure reproduces on Windows with one of those methods, or confirm the packaged Windows desktop build is the intended target.
The issue body's ### Actual Behavior section must include a screenshot or video of the bug. A screenshot is attached in a comment on this issue; please attach it (or an equivalent) to ### Actual Behavior in the body itself.
I've thoroughly investigated this issue, and here is the bottom line: no code change in this repository can resolve this issue today, and I have verified that rigorously rather than pushing a fake or broken "fix".
What the crash actually is
The error 'PromptTokensDetailsWrapper' object has no attribute 'cache_creation_tokens' originates outside this repo, in the SDK's usage-telemetry normalization:
openhands-sdk/openhands/sdk/llm/utils/telemetry.py → normalize_usage() reads prompt_tokens_details.cache_creation_tokens guarded only by "cache_creation_tokens" in prompt_details.model_fields_set — with no hasattr guard.
litellm deletes that attribute from the instance whenever the value is None. DeepSeek reports cache-reads with no cache-creation count → None → attribute deleted → AttributeError.
The same provider-family crash (minimax-m3) is the verified repro for the upstream fix.
Verified: the upstream fix is merged but not in any published release
I confirmed #5327's patch (+and hasattr(prompt_details, "cache_creation_tokens")), that it's in SDK main but that no release tag or wheel newer than 1.49.6 exists anywhere (GitHub releases, PyPI, npm).
Why a Canvas-side bump can't happen yet
This repo's only in-repo remedy is the coordinated version bump (the pattern from #17701, already merged — config/defaults.json currently pins agent-server/SDK 1.49.6 + automation 1.15.1, and the npm client 1.49.6):
The launcher (buildAgentServerCommand in scripts/dev-safe.mjs), the desktop app (runs it via scripts/dev-with-automation.mjs), and Docker all source the agent-server/SDK from config/defaults.json. The version-sync checker (node scripts/check-sdk-version-sync.mjs, CI-enforced) verifies the released openhands-automation deps match versions.agentServer. I ran it — it passes today at 1.49.6.
Bumping to the containing-fix release right now is impossible: no such published release exists. Pointing at an unverified yet release (or git ref) would (a) break the sync check (404 from PyPI), (b) violate the documented convention that agent-canvas pins only released versions, and (c) ship a configuration matching nothing real。
Raising compatibility.minimumAgentServer (currently 1.28.0 above this — would reject the current bundled backend everywhere and break every local/desktop user. That gate guards API/schema contracts, not SDK-internal-crash telemetry — not applicable here。
Also per the triage comment's two blocking asks: only the issue author can provide them (confirm the reproduction method/screenshot), so I haven't touched the issue body either.
Concrete next step (when ready)
The SDK maintainers cut the release that contains software-agent-sdk#5327 (and automation bumps to match — automation pins openhands-sdk exactly)
Then the coordinated bump mirrors Update Agent Canvas to SDK 1.49.6 and Automation 1.15.1 #17701: versions.agentServer + versions.automation in config/defaults.json, the @openhands/typescript-client pin in package.json/package-lock.json, plus mirrored examples/tests (.agents/skills/local-stack-runtime/references/guide.md, scripts/dev-safe.mjs JSDoc, scripts/check-sdk-version-sync.mjs docs, __tests__/scripts/dev-safe.test.ts), validated with node scripts/check-sdk-version-sync.mjs --check-pypi and the focused Vitest suites。
I did not create a branch/PR because there is no honest change to make — the only meaningful fix lives upstream and isn't released yet. Once the SDK release lands, I can implement that bump immediately.
bugSomething isn't workingfeature-map:mappedLinked from a feature-map note. May be reproduced or blocked; see the note for evidence.priority:lowMinor or narrowly scoped bug with low user or operational impact.
Activity
weixx2024 commentedon Sep 29, 2026
all-hands-bot commentedon Sep 29, 2026
The following comments were added by the OpenHands AI agent.
Decision needed
The crash is real, and its source is outside this repository.
'PromptTokensDetailsWrapper' object has no attribute 'cache_creation_tokens'is raised in the SDK's usage telemetry (openhands-sdk/openhands/sdk/llm/utils/telemetry.py,normalize_usage), which readsprompt_tokens_details.cache_creation_tokensbehind amodel_fields_setmembership check but without ahasattrguard. litellm deletes that attribute whenever the value isNone— which is what a provider that reports cache reads with no cache-creation count (DeepSeek here) produces — so the attribute access throws. The SDK already fixed this on its main branch (OpenHands/software-agent-sdk#5327, merged 2026-09-28), but the fix is not in any published release yet: the newestopenhands-sdk/openhands-agent-serveris 1.49.6 (published 2026-09-25), which is the version the 1.24.0 desktop build pins. Canvas' only in-repo remedy is to consume the agent-server/SDK release that contains the fix (the coordinated version bump used in #17701), so no Canvas code change resolves this today.The repo's bug template requires two things before this issue can be labeled
ready-for-dev, and both can only come from you:### Steps to Reproducemust reference a supported run method (npx @openhands/agent-canvas/agent-canvas,npm run devornpm run dev:minimal, orapp.all-hands.dev/canvas); it currently says "Launch OpenHands Windows desktop client". Please confirm whether the same failure reproduces on Windows with one of those methods, or confirm the packaged Windows desktop build is the intended target.### Actual Behaviorsection must include a screenshot or video of the bug. A screenshot is attached in a comment on this issue; please attach it (or an equivalent) to### Actual Behaviorin the body itself.openhands-ai commentedon Sep 29, 2026
I'm on it! all-hands-bot can track my progress at all-hands.dev
openhands-ai commentedon Sep 29, 2026
I've thoroughly investigated this issue, and here is the bottom line: no code change in this repository can resolve this issue today, and I have verified that rigorously rather than pushing a fake or broken "fix".
What the crash actually is
The error
'PromptTokensDetailsWrapper' object has no attribute 'cache_creation_tokens'originates outside this repo, in the SDK's usage-telemetry normalization:openhands-sdk/openhands/sdk/llm/utils/telemetry.py→normalize_usage()readsprompt_tokens_details.cache_creation_tokensguarded only by"cache_creation_tokens" in prompt_details.model_fields_set— with nohasattrguard.None. DeepSeek reports cache-reads with no cache-creation count →None→ attribute deleted →AttributeError.Verified: the upstream fix is merged but not in any published release
71612374(2026-09-28)hasattr(prompt_details, "cache_creation_tokens")addedopenhands-sdk/openhands-agent-serverPyPIopenhands-automationPyPI@openhands/typescript-clientnpmI confirmed #5327's patch (
+and hasattr(prompt_details, "cache_creation_tokens")), that it's in SDKmainbut that no release tag or wheel newer than 1.49.6 exists anywhere (GitHub releases, PyPI, npm).Why a Canvas-side bump can't happen yet
This repo's only in-repo remedy is the coordinated version bump (the pattern from #17701, already merged —
config/defaults.jsoncurrently pins agent-server/SDK1.49.6+ automation1.15.1, and the npm client1.49.6):buildAgentServerCommandinscripts/dev-safe.mjs), the desktop app (runs it viascripts/dev-with-automation.mjs), and Docker all source the agent-server/SDK fromconfig/defaults.json. The version-sync checker (node scripts/check-sdk-version-sync.mjs, CI-enforced) verifies the releasedopenhands-automationdeps matchversions.agentServer. I ran it — it passes today at 1.49.6.compatibility.minimumAgentServer(currently1.28.0above this — would reject the current bundled backend everywhere and break every local/desktop user. That gate guards API/schema contracts, not SDK-internal-crash telemetry — not applicable here。Also per the triage comment's two blocking asks: only the issue author can provide them (confirm the reproduction method/screenshot), so I haven't touched the issue body either.
Concrete next step (when ready)
openhands-sdkexactly)versions.agentServer+versions.automationinconfig/defaults.json, the@openhands/typescript-clientpin inpackage.json/package-lock.json, plus mirrored examples/tests (.agents/skills/local-stack-runtime/references/guide.md,scripts/dev-safe.mjsJSDoc,scripts/check-sdk-version-sync.mjsdocs,__tests__/scripts/dev-safe.test.ts), validated withnode scripts/check-sdk-version-sync.mjs --check-pypiand the focused Vitest suites。I did not create a branch/PR because there is no honest change to make — the only meaningful fix lives upstream and isn't released yet. Once the SDK release lands, I can implement that bump immediately.
weixx2024 commentedon Sep 29, 2026
Hi, I have updated the issue body as requested:
Please let me know if any further details are needed. Thanks!