Skip to content

fix: repair what shipped broken in 1.4.1 - #106

Open
viztor wants to merge 7 commits into
claude/vigilant-mendel-bctz9nfrom
claude/vigilant-mendel-bctz9n-p1a
Open

viztor wants to merge 7 commits into
claude/vigilant-mendel-bctz9nfrom
claude/vigilant-mendel-bctz9n-p1a

Conversation

@viztor

@viztor viztor commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Phase P1a of docs/improvement-plan.md. It is stacked on #105 and targets that branch; once #105 merges, its base moves to main.

It makes eight small fixes to defects that shipped in 1.4.1. Each one opened with a test that was red on the base.

# Defect Fix Test
1 The deprecated @viztor/dsh-opencode wrapper re-exported a default that the barrel doesn't have. That is an ESM link error on every load: SyntaxError: … does not provide an export named 'default'. The wrapper is now export * only, written by one shared helper (scripts/wrapper-forwarder.ts). test/wrapper-forwarder.test.ts links the generated entry against the built barrel in a real Node process. vite-node would turn the missing export into undefined and stay green.
2 isZenProvider("opencode-google") answered false, because the "go" inside "google" read as the Go plane. Uses the plane rule catalogPlaneForRoute already encodes: Go is opencode-go or opencode-go-*. request-shape.test.ts, plus a usage-service behaviour case
3 enrichModelsResponse answered a 401, 403, 429 or 5xx with a 200 catalog. Every non-2xx response except 404 passes through untouched. A 404 is still filled from the catalog, because the Go plane's inference base has no /models. catalog.test.ts
4 The warning colour named --dsw-alias-label-warning, which the host doesn't define, so warnings rendered as caption text. Now --dsw-alias-state-warn-label, the token the primitives' own modules use. host-tokens.test.ts checks every token the card files name against the primitives' token set. It was checked by planting a bogus token.
5 The settings spinner animated only while the meter was mounted, because its keyframes lived in the meter's stylesheet. The settings summary carries its own dsh-oc-spin keyframes. settings-usage.test.tsx
6 The stream hook wrote debugFile with debug off. debug is the switch and debugFile is only where it writes. The fetch patch already used this gate. stream-hook.test.ts, lifecycle.test.ts
7 The purge row reported the host's own { ok: false } failure as "not a purge result", and cast the answer. It shows the host's message, and parses the answer through the contract's whitelisting parsePurgeResult. settings-purge.test.ts, settings-card-purge.test.tsx
8 The endpoint copy described modern as /inference/v1, which the plugin never sends. The copy names the per-protocol inference family, and auto as its alias. This is what the code already did; behaviour is unchanged. endpoint-copy.test.ts, pi-provider.test.ts

Behaviour changes worth knowing

  • Gateway errors from a /models listing now reach the host as errors. A 401, 403 or 5xx used to show up as a full catalog. The host now gets a failed listing it can report.
  • debugFile without debug: true no longer writes anything. The README examples that paired debug: false with a debugFile were updated.

Review

The change was reviewed in three lenses: correctness and host contracts, tests, and repository rules. Two independent skeptics checked each finding. Over three rounds the reviewers raised 23 findings; 22 survived as low severity and were fixed, and one was refuted.

Verification

All run locally:

Node Step Result
26 pnpm run check 0 errors; 23 warnings, unchanged from the base
26 unit suite 1207 tests pass, up from 1186
26 shuffled, seeds 1 / 42 / 1234 pass
26 test:mock 51 pass
26 build and scripts/check.ts pass
26 coverage 96.4% lines, 92.2% branches, above the ratchet
24 shuffled (seed 7) and test:mock pass

The diff contains no local paths.


Generated by Claude Code

- The deprecated @viztor/dsh-opencode wrapper re-exported a `default` the
  barrel does not have, an ESM link error on every host load. It now
  forwards `export *` only, written by one shared helper that a test links
  against the built barrel in a real Node process.
- isZenProvider("opencode-google") answered false: "go" inside "google"
  read as the Go plane. It now uses the plane rule the catalog already has.
- enrichModelsResponse answered a 401, 403, 429 or 5xx with a 200 catalog.
  Those statuses now pass through; a 404 is still filled from the catalog,
  because the Go plane's inference base has no /models of its own.
- The warning colour named a token the host does not define, so warnings
  rendered as caption text. They now use --dsw-alias-state-warn-label.
- The settings spinner only animated while the meter was mounted; the
  settings surface now carries its own keyframes.
- The stream hook wrote debugFile with debug off. debug is the switch and
  debugFile only where it writes, the same gate the fetch patch uses.
- The purge row reported the host's own { ok: false } failure as "not a
  purge result" and cast the answer; it now shows the host's message and
  parses through the contract's whitelisting parser.
- The endpoint copy described modern as /inference/v1, which the plugin
  never sends. It now names the per-protocol inference family, and auto as
  its alias, which is what the code already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0141fKp5k6hiaJcP5ovhGtSD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0141fKp5k6hiaJcP5ovhGtSD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0141fKp5k6hiaJcP5ovhGtSD
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.

2 participants