@bitkyc08/opencodex 1.9.2 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ko.md CHANGED
@@ -77,8 +77,13 @@ codex -m "ollama-cloud/glm-5.2" "Write a SQL migration"
77
77
  - **OAuth, API 키, 또는 ChatGPT forward.** xAI / Anthropic / Kimi 계정으로 로그인하거나(토큰은
78
78
  자동 갱신됩니다), `codex login`을 forward 하거나, 키를 붙여넣으세요(`${ENV_VARS}` 지원). 18개 프로바이더의
79
79
  API 키 카탈로그(**Ollama Cloud** 포함)가 기본 내장되어 있습니다.
80
- - **Codex에 바로 통합.** `$CODEX_HOME/config.toml`(기본값 `~/.codex/config.toml`)에 `[model_providers.opencodex]` 테이블을 주입하고
81
- 라우팅된 모델을 Codex의 카탈로그와 서브에이전트 선택기에 병합합니다 완전히 되돌릴 수 있습니다.
80
+ - **Codex CLI, TUI, App, SDK에 바로 통합.** `$CODEX_HOME/config.toml`(기본값 `~/.codex/config.toml`)에
81
+ `[model_providers.opencodex]` 테이블을 주입하고 공유 Codex 모델 카탈로그를 작성하여 라우팅된 모델이
82
+ Codex 모델 선택기에 표시되게 합니다.
83
+ - **서브에이전트 제어.** `subagentModels` 또는 웹 대시보드에서 최대 5개의 라우팅/네이티브 모델을
84
+ Codex `spawn_agent` 선택기에 우선 노출할 수 있습니다.
85
+ - **기본은 HTTP/SSE, WebSocket은 opt-in.** 프록시는 Responses WebSocket 엔드포인트를 갖고 있지만,
86
+ `"websockets": true`일 때만 `supports_websockets`를 광고합니다.
82
87
  - **Sidecar.** OpenAI가 아닌 모델에도 ChatGPT 로그인을 통한 `gpt-5.4-mini`를 사용해 실제 **웹 검색**과
83
88
  **이미지 이해** 기능을 제공합니다.
84
89
  - 프로바이더, OAuth 로그인, 모델 선택, 요청 로그를 위한 **웹 대시보드**.
@@ -111,6 +116,7 @@ ocx login <xai|anthropic|kimi> # OAuth login
111
116
  ocx logout <provider> # remove a stored login
112
117
  ocx gui # open the web dashboard
113
118
  ocx service <install|start|stop|status|uninstall> # run as a background service
119
+ ocx update # update opencodex to the latest published version
114
120
  ```
115
121
 
116
122
  ## 설정
@@ -138,15 +144,21 @@ ocx service <install|start|stop|status|uninstall> # run as a background servic
138
144
  }
139
145
  ```
140
146
 
