Skip to content

Commit f42e039

Browse files
authored
OpenAI GPT-5 improvements (#9)
A series of fixes for making GPT-5 reliable and effective with anyclaude. ## UX changes - Converts opaque OpenAI service errors into 429s so CC natively retries instead of failing. These are very common. - Rich debugging support via `ANYCLAUDE_DEBUG` - Supports specifying reasoning effort and service tier ## Codebase - Added CI ## Remaining issues - GPT-5 often fails to use the native tool calls. These failures seems intermittent.
1 parent 43894b0 commit f42e039

File tree

11 files changed

+802
-24
lines changed

11 files changed

+802
-24
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Bun
17+
uses: oven-sh/setup-bun@v2
18+
with:
19+
bun-version: latest
20+
21+
- name: Cache dependencies
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.bun/install/cache
26+
node_modules
27+
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
28+
restore-keys: |
29+
${{ runner.os }}-bun-
30+
31+
- name: Install dependencies
32+
run: bun install --frozen-lockfile
33+
34+
- name: Run tests
35+
run: bun test
36+
37+
- name: Type check
38+
run: bun run typecheck
39+
40+
- name: Build
41+
run: bun run build
42+
43+
- name: Verify build output
44+
run: |
45+
test -f dist/main.js
46+
test -x dist/main.js
47+
head -n 1 dist/main.js | grep -q "#!/usr/bin/env node"

CLAUDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ bun install
3434
# Build the project (creates dist/main.js with shebang)
3535
bun run build
3636

37+
# Run the built binary
38+
bun run ./dist/main.js
39+
3740
# The build command:
3841
# 1. Compiles TypeScript to CommonJS for Node.js compatibility
3942
# 2. Adds Node shebang for CLI execution
@@ -64,3 +67,6 @@ Required for each provider:
6467
Special modes:
6568

6669
- `PROXY_ONLY=true`: Run proxy server without spawning Claude Code
70+
- `ANYCLAUDE_DEBUG=1|2`: Enable debug logging (1=basic, 2=verbose)
71+
72+
- OpenAI's gpt-5 was released in August 2025

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ $ anyclaude --model openai/gpt-5-mini
2323

2424
Switch models in the Claude UI with `/model openai/gpt-5-mini`.
2525

26+
### GPT-5 Support
27+
28+
Use --reasoning-effort (alias: -e) to control OpenAI reasoning.effort. Allowed values: minimal, low, medium, high.
29+
30+
```sh
31+
anyclaude --model openai/gpt-5-mini -e high
32+
```
33+
34+
Use --service-tier (alias: -t) to control OpenAI service tier. Allowed values: flex, priority.
35+
36+
```sh
37+
anyclaude --model openai/gpt-5-mini -t priority
38+
```
39+
40+
Note these flags may be extended to other providers in the future.
41+
2642
## FAQ
2743

2844
### What providers are supported?

bun.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"workspaces": {
44
"": {
55
"name": "openclaude",
6+
"dependencies": {
7+
"@types/yargs-parser": "^21.0.3",
8+
"yargs-parser": "^22.0.0",
9+
},
610
"devDependencies": {
711
"@ai-sdk/anthropic": "^2.0.1",
812
"@ai-sdk/azure": "^2.0.6",
@@ -49,6 +53,8 @@
4953

5054
"@types/node": ["@types/node@22.15.21", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-EV/37Td6c+MgKAbkcLG6vqZ2zEYHD7bvSrzqqs2RIhbA6w3x+Dqz8MZM3sP6kGTeLrdoOgKZe+Xja7tUB2DNkQ=="],
5155

56+
"@types/yargs-parser": ["@types/yargs-parser@21.0.3", "", {}, "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ=="],
57+
5258
"ai": ["ai@5.0.8", "", { "dependencies": { "@ai-sdk/gateway": "1.0.4", "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.1", "@opentelemetry/api": "1.9.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4" } }, "sha512-qbnhj046UvG30V1S5WhjBn+RBGEAmi8PSZWqMhRsE3EPxvO5BcePXTZFA23e9MYyWS9zr4Vm8Mv3wQXwLmtIBw=="],
5359

5460
"bun-types": ["bun-types@1.2.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-Kuh4Ub28ucMRWeiUUWMHsT9Wcbr4H3kLIO72RZZElSDxSu7vpetRvxIUDUaW6QtaIeixIpm7OXtNnZPf82EzwA=="],
@@ -61,6 +67,8 @@
6167

6268
"undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
6369

70+
"yargs-parser": ["yargs-parser@22.0.0", "", {}, "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw=="],
71+
6472
"zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],
6573

6674
"zod-to-json-schema": ["zod-to-json-schema@3.24.5", "", { "peerDependencies": { "zod": "^3.24.1" } }, "sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g=="],

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
"description": "Run Claude Code with OpenAI, Google, xAI, and others.",
3232
"license": "MIT",
3333
"scripts": {
34-
"build": "bun build --target node --outfile dist/main.js ./src/main.ts --format cjs --external ai --external @ai-sdk/* --external zod && node -e \"const fs=require('fs');const p='dist/main.js';fs.writeFileSync(p,'#!/usr/bin/env node\\n'+fs.readFileSync(p,'utf8'))\" && chmod +x dist/main.js"
34+
"build": "bun build --target node --outfile dist/main.js ./src/main.ts --format cjs --external ai --external @ai-sdk/* --external zod && node -e \"const fs=require('fs');const p='dist/main.js';fs.writeFileSync(p,'#!/usr/bin/env node\\n'+fs.readFileSync(p,'utf8'))\" && chmod +x dist/main.js",
35+
"test": "bun test",
36+
"typecheck": "tsc --noEmit"
37+
},
38+
"dependencies": {
39+
"@types/yargs-parser": "^21.0.3",
40+
"yargs-parser": "^22.0.0"
3541
}
3642
}

0 commit comments

Comments
 (0)