codex-to-im 1.0.62 → 1.0.64

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.md CHANGED
@@ -55,6 +55,18 @@
55
55
  - 已登录 Codex CLI
56
56
  - 已配置 `CTI_CODEX_API_KEY`、`CODEX_API_KEY` 或 `OPENAI_API_KEY`
57
57
 
58
+ ### Codex 执行后端
59
+
60
+ bridge 默认使用 `auto` 策略:纯 IM 会话通过随 `@openai/codex-sdk` 固定版本安装的 Codex app-server 执行;复用 Codex Desktop thread 的会话继续使用 SDK,并结合 Desktop JSONL 做 mirror 和终态确认。Codex CLI 虽然已经提供 daemon/listen 能力,但当前 Codex Desktop 仍持有自己的 stdio app-server,没有向 bridge 发布可共享端点,因此不会尝试连接或修改 ChatGPT Remote 的私有 relay/enrollment 状态。
61
+
62
+ 可以通过环境变量临时切换:
63
+
64
+ - `CTI_CODEX_TRANSPORT=auto`:默认策略
65
+ - `CTI_CODEX_TRANSPORT=sdk`:全部使用 SDK,作为兼容回退
66
+ - `CTI_CODEX_TRANSPORT=app-server`:纯 IM 会话强制使用 app-server,主要用于诊断和灰度验证;不会接管 Desktop thread
67
+
68
+ `auto` 只会在 app-server 尚未发出 `turn/start` 时回退 SDK;请求一旦发出,即使响应超时也不会换后端重复执行。长驻客户端会复用已加载线程、空闲后 unsubscribe,并在终止或线程系统错误时保证事件流收尾。
69
+
58
70
  ### 安装
59
71
 
60
72
  ```bash
package/README_EN.md CHANGED
@@ -55,6 +55,12 @@ Any of the following is sufficient:
55
55
  - a logged-in Codex CLI
56
56
  - `CTI_CODEX_API_KEY`, `CODEX_API_KEY`, or `OPENAI_API_KEY`
57
57
 
58
+ ### Codex execution backend
59
+
60
+ The bridge defaults to `auto`: IM-owned sessions run through the Codex app-server bundled with the pinned `@openai/codex-sdk`, while sessions reusing a Codex Desktop thread keep using the SDK plus Desktop JSONL mirroring and terminal correlation. The Codex CLI now has daemon/listen support, but the current Desktop app still owns a separate stdio app-server and does not publish a shared endpoint to the bridge. Codex-to-IM therefore does not connect to or modify ChatGPT Remote's private relay/enrollment state.
61
+
62
+ Use `CTI_CODEX_TRANSPORT=auto|sdk|app-server` to select the backend for IM-owned sessions. Desktop-backed sessions always stay on SDK + JSONL even when `app-server` is selected. In `auto`, SDK fallback is allowed only before `turn/start` is dispatched; a dispatched turn is never executed again on another backend. Loaded threads are reused, released with `thread/unsubscribe` after an idle period, and terminated locally if interrupt or thread lifecycle notifications fail to close the stream.
63
+
58
64
  ### Install
59
65
 
60
66
  ```bash
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import { createRequire as __ctiCreateRequire } from 'module'; const require = __ctiCreateRequire(import.meta.url);
3
3
 
4
4
  // src/cli.ts
5
5
  import { stdin as input, stdout as output } from "node:process";