Skip to content

Commit 9d0878c

Browse files
committed
chore: bump version to 4.7.0
v4.7.0 - Session Recovery System Features: - Automatic session recovery for tool_result_missing errors - Automatic session recovery for thinking_block_order errors - Automatic session recovery for thinking_disabled_violation errors - New config: sessionRecovery (default: true) - New config: autoResume (default: true) - Updated account label format in CLI
1 parent 3cd4b19 commit 9d0878c

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-openai-codex-auth-multi",
3-
"version": "4.6.0",
3+
"version": "4.7.0",
44
"description": "Fork of opencode-openai-codex-auth with multi-account rotation (ChatGPT OAuth / Codex backend)",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)