@triflux/remote 10.82.3 → 10.82.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.
@@ -354,18 +354,19 @@ export async function askCodexAppServerThread({
354
354
  );
355
355
  if (waitMs > 0)
356
356
  await new Promise((resolve) => setTimeout(resolve, waitMs));
357
- const remainingMs = busyDeadline - Date.now();
357
+ const readTimeoutMs = Math.min(
358
+ DEFAULT_CODEX_APP_SERVER_UDS_BOOTSTRAP_MS,
359
+ Math.max(1, busyDeadline - Date.now()),
360
+ );
358
361
  try {
359
- thread = await readCodexThread(
360
- client,
361
- selectedId,
362
- Math.min(
363
- DEFAULT_CODEX_APP_SERVER_UDS_BOOTSTRAP_MS,
364
- Math.max(1, remainingMs),
365
- ),
366
- );
362
+ thread = await readCodexThread(client, selectedId, readTimeoutMs);
367
363
  } catch (error) {
368
- if (Date.now() >= busyDeadline) throw busyError();
364
+ // 남은 대기 시간으로 줄인 조회의 timeout 은 대기 만료다.
365
+ // setTimeout 은 Date.now() 와 다른 시계라 Date.now() 마감보다 먼저 터질 수 있다.
366
+ const busyBudgetTimedOut =
367
+ readTimeoutMs < DEFAULT_CODEX_APP_SERVER_UDS_BOOTSTRAP_MS &&
368
+ error?.message?.startsWith("JSON-RPC request timed out");
369
+ if (busyBudgetTimedOut || Date.now() >= busyDeadline) throw busyError();
369
370
  throw error;
370
371
  }
371
372
  if (Date.now() >= busyDeadline && thread.status?.type === "active")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triflux/remote",
3
- "version": "10.82.3",
3
+ "version": "10.82.4",
4
4
  "description": "triflux remote — team mode, psmux, MCP workers.",
5
5
  "type": "module",
6
6
  "main": "hub/index.mjs",