Repository navigation
修复 dsh 0.2.x 兼容性:ui-chat 启动失败、账本与设置失效(Fixes #1) - #2
Open
WosLovesLife wants to merge 1 commit into
Open
WosLovesLife wants to merge 1 commit into
WosLovesLife wants to merge 1 commit into
Conversation
- fix boot crash: namespace composer dock id usage -> usage-meter; 0.2.x ui-chat owns the bare `usage` id, so the collision failed its activation and blanked the web boot (reproduced on 0.2.1-rc.1 and 0.2.2-rc.1) - fold 0.2.x sessions via session/event + snapshotEvents/seq; persist lastSeq/last so restarts stop double counting - declare volatile Config (currency/budget/pricing) with the official @deepseek-ai/schemastery; auto-import legacy settings.yaml, fall back to settings.yaml.imported when the import is rejected - hand updates to the native plugin manager via pluginNavigation; drop the custom `dsh plugin add` self-updater - add host-fold/config regression tests and a local web smoke script; CI installs the schema dependency - engines.dsh >=0.2.1-rc.1 <0.3.0; 0.1.x users stay on 1.10.0
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.
关联 issue
Fixes #1
根因:不是
dsh.client.inject,而是 composer 插槽 id 冲突issue #1 的报错总是指向
@deepseek-ai/dsh-client-ui-chat,而不是插件自身的条目。实际根因是conversation.composer.dock的插槽 id 冲突:dsh-client-ui-chat自己往该插槽注册了id: "usage"(内置 token 药丸)id: "usage"apply抛错,于是 web boot 报1 entry did not activate/@deepseek-ai/dsh-client-ui-chat: failedissue 里推测的
dsh.client.inject/ peer 范围不是原因;dsh.client没有 inject 列表并不影响加载。改动
usage→usage-meter,order: 2(排在原生 activity=0 / usage=1 之后),并用“费用”前缀与原生 token 药丸区分。lib/client.jssession.events。宿主改为监听session/event的单事件 + 启动时snapshotEvents(fromSeq)回填,用event.seq去重;并把lastSeq/last随账本持久化,修掉 Harness 重启后重复累加历史用量的问题。lib/index.jsConfig(currency/budget/pricing,pricing为模型名 → 档位价的 dict)。0.2.x 首次启动会把旧settings.yaml的usage-meter:节自动导入 profile entry,并在 设置 → 插件 自动生成表单;导入失败时回退读取settings.yaml.imported并告警。pluginNavigation.openList()打开 0.2.2 原生插件管理(带回滚与兼容检查),删除自定义dsh plugin add自更新逻辑。2.0.0;engines.dsh: >=0.2.1-rc.1 <0.3.0。0.1.x 用户停留在 1.10.0(breaking change)。scripts/test-host-fold.mjs(0.2 事件 fold / retry / seq 去重 / 重启恢复)、scripts/test-config.mjs(Config 形状、旧 YAML 解析、槽位 id 断言)、scripts/smoke-web.mjs(临时 DSH_HOME + 打包安装 + headless Chrome)。CI 增加npm install以安装唯一的官方依赖。验证
npm test:14 项定价解析 + host fold + Config/槽位,全部通过npm run smoke(0.2.2-rc.1):打包安装 → 临时 profile 启动 → headless Chrome;无 boot 失败;/usage-meter/state正常;旧settings.yaml的USD / budget 3 / pricing 0.5自动导入并下发/usage-meter/state正常;settings.yaml自动导入为USD / budget 3 / pricing 0.5/usage-meter/state返回 200,当前会话真实用量写入 5 个会话、3 个小时桶;无新的 crash log兼容性与风险
@deepseek-ai/schemastery(Harness 官方、MIT、约 23KB ESM)。这是 0.2.x volatile Config 与settings.yaml自动导入的前提;没有 vendor 一份校验器,避免维护分叉。session.snapshotEvents在 0.2.2 已标记 deprecated;它是当前唯一可用的回填读法,后续可迁移到新的 Session API。pricing是 volatile dict,设置页的 dict 编辑器体验一般;currency/budget是普通字段。面板 chip 与原生 Usage 药丸会并存(原生显示 token/缓存,插件显示费用/余额,定位不同)。Checklist
/state、设置迁移验证engines.dsh收紧并有 CI 覆盖