Skip to content

Commit 1293b86

Browse files
Numman AliNumman Ali
authored andcommitted
Release 4.3.1
1 parent d4512d6 commit 1293b86

File tree

12 files changed

+457
-30
lines changed

12 files changed

+457
-30
lines changed

CHANGELOG.md

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

33
All notable changes to this project are documented here. Dates use the ISO format (YYYY-MM-DD).
44

5+
## [4.3.1] - 2026-01-08
6+
7+
**Installer safety release**: JSONC support, safe uninstall, and minimal reasoning clamp.
8+
9+
### Added
10+
- **JSONC-aware installer**: preserves comments/formatting and prioritizes `opencode.jsonc` over `opencode.json`.
11+
- **Safe uninstall**: `--uninstall` removes only plugin entries + our model presets; `--all` removes tokens/logs/cache.
12+
- **Installer tests**: coverage for JSONC parsing, precedence, uninstall safety, and artifact cleanup.
13+
14+
### Changed
15+
- **Default config path**: installer creates `~/.config/opencode/opencode.jsonc` when no config exists.
16+
- **Dependency**: `jsonc-parser` added to keep JSONC updates robust and comment-safe.
17+
18+
### Fixed
19+
- **Minimal reasoning clamp**: `minimal` is now normalized to `low` for GPT‑5.x requests to avoid backend rejection.
20+
521
## [4.3.0] - 2026-01-04
622

723
**Feature + reliability release**: variants support, one-command installer, and auth/error handling fixes.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ Legacy OpenCode (v1.0.209 and below):
3636
npx -y opencode-openai-codex-auth@latest --legacy
3737
opencode run "write hello world to test.txt" --model=openai/gpt-5.2-medium
3838
```
39+
Uninstall:
40+
```bash
41+
npx -y opencode-openai-codex-auth@latest --uninstall
42+
npx -y opencode-openai-codex-auth@latest --uninstall --all
43+
```
3944
---
4045
## 📦 Models
4146
- **gpt-5.2** (none/low/medium/high/xhigh)

config/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ This directory contains the official opencode configuration files for the OpenAI
1515

1616
**If you have OpenCode v1.0.210 or newer** (check with `opencode --version`):
1717
```bash
18-
cp config/opencode-modern.json ~/.config/opencode/opencode.json
18+
cp config/opencode-modern.json ~/.config/opencode/opencode.jsonc
1919
```
2020

2121
**If you have OpenCode v1.0.209 or older**:
2222
```bash
23-
cp config/opencode-legacy.json ~/.config/opencode/opencode.json
23+
cp config/opencode-legacy.json ~/.config/opencode/opencode.jsonc
2424
```
2525

2626
### Why two configs?
@@ -59,10 +59,10 @@ Both configs provide:
5959
2. **Copy the appropriate config** based on your version:
6060
```bash
6161
# For v1.0.210+ (recommended):
62-
cp config/opencode-modern.json ~/.config/opencode/opencode.json
62+
cp config/opencode-modern.json ~/.config/opencode/opencode.jsonc
6363

