Skip to content

v0.5.5: safe default switching and pending-write protection

Choose a tag to compare

@wowayou wowayou released this 10 Oct 05:41
400536f

Changes

  • Switch a saved Pi default without rewriting its provider. The sidebar asks which model to use; the clean step-3 action and the post-save success action use the same revision-checked POST /api/providers/set-default. Only settings.json.defaultProvider and defaultModel change. models.json, handwritten model fields and auth.json remain byte-for-byte intact.
  • All three Pi wizard steps agree about Save Changes. A radio-only edit on a non-default provider cannot trigger a no-op provider save that re-normalizes its models. The footer points to Set as default, while unsaved-change protection remains active. Changing only the current default's model works from any step through the settings-only path.
  • Saved-provider switching in each sidebar uses the dedicated selection path. Codex's clean step-3 switch now uses /api/codex/activate; Claude's row action uses /api/claude/activate. Claude's step-3 save semantics are unchanged. Pi's success and Settings screens explain project/session overrides of a global default.
  • Pending saves/switches cannot discard a later draft. A shared synchronous guard rejects competing writes even before buttons re-render. Editing, navigation and toast actions are briefly disabled until the request settles; success, validation refusal, 400/409 and network failure release the guard without replaying blocked actions. Pending writes also arm the leave prompt. Locked dialogs keep keyboard focus inside and restore the surviving menu trigger on close.
  • Codex activation errors stay visible on its success page. Failed switching keeps the last real result and shows the persistent error banner; a 409 retains Reload after the toast expires, and subsequent non-conflict errors do not inherit it.
  • Codex demo switching keeps Settings consistent. The active provider, default model, reasoning effort, owned table and presence markers move together; unrelated settings/runtime state remain intact, with no real configuration POST.
  • Saving a bridged Codex provider preserves omitted upstream-ID mappings. The form has no bridge.models control, so omission keeps the saved mapping; an explicit {} still clears it.

Verification and compatibility

Validated against Pi 1.1.0; declared compatibility baselines unchanged.

  • Fresh locked install and full local npm test: 317 tests, 315 passed, 0 failed, 2 Windows-only Claude launcher skips.
  • Production browser: 45/45. Real Codex 0.160.0: 5/5, including LiteLLM; real Pi 1.1.0: 3/3; real Claude Code 2.1.285: 10/10, including interactive terminal cases. No real-binary skips locally.
  • PR #165 passed the required ci-passed aggregate: Node 18/20/22, production-browser UI and Windows launcher jobs. Both locally skipped Windows launcher cases passed there; real Windows Claude passed its seven supported cases (the three POSIX-pty cases are Linux-only).
  • An extracted Linux/WSL package passed 12/12 production-page, default-switch, credential-safety, config-preservation, Codex/Claude adapter and offline Pi checks without node_modules.
  • Negative regressions, held real requests/responses, synchronous re-entry, 400/409/network failures, toast expiry and keyboard focus were exercised. Production preview checked at 1440px and 390px in both themes. No normal user configuration or live inference gateway was used.

Linux/WSL and Windows archives contain the built UI, dependency-free server and Claude launcher. Node.js 18+ is required; the Windows launcher uses PowerShell 7. Each archive has a SHA-256 sidecar. No agent upgrade or configuration migration is performed by this release.

The independent development-only source-map-js security update in PR #164 is not part of this release; it is not a dependency shipped in the runtime archives.

Published package verification

Both platform packages and both SHA-256 sidecars were downloaded after the release workflow completed successfully. Digests, versioned paths, package version and exclusion of local configuration were verified; the published Linux/WSL package again passed the same 12 isolated checks above, including opening its actual production UI in Chrome.

Documentation clarification after checking CC Switch v4.0.6: it reads Pi's global default fields for warnings, but does not write those defaults or read/write auth.json. The paired README wording and published-verification record are corrected in #166; the v0.5.5 tag and package bytes are unchanged.

Full changelog