Skip to content

[Bug]: Windows Desktop v1.24.0 - Saving DeepSeek-v4-flash LLM config throws AttributeError: 'PromptTokensDetailsWrapper' object has no attribute 'cache_creation_tokens' #17785

Open

Description

@weixx2024

Operating System

Windows

Installation Method

Other

Agent Canvas Version

1.24.0

Bug Description

'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.

Image

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.

Activity

  1. added
    bug
    on Sep 29, 2026
  2. weixx2024 commented on Sep 29, 2026

    @weixx2024
    Author
    Image
  3. all-hands-bot commented on Sep 29, 2026

    @all-hands-bot
    Collaborator

    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:

    1. ### 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.
    2. 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.
  4. added
    priority:low
    on Sep 29, 2026
  5. openhands-ai commented on Sep 29, 2026

    @openhands-ai

    I'm on it! all-hands-bot can track my progress at all-hands.dev

  6. openhands-ai commented on Sep 29, 2026

    @openhands-ai

    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

    Artifact Latest published Contains #5327 fix?
    SDK main branch (software-agent-sdk) merge 71612374 (2026-09-28) ✅ hasattr(prompt_details, "cache_creation_tokens") added
    openhands-sdk / openhands-agent-server PyPI 1.49.6 (published 2026-09-25) ❌ (I extracted the 1.49.6 wheel — guard absent)
    openhands-automation PyPI 1.15.1 ❌
    @openhands/typescript-client npm latest 1.49.6 ❌

    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)

    1. The SDK maintainers cut the release that contains software-agent-sdk#5327 (and automation bumps to match — automation pins openhands-sdk exactly)
    2. 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.

  7. weixx2024 commented on Sep 29, 2026

    @weixx2024
    Author

    Hi, I have updated the issue body as requested:

    1. Added the screenshot of the error to the "Actual Behavior" section.
    2. Confirmed that this issue occurs on the official packaged Windows Desktop build (v1.24.0).
    3. Added context regarding the SDK version mismatch.

    Please let me know if any further details are needed. Thanks!

  8. added
    feature-map:mapped
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfeature-map:mappedpriority:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions