chatccc 0.2.309 → 0.2.311

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.
@@ -203,8 +203,13 @@ export class CodexAppServerManager {
203
203
  return Promise.resolve(this.port);
204
204
  if (this.starting)
205
205
  return this.starting;
206
- this.starting = this.start(command);
207
- return this.starting;
206
+ const starting = this.start(command);
207
+ this.starting = starting;
208
+ starting.catch(() => {
209
+ if (this.starting === starting)
210
+ this.starting = null;
211
+ });
212
+ return starting;
208
213
  }
209
214
  async start(command) {
210
215
  const port = await pickFreePort();
@@ -226,6 +231,8 @@ export class CodexAppServerManager {
226
231
  if (this.proc === proc) {
227
232
  this.proc = null;
228
233
  this.port = null;
234
+ // starting 仍持有已 resolve 的旧端口,不清掉会让后续连接永远打到死端口
235
+ this.starting = null;
229
236
  }
230
237
  if (code !== 0 && stderr.trim()) {
231
238
  console.error(`[Codex app-server] 退出码=${code}: ${stderr.trim().slice(0, 2000)}`);
@@ -33,7 +33,7 @@ export function normalizeOptionalConfigField(value, options) {
33
33
  * 归一化 `ccc.provider`(ChatCCC 主进程配置对 DeepCCC 内核传输层的 override):
34
34
  * - 非字符串 / 空串 / 字面量 "default" → `""`(不 override,跟随
35
35
  * ~/.deepccc/config.json 或 DEEPCCC_PROVIDER,向后兼容旧 config.json)
36
- * - `openai` / `anthropic`(大小写不敏感)→ 规范化小写返回
36
+ * - `openai` / `openai-responses` / `anthropic`(大小写不敏感)→ 规范化小写返回
37
37
  * - 其它非法值 → `""` 并打印 warning(避免运行时 normalizeDeepCccProvider 抛错)
38
38
  */
39
39
  export function normalizeCccProviderOverride(value) {
@@ -42,9 +42,9 @@ export function normalizeCccProviderOverride(value) {
42
42
  const trimmed = value.trim().toLowerCase();
43
43
  if (trimmed === "" || trimmed === "default")
44
44
  return "";
45
- if (trimmed === "openai" || trimmed === "anthropic")
45
+ if (trimmed === "openai" || trimmed === "openai-responses" || trimmed === "anthropic")
46
46
  return trimmed;
47
- console.warn(`[CONFIG] ccc.provider 的值 "${value}" 非法,已忽略(仅支持 openai / anthropic / 空字符串)。`);
47
+ console.warn(`[CONFIG] ccc.provider 的值 "${value}" 非法,已忽略(仅支持 openai / openai-responses / anthropic / 空字符串)。`);
48
48
  return "";
49
49
  }
50
50
  /**