Skip to content

fix: recover invalid session models and publish commit previews - #161

Merged
kingsword09 merged 6 commits into
mainfrom
fix/issue-160-model-recovery
Sep 20, 2026
Merged

kingsword09 merged 6 commits into
mainfrom
fix/issue-160-model-recovery

Conversation

@kingsword09

@kingsword09 kingsword09 commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

Resuming a session whose saved provider, model ID, or reasoning level is no longer valid leaves the user at a prompt and fails on the next message with Model creation failed.

Inspect the decoded saved selection on both --resume and /resume and open the model picker with the specific problem. Selecting a replacement persists it through the native session API. Cancelling preserves the original selection and unsent input; an empty catalog points to provider setup. Headless prompts exit with code 1 before model creation, identify the affected model, and explain how to recover interactively. Shared defaults and conversation history are preserved.

No blanket provider remapping, lowercasing, retired-model substitution, or bulk SQLite rewrite is added. Existing upstream migrations remain in place; the recovery path handles selections that are still invalid afterward.

The reproduction uses a real persisted SQLite session and runtime with a local mock model endpoint:

bun scripts/repro-session-model.ts
bun scripts/repro-session-model.ts --case model-casing --fullscreen
bun scripts/repro-session-model.ts --case missing-model
bun scripts/repro-session-model.ts --headless

Also adds commit previews using the lockfile-pinned pkg-pr-new publisher and Bun 1.4.1. The workflow builds and tests the locked runtime, audits and install-tests the package, and publishes that exact tarball with a commit-specific executable URL.

Local validation against Desktop 3.14.0 / runtime 0.16.9: full release:build and release:pack, including TypeScript, 642 unit tests, 43 TUI component/end-to-end tests, 30 real-runtime integration tests, 5 real Node SQLite tests, runtime/PTY smoke checks, and an isolated installed-package test. Recovery coverage includes invalid providers/models/reasoning, cancellation with an unsent draft, persistence across another restart, valid selections, an empty catalog, and headless diagnostics. CI additionally validates the packaged runtime across Linux Node 22.19.0/24/26 and macOS Node 24.

Refs #160.

@pkg-pr-new

pkg-pr-new Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
npx https://pkg.pr.new/zcode-app-cli@9f11bce

commit: 9f11bce

@kingsword09
kingsword09 marked this pull request as ready for review September 20, 2026 02:21
@kingsword09
kingsword09 merged commit 8cdc0de into main Sep 20, 2026
7 checks passed
@kingsword09
kingsword09 deleted the fix/issue-160-model-recovery branch September 20, 2026 02:31
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.

1 participant