Skip to content

v0.4.0

Choose a tag to compare

@chen1pengvincent chen1pengvincent released this 06 Oct 08:17
· 13 commits to main since this release

[0.4.0] - 2026-10-06

Added

  • Attach x-opencode-session per conversation for OpenCode / OpenCode Go
    routes at request time, without writing settings.
    • llm/stream reads options.provider + the durable options.sessionId.
    • AsyncLocalStorage wraps the downstream chunk stream; a globalThis.fetch
      patch injects the header only while that window is active.
    • Scoped to OpenCode provider prefixes (opencode-go / opencode, including
      the -responses / -messages siblings) and to OpenCode hosts.
    • Default value is an opaque random UUID per DSH session — stable within a
      conversation, new on session switch, never the raw internal session id.
    • Never overrides a header the caller already set (safe on pi-ai 0.86+ and
      with static headers).
  • lib/session-header.js and tests/session-header.test.js.
  • Config block sessionHeader ({ enabled, mode, providers }), overridable by
    id in the profile cordis.patch.yml.

Fixed

  • 400 MissingSessionID from OpenCode Go for routes this plugin declares with
    an explicit api: (which pi-ai's built-in wrapper does not cover).

Changed

  • package.json: 0.3.0 -> 0.4.0; discovery user-agent -> dsh-model-sync/0.4.0.
  • lib/index.js: stale v1 docstring aligned with the v2 read-only behavior.
  • npm test script: node --test tests/ -> node --test (works on Node 24).

Verified

  • Unit tests: 32/32 pass.
  • Real credential, POST /zen/go/v1/chat/completions (deepseek-v4.1-flash):
    no header -> 400 MissingSessionID; with x-opencode-session -> 200.
  • Real OpenAI SDK 6.40 end-to-end: patch active -> 200; wrong host scope -> 400.
  • Model reachability: kimi-k3 200; ox-alpha-free unavailable upstream,
    its settings entry repointed to the current omen-alpha (200).

Compatibility

  • DSH kernel 0.1.2-rc.1+; verified on DSH Desktop 2.0.11,
    dsh-llm-pi-ai@0.1.5-rc.2, @earendil-works/pi-ai@0.85.1.
  • No effect on non-OpenCode providers.

Full Changelog: v0.3.0...v0.4.0