The Host session catalog previously discarded adapter-owned input modalities, so downstream Desktop consumers could not distinguish image-capable routes even when the provider declared them. Patch the exact published rc.2 bundle and keep schema, runtime projection, and public types aligned.
Constraint: Desktop consumes the published Host bundle and must not modify the pinned Harness submodule.
Rejected: Add model selection or attachment UI here | those are separate presentation concerns from the catalog contract.
Confidence: high
Scope-risk: narrow
Directive: Remove this patch when a future Host release preserves inputModalities natively.
Tested: focused package surface 32 passed, 1 skipped; schema behavior; full yarn check with Market 274 and Desktop 808 passed, 4 skipped; immutable install; three safety review rounds.
Not-tested: Live DeepSeek API catalog response against a packaged Desktop build.
Related: #460, #470
Desktop ships the published token-meter package, and that package can persist negative projection totals after compaction drift. Clamp the two O(1) totals and bump their state versions so existing bad cache rows are invalidated and rebuilt from the session log instead of failing history restore.
Constraint: deepseek-harness is a pinned submodule and must stay untouched on desktop branches
Rejected: Patch SessionProjectionRegistry checkpoint validation only | does not self-heal already persisted bad rows
Rejected: Edit deepseek-harness directly | repository policy requires Desktop fixes through the patch layer
Confidence: high
Scope-risk: narrow
Directive: Remove this Desktop token-meter patch once a published @deepseek-ai/dsh-token-meter release includes the clamp and state-version bump
Tested: corepack yarn workspace dsh-plugin-desktop test tests/token-meter-negative-projection.spec.ts
Tested: corepack yarn workspace dsh-plugin-desktop typecheck
Tested: corepack yarn workspace dsh-plugin-desktop build
Tested: corepack yarn install --immutable
Not-tested: Full workspace test suite
Not-tested: Packaged desktop smoke
Desktop ships upstream rc packages through Yarn patch resolutions, so the empty-name guard belongs in the patched agent loop rather than in a desktop-only wrapper. The new regression loads the installed loop implementation, exercises an empty-name tool call directly, and proves the turn now ends after one synthetic error with new-session guidance instead of entering normal unknown-tool dispatch.
Constraint: Desktop consumes upstream Harness rc packages through local Yarn patches
Rejected: Patch dsh-llm-deepseek again | adapter already preserves prior non-empty tool-call deltas, but finalized empty names still need loop-level termination
Rejected: Treat all unknown tools as terminal | would broaden behavior beyond the proxy-corruption case from issue #157
Confidence: high
Scope-risk: narrow
Directive: Keep the empty-name guard in the agent loop until upstream ships an rc that closes the loop at source
Tested: yarn workspace dsh-plugin-desktop vitest run tests/empty-tool-call-loop.spec.ts
Tested: yarn workspace dsh-plugin-desktop vitest run tests/deepseek-streaming-tool-call.spec.ts tests/empty-tool-call-loop.spec.ts
Tested: yarn workspace dsh-plugin-desktop vitest run tests/package.spec.ts -t 'patches the agent loop to stop after one empty-name tool call'
Tested: yarn workspace dsh-plugin-desktop typecheck
Tested: yarn workspace dsh-plugin-desktop build
Desktop can project a persisted session before the first session.list baseline has arrived. Preserve that durable target only while the list phase is pending; once a successful baseline confirms it missing, clear the stale target and let the existing recent-workspace startup policy select its default.
The runtime fix ships as a Desktop-owned Yarn patch, with paired regressions for the temporary pre-baseline mask and a deleted session missing from an authoritative baseline.
Constraint: deepseek-harness submodule must remain unmodified; compatibility fixes ship through Desktop-owned patches
Rejected: Treat every absent selected id as pending | deleted or permanently invisible sessions would block startup forever
Rejected: Add an elapsed-time timeout | time does not establish session-list authority and would make restoration nondeterministic
Confidence: high
Scope-risk: narrow
Directive: Preserve a missing persisted selection only while session.list phase is pending; ready is the authority boundary for stale-selection cleanup
Tested: corepack yarn workspace dsh-plugin-desktop test tests/client-runtime-startup-restore.spec.ts; corepack yarn check; git diff --check
Not-tested: Packaged Windows GUI restart on a live machine
Use Koffi 3.1.5's native-compiled Windows binary for every DSH consumer to avoid access-violation crashes from the 3.1.4 cross-compiled build. Add a packaging regression assertion.
Fixes#145.
Fixes#149.