Repository navigation
v1.1.6: Merge pull request #11 from Max-Samson/pr-10
Summary
Fixes a bug where custom pricing.json file overrides were never applied and the file change watcher never fired (PR #10), and bumps the release
version to 1.1.6:
-
User-visible change:
- Restores custom pricing configuration: previously,
/dsh-usage-chart/pricingreportedsource: "builtin"for every model even when a custompricing.jsonwas present and valid, and file edits
never triggered automatic recalculation. - Fixes Cordis lifecycle timing in
src/index.ts:ctx.effect(() => fileSource.dispose(), ...)invokeddispose()synchronously at plugin registration time while the fiber was being created and
registeredundefinedas the disposer. This prematurely killedfilePricingSourcebefore its initial async read resolved and closed the directory watcher. Changing this to return a disposer function
(ctx.effect(() => () => fileSource.dispose(), ...)) ensures the file source remains active throughout the fiber lifecycle and is released only when the plugin is unloaded. - Aligns test mocks in
tests/core.test.mjs,tests/pricing.test.mjs, andtests/rounds.test.mjswith Cordis lifecycle semantics (collecting disposers and running them inafter()). - Adds a dedicated regression test covering the
/pricingroute with userpricing.jsonoverrides enabled. - Bumps version to
1.1.6acrosspackage.json,package-lock.json,README.md,README_ZH.md,CHANGELOG.md, andCHANGELOG_ZH.md.
- Restores custom pricing configuration: previously,
-
Why it belongs in this plugin:
- Accurate token cost accounting relies on the single-source-of-truth resolution hierarchy: User
pricing.jsonoverride → Built-in official pricing → Conservative fallback. Premature disposal
broke the first and highest-priority tier entirely for users configuring custom or enterprise rates.
- Accurate token cost accounting relies on the single-source-of-truth resolution hierarchy: User