v0.51.16 — 3-PR contributor batch
🐛 Fixed
- #1768 by @franksong2702 — Serialize Anthropic env fallback reads. Closes #1736 (architectural follow-up filed in v0.51.8). Wraps
_clear_anthropic_env_values()and the runtime-provider resolver behind the same_ENV_LOCKalready serializing env save/restore in streaming.py. Race window between concurrent onboarding-clear and chat-read paths now closed for the chat hot path. - #1778 by @Michaelyklam — Preserve CLI session tool metadata. Closes #1772. Server's CLI session loader now reads tool calls/results, reasoning details, and codex reasoning items from
state.db.messages(PRAGMA-guarded for legacy schemas). Opening a CLI session from the WebUI sidebar no longer loses the tool-heavy parts of the transcript. - #1779 by @Michaelyklam — Reset model picker on session switch. Closes #1771. Switching sessions silently kept the previous chat's model selected in the composer (could route inexpensive chats to expensive models — high-impact for premium-credit OAuth users). Now falls back to configured default → first-available option. Auto-fix applied at stage per Opus stage-310 SHOULD-FIX: the new branch was dropping the
deferModelCorrectionguard, which would have fired spurious/api/session/updatePOSTs against the exact surface #1778 introduces in this same release (CLI sessions withmodel: "unknown"). Wrapped + added regression test.
🧪 Tests
4694 → 4702 collected (+8). 4695 passed, 0 failed.
✅ Pre-release verification
- All 3 PRs CI-green individually.
- File overlap on
api/routes.py(#1768 + #1778) — different functions, auto-merged cleanly. - All JS/Python files syntax-clean.
- Browser API sanity (11/11 endpoints) — all pass.
- Opus advisor: SHIP #1768 + #1778, #1779 SHOULD-FIX before merge — auto-fix applied at stage with regression test, re-verified clean. 0 MUST-FIX.
🙏 Closes
- #1736 (Anthropic env race window)
- #1771 (model picker session-switch bug)
- #1772 (CLI session tool metadata loss)
Full Changelog: v0.51.15...v0.51.16