Skip to content

fix: add missing imageRequestPricing method to ZenAdapter - #14

Open
superzzm2026 wants to merge 1 commit into
FishBottle7:masterfrom
superzzm2026:fix/imageRequestPricing
Open

superzzm2026 wants to merge 1 commit into
FishBottle7:masterfrom
superzzm2026:fix/imageRequestPricing

Conversation

@superzzm2026

Copy link
Copy Markdown

Problem

When using the opencode2dsh plugin with DSH Desktop, running /compact throws:

TypeError: this.adapters.get(...)?.adapter.imageRequestPricing is not a function

Root Cause

The ZenAdapter class (structural LlmAdapter implementation) does not implement the imageRequestPricing method. The LlmAdapter base class in @deepseek-ai/dsh-llm defines imageRequestPricing(_provider, _model) {} as a default no-op. Since ZenAdapter uses structural implementation, it must explicitly implement this method.

Fix

/** No image pricing for the free Zen lane. */
imageRequestPricing(_provider: string, _model: string): undefined {
  return undefined
}

Impact

  • Severity: Medium — affects any user running /compact or image-related requests
  • Scope: Single method addition, no behavioral change
  • Risk: Zero — returns undefined (same as base class default)

Reproduction

  1. Install @opencode2dsh/dsh-plugin (v0.3.1 ~ v0.3.3 all affected)
  2. Run /compact in DSH Desktop
  3. Observe: this.adapters.get(...)?.adapter.imageRequestPricing is not a function

@superzzm2026

Copy link
Copy Markdown
Author

⚠️ Severity Update: High — Automatic Context Compression Broken

I want to highlight that this bug has a more critical impact than initially described:

This bug silently breaks DSH's automatic context compression (/compact).

When a conversation grows long, DSH automatically triggers /compact to compress the context and stay within token limits. Because imageRequestPricing is missing from ZenAdapter, this auto-compression crashes every time with:

TypeError: this.adapters.get(...)?.adapter.imageRequestPricing is not a function

Consequences:

  • Long conversations cannot be automatically compressed, leading to context overflow
  • Users may experience silent context loss, degraded model responses, or session errors
  • Manual /compact also fails with the same error
  • This affects every user of the opencode2dsh plugin (v0.3.1, v0.3.2, v0.3.3)

The fix is a single method addition that returns undefined (matching the base class default), with zero risk of behavioral change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant