Skip to content

feat: support DSH 0.2.2-rc.2 and continue failed generations - #142

Open
Lum1104 wants to merge 4 commits into
mainfrom
feat/dsh-0.2.2
Open

Lum1104 wants to merge 4 commits into
mainfrom
feat/dsh-0.2.2

Conversation

@Lum1104

@Lum1104 Lum1104 commented Nov 13, 2026

Copy link
Copy Markdown
Member

升级至 DSH 0.2.2-rc.2,要求 Node.js >=24.9.0,同步运行依赖、安装脚本和中英文 README。

  • 迁移图片引用、历史分页和会话订阅,实时同步运行状态、模型和权限。
  • 增加“继续生成”入口,继续请求时保留输入框草稿。
  • 删除会话时等待宿主完成 worktree 清理,再移除会话日志。

Copilot AI max review requested due to automatic review settings November 13, 2026 15:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved state-ordering and observer-lifecycle bugs can leave controls stale, miss live updates, or reject prompts, while purge handling can block deletion or hide retained conversations after cleanup failures.

8 open issues
What changed in this PR

Updates the browser extension and bridge for DSH 0.2.2-rc.2, adding failed-generation continuation and coordinating session deletion with host worktree cleanup.

Changes:

  • Aligns dependencies, installers, and documentation with Node.js >=24.9.0.
  • Migrates attachment and history APIs and synchronizes live session state, models, and permissions.
  • Adds draft-preserving continuation and expands runtime, browser, and unit coverage.
File Description
scripts/​uninstall.sh Updates the missing-Node error message.
scripts/​uninstall.mjs Enforces the new minimum Node.js version.
scripts/​smoke-runtime.mjs Exercises migrated APIs, continuation, and worktree cleanup.
scripts/​smoke-browser.mjs Checks cancellation, images, continuation, and live controls.
scripts/​install.sh Checks Node.js compatibility and updates startup guidance.
scripts/​install.ps1 Adds Windows version checks and updated startup guidance.
scripts/​fixtures/​runtime-probe.mjs Provides image and worktree smoke fixtures.
scripts/​fixtures/​browser-probe.mjs Adapts tool execution and cancellation fixtures.
README.zh.md Updates Chinese requirements and continuation guidance.
README.md Updates English requirements and continuation guidance.
pnpm-workspace.yaml Updates the dependency-version comment only.
packages/​browser/​bridge-browser/​tests/​session-deferral.spec.ts Uses non-empty prompts for materialization tests.
packages/​browser/​bridge-browser/​tests/​remote-host-api.spec.ts Updates pagination, activation, and observer expectations.
packages/​browser/​bridge-browser/​tests/​manifest.spec.ts Checks updated runtime and peer requirements.
packages/​browser/​bridge-browser/​tests/​index.spec.ts Updates the required-host error assertion.
packages/​browser/​bridge-browser/​tests/​composition.spec.ts Adds the native tool executor to fixtures.
packages/​browser/​bridge-browser/​src/​session-purge.ts Waits for archive cleanup before removing logs.
packages/​browser/​bridge-browser/​src/​session-deferral.ts Rejects continuation on provisional sessions.
packages/​browser/​bridge-browser/​src/​server.ts Orders state reads with prompt and cancellation calls.
packages/​browser/​bridge-browser/​src/​remote-host-api.ts Migrates pagination and adds live session observers.
packages/​browser/​bridge-browser/​src/​index.ts Connects deletion to host worktree cleanup.
packages/​browser/​bridge-browser/​README.zh.md Documents migrated bridge behavior in Chinese.
packages/​browser/​bridge-browser/​README.md Documents migrated bridge behavior in English.
packages/​browser/​bridge-browser/​package.json Updates dependencies and optional cleanup-service peers.
packages/​browser/​bridge-browser/​cordis.patch.yml Updates the example command in a comment only.
package.json Pins the new runtime and declares Node.js requirements.
extensions/​dsh-browser/​tests/​transient-events.spec.ts Checks complete-state replay behavior.
extensions/​dsh-browser/​tests/​sessions.spec.ts Adapts runtime-cache tests to explicit state setters.
extensions/​dsh-browser/​tests/​session-observations.spec.ts Tests projection merging and continuation eligibility.
extensions/​dsh-browser/​tests/​panel-composer-controls.spec.ts Drives controls through state and projection events.
extensions/​dsh-browser/​src/​panel/​styles.css Styles the continuation button.
extensions/​dsh-browser/​src/​panel/​strings.ts Adds English and Chinese continuation labels.
extensions/​dsh-browser/​src/​panel/​sessions.ts Separates running-state updates from question clearing.
extensions/​dsh-browser/​src/​panel/​session-observations.ts Caches observations and determines continuation eligibility.
extensions/​dsh-browser/​src/​panel/​MessageImages.tsx Requests images using complete attachment references.
extensions/​dsh-browser/​src/​panel/​App.tsx Integrates live observations and draft-preserving continuation.
extensions/​dsh-browser/​src/​background/​transient-events.ts Replays the latest complete session states.

Review effort: Max

if (projections === undefined) {
applyImageProjection(sessionId, -1, undefined)
return
function applyObservedSession(sessionId: string): void {
Comment on lines +1405 to +1406
observationsRef.current.baseline(id, history.projections ?? { asOfSeq: -1, values: {} })
applyObservedSession(id)
Comment on lines +2149 to +2152
const observed = await api.rpc<SessionState>('session.state', { sessionId: id })
observationsRef.current.setState(id, observed)
sessionRuntimeRef.current.setRunning(id, observed.running)
sessionRuntimeRef.current.clearQuestions(id)
const ending = this.value(sessionId, 'conversationContinuation')
const state = this.states.get(sessionId)
return typeof ending === 'number' && Number.isSafeInteger(ending) && ending >= 0
&& state !== undefined && !state.running && state.pendingInput.length === 0
const pending = await worktrees.cleanupOf(session, null)
const cleanup = pending?.status === 'scheduled'
? await worktrees.cleanupOf(session, pending.revision) : pending
if (cleanup?.status === 'failed') throw new Error('worktree cleanup failed')
if (this.followedSessionId === sessionId && this.followAbort?.signal.aborted === false) return
await this.openSessionFollow(sessionId, callSignal)
if (this.followedSessionId === sessionId && this.followAbort?.signal.aborted === false) {
await this.followOpening
args: {
request: {
address: { kind: 'session', sessionId },
activate: true,
Comment on lines +662 to +663
this.track(this.pumpSessionObserver(sessionId, revision, projectionIterator, signal, 'projection', projectionSeq))
this.track(this.pumpSessionObserver(sessionId, revision, stateIterator, signal, 'state'))
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