@triflux/remote 10.82.3 → 10.83.0
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/hub/team/uds-orchestrator.mjs +11 -10
- package/package.json +1 -1
|
@@ -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
|
|
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
|
-
|
|
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")
|