Skip to content

Commit 3c0c769

Browse files
committed
Release v4.13.0 with Codex parity improvements
1 parent 61540e1 commit 3c0c769

21 files changed

Lines changed: 615 additions & 17 deletions

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,23 @@ jobs:
6060

6161
- name: Run ESLint
6262
run: npm run lint
63+
64+
codex-compat:
65+
name: Codex Compatibility Smoke
66+
runs-on: ubuntu-latest
67+
68+
steps:
69+
- name: Checkout code
70+
uses: actions/checkout@v4
71+
72+
- name: Setup Node.js
73+
uses: actions/setup-node@v4
74+
with:
75+
node-version: 20.x
76+
cache: 'npm'
77+
78+
- name: Install dependencies
79+
run: npm ci
80+
81+
- name: Run Codex compatibility tests
82+
run: npm run test -- test/codex.test.ts test/opencode-codex.test.ts test/request-transformer.test.ts test/fetch-helpers.test.ts

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
all notable changes to this project. dates are ISO format (YYYY-MM-DD).
44

5+
## [4.13.0] - 2026-02-04
6+
7+
### added
8+
9+
- **runtime metrics tool**: added `codex-metrics` to inspect live request/error/latency counters for the current plugin process.
10+
- **401 diagnostics payload**: normalized 401 errors now include `diagnostics` (for example `requestId`, `cfRay`, `correlationId`, `threadId`) to speed up debugging.
11+
- **stream watchdog controls**: new `fetchTimeoutMs` and `streamStallTimeoutMs` config options (and env overrides) for upstream timeout tuning.
12+
13+
### changed
14+
15+
- **request correlation**: each upstream fetch now sets a correlation id, reuses `CODEX_THREAD_ID`/`prompt_cache_key` when available, and clears scope after each request.
16+
- **plan-mode tool gating**: `request_user_input` is automatically stripped from tool definitions when collaboration mode is Default (kept in Plan mode).
17+
- **safety prompt hardening**: bridge/remap prompts now explicitly block destructive git commands unless the user asks for them.
18+
19+
### fixed
20+
21+
- **non-stream SSE hangs**: non-streaming SSE parsing now aborts stalled reads instead of waiting indefinitely.
22+
523
## [4.12.5] - 2026-02-04
624

725
### changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,27 @@ OpenAI Account Status:
319319

320320
---
321321

322+
### codex-metrics
323+
324+
Show live runtime metrics (request counts, latency, errors, rotations) for the current plugin process.
325+
326+
```
327+
codex-metrics
328+
```
329+
330+
**Output:**
331+
```
332+
Codex Plugin Metrics:
333+
334+
Uptime: 12m
335+
Total upstream requests: 84
336+
Successful responses: 77
337+
Failed responses: 7
338+
Average successful latency: 842ms
339+
```
340+
341+
---
342+
322343
### codex-health
323344

324345
Check if all account tokens are still valid (read-only check).
@@ -419,6 +440,7 @@ Total accounts: 4
419440
| `codex-list` | List all accounts | "list my accounts" |
420441
| `codex-switch` | Switch active account | "switch to account 2" |
421442
| `codex-status` | Show rate limits & health | "show account status" |
443+
| `codex-metrics` | Show runtime metrics | "show plugin metrics" |
422444
| `codex-health` | Validate tokens (read-only) | "check account health" |
423445
| `codex-refresh` | Refresh & save tokens | "refresh my tokens" |
424446
| `codex-remove` | Remove an account | "remove account 3" |
@@ -645,6 +667,8 @@ Create `~/.opencode/openai-codex-auth-config.json` for optional settings:
645667
| `retryAllAccountsRateLimited` | `true` | Wait and retry when all accounts are rate-limited |
646668
| `retryAllAccountsMaxWaitMs` | `0` | Max wait time (0 = unlimited) |
647669
| `retryAllAccountsMaxRetries` | `Infinity` | Max retry attempts |
670+
| `fetchTimeoutMs` | `60000` | Request timeout to Codex backend (ms) |
671+
| `streamStallTimeoutMs` | `45000` | Abort non-stream parsing if SSE stalls (ms) |
648672

649673
### Environment Variables
650674

@@ -653,6 +677,8 @@ DEBUG_CODEX_PLUGIN=1 opencode # Enable debug logging
653677
ENABLE_PLUGIN_REQUEST_LOGGING=1 opencode # Log all API requests
654678
CODEX_PLUGIN_LOG_LEVEL=debug opencode # Set log level (debug|info|warn|error)
655679
CODEX_MODE=0 opencode # Temporarily disable bridge prompt
680+
CODEX_AUTH_FETCH_TIMEOUT_MS=120000 opencode # Override request timeout
681+
CODEX_AUTH_STREAM_STALL_TIMEOUT_MS=60000 opencode # Override SSE stall timeout
656682
```
657683

658684
For all options, see [docs/configuration.md](docs/configuration.md).
@@ -700,4 +726,3 @@ By using this plugin, you acknowledge:
700726
- "ChatGPT", "GPT-5", "Codex", and "OpenAI" are trademarks of OpenAI, L.L.C.
701727

702728
</details>
703-

docs/configuration.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ advanced settings go in `~/.opencode/openai-codex-auth-config.json`:
112112
| `autoResume` | `true` | auto-resume after thinking block recovery |
113113
| `tokenRefreshSkewMs` | `60000` | refresh tokens this many ms before expiry |
114114
| `rateLimitToastDebounceMs` | `60000` | debounce rate limit toasts |
115+
| `fetchTimeoutMs` | `60000` | upstream fetch timeout in ms |
116+
| `streamStallTimeoutMs` | `45000` | max time to wait for next SSE chunk before aborting |
115117

116118
### environment variables
117119

@@ -129,6 +131,8 @@ override any config with env vars:
129131
| `CODEX_AUTH_RETRY_ALL_MAX_WAIT_MS=30000` | set max wait time |
130132
| `CODEX_AUTH_RETRY_ALL_MAX_RETRIES=1` | set max retries |
131133
| `CODEX_AUTH_ACCOUNT_ID=acc_xxx` | force specific workspace id |
134+
| `CODEX_AUTH_FETCH_TIMEOUT_MS=120000` | override fetch timeout |
135+
| `CODEX_AUTH_STREAM_STALL_TIMEOUT_MS=60000` | override SSE stall timeout |
132136

133137
---
134138

docs/troubleshooting.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ Failed to access Codex API
109109
date +%s000 # Compare to current timestamp
110110
```
111111

112+
4. **Collect diagnostics from the error payload:**
113+
- Newer versions include `diagnostics` on 401 responses (for example `requestId` and `cfRay`).
114+
- Share those IDs when filing an issue so upstream auth failures are easier to trace.
115+
112116
</details>
113117

114118
<details>

0 commit comments

Comments
 (0)