147
+ WebSocket 전송은 기본적으로 꺼져 있습니다. Codex가 HTTP/SSE 대신 Responses WebSocket 경로를 광고하고
148
+ 사용하게 하려면 `"websockets": true`를 명시하세요.
149
+
141
150
  모든 필드에 대한 자세한 내용은 **[설정 레퍼런스](https://lidge-jun.github.io/opencodex/ko/reference/configuration/)**
142
151
  를 참고하세요.
143
152
 
144
153
  ## 문서
145
154
 
146
- 전체 개발자 문서 — 아키텍처, 모든 adapter, 요청 라이프사이클, sidecar,
147
- Codex 통합, CLI/설정 레퍼런스 — 는 [`docs-site/`](./docs-site) 아래의 Astro 사이트이며
155
+ 공개 문서 — 설치, 프로바이더, 라우팅, sidecar, Codex 통합, Codex App 모델 선택기,
156
+ CLI/설정 레퍼런스 — 는 [`docs-site/`](./docs-site) 아래의 Astro 사이트이며
148
157
  **[lidge-jun.github.io/opencodex](https://lidge-jun.github.io/opencodex/ko/)**에 게시됩니다.
149
158
 
159
+ 유지보수용 source of truth는 [`structure/`](./structure)에 있고, 과거 조사/진단 노트는
160
+ [`docs/`](./docs)에 남아 있습니다.
161
+
150
162
  ## 개발
151
163
 
152
164
  ```bash
package/README.md CHANGED
@@ -87,9 +87,13 @@ codex -m "ollama-cloud/glm-5.2" "Write a SQL migration"
87
87
  - **OAuth, API key, or ChatGPT forward.** Log in with your xAI / Anthropic / Kimi account (tokens
88
88
  auto-refresh), forward your `codex login`, or paste a key (`${ENV_VARS}` supported). An 18-provider
89
89
  API-key catalog (incl. **Ollama Cloud**) is built in.
90
- - **Drops into Codex.** Injects a `[model_providers.opencodex]` table into
91
- `$CODEX_HOME/config.toml` (default `~/.codex/config.toml`) and merges routed models into Codex's
92
- catalog and subagent picker fully reversible.
90
+ - **Drops into Codex CLI, TUI, App, and SDK.** Injects a `[model_providers.opencodex]` table into
91
+ `$CODEX_HOME/config.toml` (default `~/.codex/config.toml`) and writes a shared Codex model catalog
92
+ so routed models appear in Codex model pickers.
93
+ - **Subagent control.** Feature up to five routed or native models in Codex's `spawn_agent` picker
94
+ from `subagentModels` or the web dashboard.
95
+ - **HTTP/SSE by default, WebSocket opt-in.** The proxy has a Responses WebSocket endpoint, but it
96
+ only advertises `supports_websockets` when `"websockets": true` is set.
93
97
  - **Sidecars.** Give non-OpenAI models real **web search** and **image understanding** via a
94
98
  `gpt-5.4-mini` over your ChatGPT login.
95
99
  - **Web dashboard** for providers, OAuth login, model selection, and request logs.
@@ -104,7 +108,7 @@ codex -m "ollama-cloud/glm-5.2" "Write a SQL migration"
104
108
  | xAI Grok | `openai-chat` | oauth / key |
105
109
  | Kimi (Moonshot) | `openai-chat` | oauth / key |
106
110
  | Google Gemini | `google` | key |
107
- | Azure OpenAI | `azure-openai` | key |
111
+ | Azure OpenAI | `azure` | key |
108
112
  | Ollama Cloud + 17-provider catalog | `openai-chat` | key |
109
113
  | Ollama / vLLM / LM Studio (local) | `openai-chat` | key (usually blank) |
110
114
  | Any OpenAI-compatible endpoint | `openai-chat` | key |
@@ -150,16 +154,20 @@ Config lives at `~/.opencodex/config.json`. Minimal example:
150
154
  }
151
155
  ```
152
156
 
157
+ WebSocket transport is off by default. Set `"websockets": true` only if you want Codex to advertise
158
+ and use the Responses WebSocket path instead of HTTP/SSE.
159
+
153
160
  See the **[Configuration reference](https://lidge-jun.github.io/opencodex/reference/configuration/)**
154
161
  for every field.
155
162
 
156
163
  ## Documentation
157
164
 
158
- The full developer documentation architecture, every adapter, the request lifecycle, the sidecars,
159
- Codex integration, and the CLI/config reference — is an Astro site under [`docs-site/`](./docs-site)
160
- and published to **[lidge-jun.github.io/opencodex](https://lidge-jun.github.io/opencodex/)**.
161
- Deep implementation notes live under [`docs/`](./docs), including the Codex App/model catalog path
162
- that makes routed opencodex models appear in the Codex App picker.
165
+ The public docsinstall, providers, routing, sidecars, Codex integration, Codex App model picker,
166
+ and CLI/config reference — are built from [`docs-site/`](./docs-site) and published to
167
+ **[lidge-jun.github.io/opencodex](https://lidge-jun.github.io/opencodex/)**.
168
+
169
+ Maintainer source-of-truth notes live under [`structure/`](./structure). Historical investigations
170
+ remain under [`docs/`](./docs).
163
171
 
164
172
  ## Development
165
173
 
package/README.zh-CN.md CHANGED
@@ -77,8 +77,13 @@ codex -m "ollama-cloud/glm-5.2" "Write a SQL migration"
77
77
  - **OAuth、API key 或 ChatGPT 转发(forward)。** 用你的 xAI / Anthropic / Kimi 账户登录(token
78
78
  自动刷新)、转发你的 `codex login`,或直接粘贴一个 key(支持 `${ENV_VARS}`)。内置一份 18 家 provider 的
79
79
  API-key 目录(含 **Ollama Cloud**)。
80
- - **无缝接入 Codex。** 向 `$CODEX_HOME/config.toml`(默认 `~/.codex/config.toml`)注入一个 `[model_providers.opencodex]` 表,并
81
- 将已路由的模型合并进 Codex 的目录和 subagent 选择器 —— 完全可逆。
80
+ - **无缝接入 Codex CLI、TUI、App 和 SDK。** 向 `$CODEX_HOME/config.toml`(默认 `~/.codex/config.toml`)
81
+ 注入一个 `[model_providers.opencodex]` 表,并写入共享的 Codex 模型目录,让已路由的模型出现在
82
+ Codex 模型选择器中。
83
+ - **Subagent 控制。** 通过 `subagentModels` 或 Web 仪表盘,将最多 5 个路由或原生模型优先展示在
84
+ Codex 的 `spawn_agent` 选择器中。
85
+ - **默认 HTTP/SSE,WebSocket 需要显式开启。** 代理有 Responses WebSocket 端点,但只有设置
86
+ `"websockets": true` 时才会广告 `supports_websockets`。
82
87
  - **Sidecars。** 通过基于你 ChatGPT 登录的 `gpt-5.4-mini`,为非 OpenAI 模型提供真正的**网页搜索**和**图像理解**能力。
83
88
  - **Web 仪表盘**,用于管理 provider、OAuth 登录、模型选择和请求日志。
84
89
 
@@ -110,6 +115,7 @@ ocx login <xai|anthropic|kimi> # OAuth login
110
115
  ocx logout <provider> # remove a stored login
111
116
  ocx gui # open the web dashboard
112
117
  ocx service <install|start|stop|status|uninstall> # run as a background service
118
+ ocx update # update opencodex to the latest published version
113
119
  ```
114
120
 
115
121
  ## 配置
@@ -137,14 +143,19 @@ ocx service <install|start|stop|status|uninstall> # run as a background servic
137
143
  }
138
144
  ```
139
145
 
146
+ WebSocket 传输默认关闭。只有当你希望 Codex 广告并使用 Responses WebSocket 路径而不是 HTTP/SSE 时,
147
+ 才需要设置 `"websockets": true`。
148
+
140
149
  每个字段的说明请参阅 **[配置参考](https://lidge-jun.github.io/opencodex/zh-cn/reference/configuration/)**。
141
150
 
142
151
  ## 文档
143
152
 
144
- 完整的开发者文档 —— 架构、每个 adapter、请求生命周期、sidecars、
145
- Codex 集成,以及 CLI/配置参考 —— 是位于 [`docs-site/`](./docs-site) 下的一个 Astro 站点,
153
+ 公开文档 —— 安装、providers、路由、sidecars、Codex 集成、Codex App 模型选择器,
154
+ 以及 CLI/配置参考 —— 是位于 [`docs-site/`](./docs-site) 下的一个 Astro 站点,
146
155
  并发布于 **[lidge-jun.github.io/opencodex](https://lidge-jun.github.io/opencodex/zh-cn/)**。
147
156
 
157
+ 维护者 source of truth 位于 [`structure/`](./structure),历史调查/诊断笔记保留在 [`docs/`](./docs)。
158
+
148
159
  ## 开发
149
160
 
150
161
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitkyc08/opencodex",
3
- "version": "1.9.2",
3
+ "version": "1.9.4",
4
4
  "description": "Universal provider proxy for OpenAI Codex — use any LLM with Codex CLI/App/SDK",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * postinstall — one-time GitHub-star prompt during `npm install -g opencx`.
3
+ * postinstall — one-time GitHub-star prompt during `npm install -g @bitkyc08/opencodex`.
4
4
  *
5
5
  * Behavior:
6
6
  * - TTY-only (skips CI / piped installs)
@@ -22,6 +22,26 @@ export const FORWARD_HEADERS = [
22
22
  "x-responsesapi-include-timing-metrics",
23
23
  ];
24
24
 
25
+ function sanitizeReasoningInputContent(body: unknown): unknown {
26
+ if (!body || typeof body !== "object" || Array.isArray(body)) return body;
27
+ const raw = body as Record<string, unknown>;
28
+ if (!Array.isArray(raw.input)) return body;
29
+
30
+ let changed = false;
31
+ const input = raw.input.map(item => {
32
+ if (!item || typeof item !== "object" || Array.isArray(item)) return item;
33
+ const rec = item as Record<string, unknown>;
34
+ if (rec.type !== "reasoning" || !Array.isArray(rec.content) || rec.content.length === 0) return item;
35
+ changed = true;
36
+ // Routed models can produce raw `reasoning_text` output items. Codex echoes those in later
37
+ // native GPT requests, but ChatGPT's Responses backend accepts reasoning input only with empty
38
+ // `content`; keep summaries/ids and drop the raw content so native passthrough does not 400.
39
+ return { ...rec, content: [] };
40
+ });
41
+
42
+ return changed ? { ...raw, input } : body;
43
+ }
44
+
25
45
  export function createResponsesPassthroughAdapter(provider: OcxProviderConfig): ProviderAdapter & { passthrough: true } {
26
46
  return {
27
47
  name: "openai-responses",
@@ -49,7 +69,7 @@ export function createResponsesPassthroughAdapter(provider: OcxProviderConfig):
49
69
  url,
50
70
  method: "POST",
51
71
  headers,
52
- body: JSON.stringify(parsed._rawBody),
72
+ body: JSON.stringify(sanitizeReasoningInputContent(parsed._rawBody)),
53
73
  };
54
74
  },
55
75