6464
# For older versions:
65-
cp config/opencode-legacy.json ~/.config/opencode/opencode.json
65+
cp config/opencode-legacy.json ~/.config/opencode/opencode.jsonc
6666
```
6767

6868
3. **Run opencode**:

docs/configuration.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Different agents use different models:
328328

329329
Global config has defaults, project overrides for specific work:
330330

331-
**~/.config/opencode/opencode.json** (global):
331+
**~/.config/opencode/opencode.jsonc** (global, preferred):
332332
```json
333333
{
334334
"plugin": ["opencode-openai-codex-auth"],
@@ -413,7 +413,8 @@ CODEX_MODE=1 opencode run "task" # Temporarily enable
413413
> **⚠️ REQUIRED:** You MUST use the config that matches your OpenCode version (`opencode-modern.json` or `opencode-legacy.json`). Minimal configs are NOT supported for GPT 5 models and will fail unpredictably. OpenCode's auto-compaction and usage widgets also require the full config's per-model `limit` metadata.
414414
415415
**Your Configs:**
416-
- `~/.config/opencode/opencode.json` - Global config
416+
- `~/.config/opencode/opencode.jsonc` - Global config (preferred)
417+
- `~/.config/opencode/opencode.json` - Global config (fallback)
417418
- `<project>/.opencode.json` - Project-specific config
418419
- `~/.opencode/openai-codex-auth-config.json` - Plugin config
419420

docs/development/CONFIG_FLOW.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ OpenCode loads and merges configuration from multiple sources in this order (**l
1818

1919
### 1. Global Config
2020
```
21-
~/.opencode/config.json
22-
~/.opencode/opencode.json
23-
~/.opencode/opencode.jsonc
21+
~/.config/opencode/opencode.jsonc
22+
~/.config/opencode/opencode.json
2423
```
2524

2625
### 2. Project Configs (traversed upward from cwd)
2726
```
27+
<project>/.opencode/opencode.jsonc
2828
<project>/.opencode/opencode.json
29+
<parent>/.opencode/opencode.jsonc
2930
<parent>/.opencode/opencode.json
3031
... (up to worktree root)
3132
```

docs/development/TESTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ DEBUG_CODEX_PLUGIN=1 opencode run "test" --model=openai/gpt-5-codex
446446
(cd ~ && rm -rf .cache/opencode/node_modules/opencode-openai-codex-auth)
447447

448448
# 2. Use minimal config
449-
cat > ~/.config/opencode/opencode.json <<'EOF'
449+
cat > ~/.config/opencode/opencode.jsonc <<'EOF'
450450
{
451451
"plugin": ["opencode-openai-codex-auth"],
452452
"model": "openai/gpt-5-codex"
@@ -470,7 +470,7 @@ DEBUG_CODEX_PLUGIN=1 opencode run "write hello world to test.txt"
470470

471471
```bash
472472
# Update config with custom models
473-
cat > ~/.config/opencode/opencode.json <<'EOF'
473+
cat > ~/.config/opencode/opencode.jsonc <<'EOF'
474474
{
475475
"plugin": ["opencode-openai-codex-auth"],
476476
"provider": {

docs/getting-started.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Works on **Windows, macOS, and Linux**:
2828
npx -y opencode-openai-codex-auth@latest
2929
```
3030

31-
This writes the **global** config at `~/.config/opencode/opencode.json`, backs it up, and clears the OpenCode plugin cache so the latest version installs.
31+
This writes the **global** config at `~/.config/opencode/opencode.jsonc` (falls back to `.json` if needed), backs it up, and clears the OpenCode plugin cache so the latest version installs.
3232

3333
Need legacy config (OpenCode v1.0.209 and below)?
3434

@@ -54,7 +54,7 @@ OpenCode automatically installs plugins - no `npm install` needed!
5454
- OpenCode features require proper model metadata
5555
- This configuration has been tested and verified to work
5656

57-
Add this to `~/.config/opencode/opencode.json`:
57+
Add this to `~/.config/opencode/opencode.jsonc` (or `.json`):
5858

5959
**Tip**: The snippet below is a truncated excerpt. For the complete legacy list, copy `config/opencode-legacy.json`. For the modern variants config (OpenCode v1.0.210+), use `config/opencode-modern.json`.
6060

@@ -335,7 +335,7 @@ OpenCode checks multiple config files in order:
335335

336336
1. **Project config**: `./.opencode.json` (current directory)
337337
2. **Parent configs**: Walks up directory tree
338-
3. **Global config**: `~/.config/opencode/opencode.json`
338+
3. **Global config**: `~/.config/opencode/opencode.jsonc` (or `~/.config/opencode/opencode.json`)
339339

340340
**Recommendation**: Use global config for plugin, project config for model/agent overrides.
341341

@@ -355,6 +355,13 @@ Legacy OpenCode (v1.0.209 and below):
355355
npx -y opencode-openai-codex-auth@latest --legacy
356356
```
357357

358+
## Uninstall
359+
360+
```bash
361+
npx -y opencode-openai-codex-auth@latest --uninstall
362+
npx -y opencode-openai-codex-auth@latest --uninstall --all
363+
```
364+
358365
**When to update:**
359366
- New features released
360367
- Bug fixes available

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ npx -y opencode-openai-codex-auth@latest --legacy
5555
Then run OpenCode and authenticate:
5656

5757
```bash
58-
# 1. Add plugin to ~/.config/opencode/opencode.json
58+
# 1. Add plugin to ~/.config/opencode/opencode.jsonc (or .json)
5959
# 2. Run OpenCode
6060
opencode
6161

package-lock.json

Lines changed: 13 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-openai-codex-auth",
3-
"version": "4.3.0",
3+
"version": "4.3.1",
44
"description": "OpenAI ChatGPT (Codex backend) OAuth auth plugin for opencode - use your ChatGPT Plus/Pro subscription instead of API credits",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",
@@ -62,7 +62,8 @@
6262
},
6363
"dependencies": {
6464
"@openauthjs/openauth": "^0.4.3",
65-
"hono": "^4.10.4"
65+
"hono": "^4.10.4",
66+
"jsonc-parser": "^3.3.1"
6667
},
6768
"overrides": {
6869
"hono": "^4.10.4",

0 commit comments

Comments
 (0)