Repository navigation
fix(client): read conversation nodes from the chat slot source (dsh >= 0.1.2) - #12
Merged
Merged
Conversation
fix(host): use session.snapshotEvents() for dsh-session >= 0.1.2-rc.1
…session >= 0.1.2-rc.1) - fix(host): adapt /usage route to use session.snapshotEvents() for dsh-session >= 0.1.2-rc.1 with fallback to legacy session.events (Max-Samson#7) - test: add coverage for snapshotEvents() preference and fallback under /usage - docs: update README and CHANGELOG to 1.1.4 - chore: bump version to 1.1.4 in package.json and package-lock.json
adj: add 4.1 flash and price change 0910
…ly time ctx.effect(() => fileSource.dispose(), ...) calls dispose while the fiber is being built and registers undefined as the disposer: the file source is dead before its first read, so pricing.json is never applied and the change watcher never fires. Return a disposer instead. Test mocks now follow cordis semantics (run setup, keep the returned disposer, release it in after()) and a /pricing route regression test covers the override path - it fails against the old form.
…= 0.1.2) The session snapshot no longer carries chat.legacy.nodes: since dsh 0.1.2 the chat view is a separate scoped source exposed to slot entries as props.useChat. snapshotNodes() therefore returned an empty array, which silently killed the per-turn cost badge (messageId -> turn attribution), the model chip in the dock line and the observed-round fallback. Add useSessionNodes(useChat, useSession): it prefers the chat source and keeps the old session.chat path as a fallback for older runtimes. Both hooks are called unconditionally so the hook order stays stable.
rezon-aki
force-pushed
the
pr/chat-source-nodes
branch
from
September 20, 2026 00:40
97d0067 to
d86d476
Compare
Max-Samson
self-requested a review
September 23, 2026 15:16
Owner
|
Thank you so much for this clean and timely fix! Adapting to the new chat scoped source ( Really appreciate your contribution and attention to detail! |
rezon-aki
added a commit
to rezon-aki/dsh-usage-chart
that referenced
this pull request
Sep 23, 2026
- 上游 v1.1.7 已收录本 fork 早先提的 4 项修复(PR Max-Samson#10/Max-Samson#12/Max-Samson#14/Max-Samson#15)与合并事故修复 (9753856),fork 不再重复维护它们;README / FORK_NOTES 改为「已并入上游」的口径。 - fork 独有改动只剩「面板可拖动」:panel-position.ts(持久化 + 包含块夹取)+ UsageIndicator 把手/双击复位 + i18n/styles + tests/panel-position.test.mjs, 直接取自上游 v1.1.7 基线上的实现(与本地 live 仓库同一份代码)。 - CHANGELOG 中英新增 [1.1.7-dsh.1] 段。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On dsh >= 0.1.2 the per-turn cost badge never renders, the model chip in the dock line disappears, and the observed-round fallback in the panel piles every round onto turn 0.
Root cause
Since dsh 0.1.2 the conversation nodes are published by the chat scoped source, not by the session snapshot.
SessionSnapshothas nochat/nodesfield; ui-chat registers the source withuiSession.provide({ hooks: ["chat"] })and slot entries receive it asprops.useChat— the same call the built-inStatsPillsmakes (useChat((s) => s.legacy.nodes)).snapshotNodes()still readsession.chat.legacy.nodes, so it returned an empty array and every node-derived value fell through silently.Fix
useSessionNodes(useChat, useSession)(src/client/snapshot.ts): preferchat.legacy.nodes, keep the session-snapshot path as the fallback for older runtimes. Both hooks are called unconditionally in a fixed order so the hook count stays stable across renders.CostBadgeandUsageIndicatorread nodes through it and accept an optionaluseChatprop.3 files, +35/-6, no new dependencies.
Verification
npm run typecheck— clean.npm test— 41/41 pass (node 22, dsh 0.1.5-rc.2).GET /plugins/??dsh-usage-chart/client.js→ HTTP 200); with it the per-turn badge, the model chip and the per-turn fallback attribution are restored.