@@ -8,6 +8,42 @@ All notable changes to this project are documented here. Dates use the ISO forma
88
99### Changed
1010
11+ ## [ 4.7.0] - 2026-01-25
12+
13+ ** Feature release** : Full session recovery system ported from opencode-antigravity-auth.
14+
15+ ### Added
16+ - ** Session Recovery System** : Automatic recovery from common API errors that would previously crash sessions:
17+ - ` tool_result_missing ` : Handles interrupted tool executions (ESC during tool run)
18+ - ` thinking_block_order ` : Fixes corrupted thinking blocks in message history
19+ - ` thinking_disabled_violation ` : Strips thinking blocks when switching to non-thinking models
20+ - ** New Recovery Module** (` lib/recovery/ ` ):
21+ - ` types.ts ` - Type definitions for stored messages, parts, and recovery
22+ - ` constants.ts ` - Storage paths (XDG-compliant) and type sets
23+ - ` storage.ts ` - Filesystem operations for reading/writing OpenCode session data
24+ - ` index.ts ` - Module re-exports
25+ - ** Main Recovery Logic** (` lib/recovery.ts ` ):
26+ - ` detectErrorType() ` - Identifies recoverable error patterns from API responses
27+ - ` isRecoverableError() ` - Quick check for recovery eligibility
28+ - ` createSessionRecoveryHook() ` - Creates hook for session-level error recovery
29+ - Toast notifications during recovery attempts
30+ - ** New Configuration Options** :
31+ - ` sessionRecovery ` (default: ` true ` ) - Enable/disable session recovery
32+ - ` autoResume ` (default: ` true ` ) - Auto-resume session after thinking block recovery
33+ - Environment variables: ` CODEX_AUTH_SESSION_RECOVERY ` , ` CODEX_AUTH_AUTO_RESUME `
34+ - ** 26 new unit tests** for recovery system (now 405 total tests)
35+
36+ ### Changed
37+ - ** Account Label Format** : Changed from ` Account N (email) ` to ` N. email ` for cleaner display
38+ - ** Error Response Handling** : ` handleErrorResponse() ` now returns ` errorBody ` for recovery detection
39+ - Enhanced error logging with recoverable error detection in fetch flow
40+
41+ ### Technical Details
42+ - Storage paths follow XDG spec: ` ~/.local/share/opencode/storage/ ` (Linux/Mac), ` %APPDATA%/opencode/storage/ ` (Windows)
43+ - Recovery hook integrates into index.ts loader and detects recoverable errors in fetch response flow
44+ - Thinking block recovery reads/writes to OpenCode's filesystem-based message storage
45+ - Tool result recovery injects synthetic ` tool_result ` parts via session API
46+
1147## [ 4.6.0] - 2026-01-25
1248
1349** Feature release** : Context overflow handling and missing tool result injection.
0 commit comments