Repository navigation
Conversation
There was a problem hiding this comment.
🟡 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
Reopen Session history after bridge reconnect · New Refresh model and permission directories on history baselines · New Prevent stale unary state replies from overwriting newer state · New Require state cursor to reach the conversation ending before Continue · New Keep failed purges visible and retryable · New Retry the current opener when a replaced opener is aborted · New Release idle Agent ownership before purging a Session · New Keep observers active for every displayed Session · New
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')) |
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.

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