very-happy-cli 0.2.173 → 0.2.174
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/dist/{AcpBackend-DG5AHZXF.mjs → AcpBackend-CS8TSaaH.mjs} +3 -3
- package/dist/{AcpBackend-ByLLiXvl.cjs → AcpBackend-MMfGUkmp.cjs} +3 -3
- package/dist/{AcpSessionManager-Zf00QnlL.cjs → AcpSessionManager-C2MqOirs.cjs} +1 -1
- package/dist/{AcpSessionManager-B7FIrsys.mjs → AcpSessionManager-y1Iy1mzc.mjs} +1 -1
- package/dist/{BasePermissionHandler-CgPa--v2.mjs → BasePermissionHandler-BiWdGyL1.mjs} +1 -1
- package/dist/{BasePermissionHandler-kD4FK-7K.cjs → BasePermissionHandler-CJQPjMEa.cjs} +1 -1
- package/dist/{BaseReasoningProcessor-Cnmvd83F.mjs → BaseReasoningProcessor-2sLuoRYw.mjs} +1 -1
- package/dist/{BaseReasoningProcessor-CeMRo-8g.cjs → BaseReasoningProcessor-BY9a3RTU.cjs} +1 -1
- package/dist/{agentHome-DVLed_WJ.cjs → agentHome-BeAq0X3o.cjs} +4 -4
- package/dist/{agentHome-b9H3fCBZ.mjs → agentHome-CK6SbAVu.mjs} +4 -4
- package/dist/{api-BBoamFqd.cjs → api-Cy_Mbe8W.cjs} +10 -10
- package/dist/{api-DDz_YyoH.mjs → api-rOLB1-sV.mjs} +10 -10
- package/dist/{apiMachine-DRxPV0j2.cjs → apiMachine-A9n14NN1.cjs} +14 -14
- package/dist/{apiMachine-DqQ8WeIe.mjs → apiMachine-VBkOChth.mjs} +14 -14
- package/dist/{attachmentContent-DNsACM9b.mjs → attachmentContent-CSGb8uDJ.mjs} +2 -2
- package/dist/{attachmentContent-CmR86NxQ.cjs → attachmentContent-ULnsMsIL.cjs} +2 -2
- package/dist/{attachmentLimits-CxG3T18E.mjs → attachmentLimits-BLbji11b.mjs} +1 -1
- package/dist/{attachmentLimits-BEYEEBm8.cjs → attachmentLimits-D6bT2jU1.cjs} +1 -1
- package/dist/{auth-BF8QvXR1.cjs → auth--YSQ1-dG.cjs} +8 -8
- package/dist/{auth-3UXAs__6.cjs → auth-BD2z4MCH.cjs} +5 -5
- package/dist/{auth-DvB0u-4H.mjs → auth-CiZfkTkd.mjs} +5 -5
- package/dist/{auth-BVqHWH_r.mjs → auth-EnJQu_vf.mjs} +8 -8
- package/dist/{auto-D3PSMTni.cjs → auto-CobMGmFM.cjs} +15 -15
- package/dist/{auto-D0Ai-s17.mjs → auto-D_hKBFAY.mjs} +15 -15
- package/dist/{bootstrap-BsXIVhrG.cjs → bootstrap-BYrt5zUv.cjs} +2 -2
- package/dist/{bootstrap-Cg_t3W-0.mjs → bootstrap-D1RRCJdQ.mjs} +2 -2
- package/dist/{browser-f6xCPkkN.mjs → browser-IVfX6PQT.mjs} +1 -1
- package/dist/{browser-Cbyo0qny.cjs → browser-i45hmvWw.cjs} +1 -1
- package/dist/{claudeLocal-AByQMi4D.cjs → claudeLocal-Cg8Qn4tF.cjs} +5 -5
- package/dist/{claudeLocal-DqJUowRE.mjs → claudeLocal-DnPoeXP2.mjs} +5 -5
- package/dist/{claudeLocalLauncher-BFxrneBS.mjs → claudeLocalLauncher-BAavVhU8.mjs} +10 -10
- package/dist/{claudeLocalLauncher-CSnWv8cG.cjs → claudeLocalLauncher-CFlsscqX.cjs} +10 -10
- package/dist/{claudeSessionFork-DEuvbqD3.cjs → claudeSessionFork-DmwPXMmz.cjs} +1 -1
- package/dist/{claudeSessionFork-DsmA1Jv6.mjs → claudeSessionFork-bp8LeRZ9.mjs} +1 -1
- package/dist/{client-W3gPBBN2.cjs → client-B6H6ZROd.cjs} +2 -2
- package/dist/{client-CzNWPOBI.mjs → client-Bi1DOVy9.mjs} +2 -2
- package/dist/{client-mnqGeUey.mjs → client-DbqP92Fy.mjs} +3 -3
- package/dist/{client-CuadUoga.cjs → client-QtWC3yii.cjs} +3 -3
- package/dist/codex/happyMcpStdioBridge.cjs +15 -15
- package/dist/codex/happyMcpStdioBridge.mjs +15 -15
- package/dist/{codexAppServerClient-BgNcgkVT.cjs → codexAppServerClient-BWB1267F.cjs} +71 -21
- package/dist/{codexAppServerClient-BCAPEmbn.mjs → codexAppServerClient-pnCpJlD8.mjs} +71 -21
- package/dist/{codexCommand-3ZsmFNCE.mjs → codexCommand-BmtdCu-D.mjs} +81 -44
- package/dist/{codexCommand-B-xQ7uoD.cjs → codexCommand-u4m_X8VA.cjs} +81 -44
- package/dist/{config-CJTzYT71.cjs → config-BaJCpLzN.cjs} +3 -3
- package/dist/{config-q8FBDbqS.mjs → config-Czc1tQDn.mjs} +3 -3
- package/dist/{configuration-C_-2io9T.cjs → configuration-Btwt68O2.cjs} +1 -1
- package/dist/{configuration-2Eck1oZf.mjs → configuration-zOfO2qdB.mjs} +1 -1
- package/dist/{connect-CJc2q7Zb.mjs → connect-D21OhdsD.mjs} +13 -13
- package/dist/{connect-ch6-M_fR.cjs → connect-DQaDa6i7.cjs} +13 -13
- package/dist/{context-C1tA72Pn.mjs → context-BTX3YYdt.mjs} +1 -1
- package/dist/{context--xjJuO00.cjs → context-BknomZTq.cjs} +1 -1
- package/dist/{controlClient-DCH7YKU2.cjs → controlClient-CEpaptre.cjs} +3 -3
- package/dist/{controlClient-Dn0x8DWU.mjs → controlClient-CbmWgWJW.mjs} +3 -3
- package/dist/{createSessionMetadata-IMDmdFLj.mjs → createSessionMetadata-CM7ErnPh.mjs} +2 -2
- package/dist/{createSessionMetadata-BeY_Ct51.cjs → createSessionMetadata-Cgfcg0WZ.cjs} +2 -2
- package/dist/{defaultPermissionMode-C7be9Tg9.mjs → defaultPermissionMode-CmgCDVpL.mjs} +2 -2
- package/dist/{defaultPermissionMode-CP-RNe7S.cjs → defaultPermissionMode-DqdkzYUY.cjs} +2 -2
- package/dist/{deterministicJson-3OOoCWI0.cjs → deterministicJson-B3V5Ss2l.cjs} +9 -9
- package/dist/{deterministicJson-Cun6TLIF.mjs → deterministicJson-DVvfcibH.mjs} +9 -9
- package/dist/{doctor-DE9dpmhV.cjs → doctor-C_Xfs8Bs.cjs} +7 -7
- package/dist/{doctor-B3krtkx6.mjs → doctor-CidhGBde.mjs} +7 -7
- package/dist/{downloadTarget-BBAA6-Wy.mjs → downloadTarget-C-18yOBz.mjs} +6 -6
- package/dist/{downloadTarget-nKU9KvK-.cjs → downloadTarget-DJKG6wVj.cjs} +6 -6
- package/dist/{ensureDaemonRunning-bshCT05q.mjs → ensureDaemonRunning-CWo9yDAC.mjs} +5 -5
- package/dist/{ensureDaemonRunning-D3F9Wn4o.cjs → ensureDaemonRunning-Dk1yo6aK.cjs} +5 -5
- package/dist/{handleResumeCommand-DqQ2rB_w.mjs → handleResumeCommand-ApqydtLf.mjs} +5 -5
- package/dist/{handleResumeCommand-DSYAc7pz.cjs → handleResumeCommand-DvFAI68O.cjs} +5 -5
- package/dist/{index-CLTdBqtl.mjs → index-BVC5vBcc.mjs} +37 -37
- package/dist/{index-C9hI8a10.cjs → index-BZdhwBKa.cjs} +3 -1
- package/dist/{index-DtDYoGpm.mjs → index-CMeZ7WcS.mjs} +4 -4
- package/dist/{index-DzqTd9GX.cjs → index-CXCoTvVd.cjs} +36 -36
- package/dist/{index-I6GVU3_G.cjs → index-CjFzrcin.cjs} +3 -3
- package/dist/{index-C7IYgnoC.mjs → index-D0IWz-WE.mjs} +3 -3
- package/dist/{index-BzM5uj8R.cjs → index-azi2eHdp.cjs} +4 -4
- package/dist/{index-B0HEEYGh.mjs → index-boE-d8CM.mjs} +3 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-BFd6bwk2.mjs → install-BOPmEeSo.mjs} +3 -3
- package/dist/{install-D8XM9y0N.cjs → install-DayuanHz.cjs} +3 -3
- package/dist/lib.cjs +12 -12
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-hKB4aKcf.cjs → lidState-7uLoa43a.cjs} +1 -1
- package/dist/{lidState-B1KB4bLv.mjs → lidState-Bv862v_R.mjs} +1 -1
- package/dist/{localHappyAgentAuth-B94JIex_.mjs → localHappyAgentAuth-CLP3CBMK.mjs} +1 -1
- package/dist/{localHappyAgentAuth-B_ItamJZ.cjs → localHappyAgentAuth-CfILduPd.cjs} +1 -1
- package/dist/{logger-CKCRe63e.mjs → logger-CUxbqfrp.mjs} +2 -2
- package/dist/{logger-DYejzaY9.cjs → logger-XjIS0lU7.cjs} +2 -2
- package/dist/{machineMetadata-C7Slozib.cjs → machineMetadata-DTxYqMdE.cjs} +3 -3
- package/dist/{machineMetadata-CiemL6uU.mjs → machineMetadata-QfdvKIrL.mjs} +3 -3
- package/dist/{main-CJCss2TE.cjs → main-BpC52KlL.cjs} +44 -44
- package/dist/{main-BQBSqrW3.mjs → main-DcfU9Axf.mjs} +44 -44
- package/dist/{mcp-BRtLFMHZ.mjs → mcp-BhUNcpoX.mjs} +14 -14
- package/dist/{mcp-cq0hhROT.cjs → mcp-EEwHzYYU.cjs} +14 -14
- package/dist/{mirrorProtocol-hPlbcL2P.mjs → mirrorProtocol-BoBu65cj.mjs} +3 -3
- package/dist/{mirrorProtocol-pDuMxeQj.cjs → mirrorProtocol-WfE5yd3v.cjs} +3 -3
- package/dist/{package-DwxuhtoO.cjs → package-DFQUF2in.cjs} +7 -7
- package/dist/{package-JFU2Ry9r.mjs → package-DkI3yDe0.mjs} +7 -7
- package/dist/{peerTools-DiBZOaPT.cjs → peerTools-DbI6tEk1.cjs} +4 -4
- package/dist/{peerTools-D-yf7SlL.mjs → peerTools-zfe59JAw.mjs} +4 -4
- package/dist/{persistence-Bi1BTtHq.cjs → persistence-BO7AS2NK.cjs} +2 -2
- package/dist/{persistence-CG158J29.mjs → persistence-CBToZ0R6.mjs} +2 -2
- package/dist/{piRunnerArgs-C-8jIqUE.mjs → piRunnerArgs-C2us7__q.mjs} +1 -1
- package/dist/{piRunnerArgs-DkCs_Ma1.cjs → piRunnerArgs-CICVlVem.cjs} +1 -1
- package/dist/{piRuntime-C4Ei1y-P.mjs → piRuntime-BYHZYbw6.mjs} +1 -1
- package/dist/{piRuntime-CHsld2lz.cjs → piRuntime-CTezrTNw.cjs} +1 -1
- package/dist/{piTerminal-D4Hy_mmZ.cjs → piTerminal-CeiWEB-T.cjs} +16 -16
- package/dist/{piTerminal-yp98lIpx.mjs → piTerminal-YCRkoVWF.mjs} +16 -16
- package/dist/{rateLimitWindows-Blhk1RyR.cjs → rateLimitWindows-U7NsRvIa.cjs} +1 -1
- package/dist/{rateLimitWindows-C36y0Ldw.mjs → rateLimitWindows-i2-530Zt.mjs} +1 -1
- package/dist/{registerCommonHandlers-ni8jeOJc.mjs → registerCommonHandlers-C_KbP5Mq.mjs} +2 -2
- package/dist/{registerCommonHandlers-Ct5XkkNU.cjs → registerCommonHandlers-DTeuk3Hw.cjs} +2 -2
- package/dist/{registerKillSessionHandler-B0LoAR3_.mjs → registerKillSessionHandler-B7zpuzvS.mjs} +6 -6
- package/dist/{registerKillSessionHandler-DoR8z8b6.cjs → registerKillSessionHandler-B_FqygY4.cjs} +6 -6
- package/dist/{remoteSessionClient-B5vn4Ghn.mjs → remoteSessionClient-Bk1Qzb5I.mjs} +5 -5
- package/dist/{remoteSessionClient-B7YBUGMI.cjs → remoteSessionClient-D79ci1L8.cjs} +5 -5
- package/dist/{reportProgressTool-25DIibtH.mjs → reportProgressTool-DujvMncK.mjs} +2 -2
- package/dist/{reportProgressTool-BVTrYVsY.cjs → reportProgressTool-oJMMqzKb.cjs} +2 -2
- package/dist/{run-Buxf1ATU.cjs → run-CyiUjBZK.cjs} +34 -34
- package/dist/{run-D4qgzSft.mjs → run-DVE2Gq-E.mjs} +33 -33
- package/dist/{runClaude-CRkWhQ5T.mjs → runClaude-BcpBew2h.mjs} +21 -21
- package/dist/{runClaude-D4B0SSd5.cjs → runClaude-CmAHAR3N.cjs} +21 -21
- package/dist/{runClaudeDeps-CbyQIbNw.mjs → runClaudeDeps-C2fTmXoo.mjs} +40 -40
- package/dist/{runClaudeDeps-BKYHcQkO.cjs → runClaudeDeps-Z_RVvcuG.cjs} +35 -35
- package/dist/{runGemini-Dn6yFpnO.mjs → runGemini-BYmVfC3b.mjs} +32 -32
- package/dist/{runGemini-OgmDK1Lq.cjs → runGemini-Bv4nVBfj.cjs} +32 -32
- package/dist/{runOpenClaw-DFD--ZW9.cjs → runOpenClaw-D5suaSgY.cjs} +18 -18
- package/dist/{runOpenClaw-CDU1UOZ1.mjs → runOpenClaw-msp2nzW8.mjs} +18 -18
- package/dist/{sandbox-DojsNXsy.mjs → sandbox-CH7xLX1-.mjs} +4 -4
- package/dist/{sandbox-ryBV4t4z.cjs → sandbox-CSnsdXId.cjs} +4 -4
- package/dist/{selfCheck-B69om90v.cjs → selfCheck-B4mCW5Em.cjs} +34 -34
- package/dist/selfCheck-WbfDqlfQ.mjs +84 -0
- package/dist/{send-Bi7MDDHN.cjs → send-DzRwXl8a.cjs} +8 -8
- package/dist/{send-DyRupwU5.mjs → send-lrV7t7dr.mjs} +8 -8
- package/dist/{server-DpJPHOAb.cjs → server-BAwRC79P.cjs} +6 -6
- package/dist/{server-B4SxszzQ.mjs → server-DBHPW2gs.mjs} +4 -4
- package/dist/{sessionLock-DdoHaNAf.cjs → sessionLock-ClIuWFru.cjs} +3 -3
- package/dist/{sessionLock-ZtySCwjt.mjs → sessionLock-D_-T15Y-.mjs} +3 -3
- package/dist/{sessionModeFile-Bkzcsv_J.cjs → sessionModeFile-BFejyKn5.cjs} +1 -1
- package/dist/{sessionModeFile-B-z4OPU6.mjs → sessionModeFile-BP1s4On2.mjs} +1 -1
- package/dist/{sessionOps-BUzvciA5.cjs → sessionOps-C7wI8Ll6.cjs} +4 -4
- package/dist/{sessionOps-BtqGzSz1.mjs → sessionOps-DfAtoDD5.mjs} +4 -4
- package/dist/{sessionScanner-60sqJeks.mjs → sessionScanner-1-ANJdrm.mjs} +3 -3
- package/dist/{sessionScanner-DOdHh5CA.cjs → sessionScanner-BJFPUwar.cjs} +3 -3
- package/dist/{sessions-OCFh0naE.cjs → sessions-Bi13Rn0K.cjs} +9 -9
- package/dist/{sessions-AM5DxBgS.mjs → sessions-Dp_X8vP2.mjs} +9 -9
- package/dist/{setupOfflineReconnection-BcHl9VGI.cjs → setupOfflineReconnection-BJCXuFad.cjs} +2 -2
- package/dist/{setupOfflineReconnection-VK1e2LME.mjs → setupOfflineReconnection-D51KXWAP.mjs} +2 -2
- package/dist/{spawn-CjtSsVs5.cjs → spawn-BiYYv0J7.cjs} +13 -13
- package/dist/{spawn-CG1ckxEZ.mjs → spawn-DeXPOMMC.mjs} +13 -13
- package/dist/{spawnAgents-HDaE3C0-.mjs → spawnAgents-BhsbJ253.mjs} +1 -1
- package/dist/{spawnAgents-vglexX9N.cjs → spawnAgents-CgMKuOhZ.cjs} +1 -1
- package/dist/{spawnHappyCLI-XVh-9eez.mjs → spawnHappyCLI-CYS23qZY.mjs} +1 -1
- package/dist/{spawnHappyCLI-A9QYQdFL.cjs → spawnHappyCLI-CrKdy_rv.cjs} +1 -1
- package/dist/{specialCommands-VaHfF5iC.mjs → specialCommands-BbNlcS3G.mjs} +3 -3
- package/dist/{specialCommands-BK2gc9vz.cjs → specialCommands-Dkg5wrXd.cjs} +3 -3
- package/dist/{startFileWatcher-CwkqU0fA.cjs → startFileWatcher-BJ4vTfRp.cjs} +1 -1
- package/dist/{startFileWatcher-Dls9MDuo.mjs → startFileWatcher-CgH0PknF.mjs} +1 -1
- package/dist/{streamRelay-Iogsh51a.mjs → streamRelay-C8zI7OnR.mjs} +1 -1
- package/dist/{streamRelay-Ce9sgcOV.cjs → streamRelay-DqPFsCgx.cjs} +1 -1
- package/dist/{sync-BN5jPiq4.cjs → sync-CGVTRg-R.cjs} +1 -1
- package/dist/{sync-CU7N-dAQ.mjs → sync-MTpgBfV2.mjs} +1 -1
- package/dist/{systemPrompt-W9opO926.mjs → systemPrompt-BMGFnaRU.mjs} +2 -2
- package/dist/{systemPrompt-bo6KFoMZ.cjs → systemPrompt-DRCJdhNo.cjs} +2 -2
- package/dist/{teams--pI0Ri5A.cjs → teams-0d4XG2_h.cjs} +6 -6
- package/dist/{teams-hotQxTHy.mjs → teams-H_F3UZkh.mjs} +6 -6
- package/dist/{time-jR_TKQyj.mjs → time-7iVn8KLQ.mjs} +1 -1
- package/dist/{time-BDZ6VD5o.cjs → time-ChuhR6SU.cjs} +1 -1
- package/dist/{titleGenerator-Dp0eIi1b.mjs → titleGenerator-CLdAiwN1.mjs} +1 -1
- package/dist/{titleGenerator-CQ6ZqGb2.cjs → titleGenerator-CozWnU-t.cjs} +2 -2
- package/dist/{todo-CwW7byJY.mjs → todo-7mtNKrxn.mjs} +6 -6
- package/dist/{todo-DVCyX6N9.cjs → todo-BeIYBXws.cjs} +6 -6
- package/dist/{tools-C5HNddiJ.cjs → tools-9hPR5-u8.cjs} +1 -1
- package/dist/{tools-BzD8JYIx.mjs → tools-BSlqfWAq.mjs} +1 -1
- package/dist/{uninstall-G9lEyEVW.cjs → uninstall-Bf5MardO.cjs} +3 -3
- package/dist/{uninstall-HRcEekvo.mjs → uninstall-Uei9RnVT.mjs} +3 -3
- package/package.json +7 -7
- package/dist/selfCheck-jA7PDBkO.mjs +0 -84
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
2
|
import { spawn } from 'cross-spawn';
|
|
3
3
|
import { createInterface } from 'node:readline';
|
|
4
|
-
import { l as logger } from './logger-
|
|
4
|
+
import { l as logger } from './logger-CUxbqfrp.mjs';
|
|
5
5
|
import { e as errorLogMetadata, c as contentLogMetadata } from './contentLogMetadata-BlWI0egu.mjs';
|
|
6
6
|
import { i as initializeSandbox, w as wrapForMcpTransport } from './manager-BEsI4qt3.mjs';
|
|
7
|
-
import { p as packageJson } from './package-
|
|
8
|
-
import { s as shouldReadCodexRateLimits, i as isUnsupportedCodexMethodError } from './rateLimitWindows-
|
|
7
|
+
import { p as packageJson } from './package-DkI3yDe0.mjs';
|
|
8
|
+
import { s as shouldReadCodexRateLimits, i as isUnsupportedCodexMethodError } from './rateLimitWindows-i2-530Zt.mjs';
|
|
9
9
|
|
|
10
10
|
function isAppServerAvailable() {
|
|
11
11
|
try {
|
|
@@ -100,6 +100,12 @@ class CodexAppServerClient {
|
|
|
100
100
|
notificationProtocol = "unknown";
|
|
101
101
|
completedTurnIds = /* @__PURE__ */ new Set();
|
|
102
102
|
rawFileChangesByItemId = /* @__PURE__ */ new Map();
|
|
103
|
+
// B-622: inactivity watchdog for the pending turn — re-armed by every
|
|
104
|
+
// notification, never a cap on how long a turn may run (see sendTurnAndWait).
|
|
105
|
+
turnWatchdog = null;
|
|
106
|
+
// Approval / elicitation requests we are still answering: a human may take
|
|
107
|
+
// longer than the watchdog to decide, and that is not Codex going silent.
|
|
108
|
+
inflightServerRequests = 0;
|
|
103
109
|
// Handlers set by the consumer (runCodex.ts)
|
|
104
110
|
eventHandler = null;
|
|
105
111
|
approvalHandler = null;
|
|
@@ -176,11 +182,12 @@ class CodexAppServerClient {
|
|
|
176
182
|
}
|
|
177
183
|
emitRawTurnCompletion(turnId, status, error, source) {
|
|
178
184
|
const aborted = status === "cancelled" || status === "canceled" || status === "aborted" || status === "interrupted";
|
|
185
|
+
const failed = status === "failed" || error !== void 0 && error !== null;
|
|
179
186
|
this.tryResolvePendingTurn(aborted, turnId, source);
|
|
180
187
|
this._turnId = null;
|
|
181
188
|
this.maybeRefreshRateLimits();
|
|
182
189
|
if (turnId && this.completedTurnIds.has(turnId)) {
|
|
183
|
-
return;
|
|
190
|
+
if (!failed) return;
|
|
184
191
|
}
|
|
185
192
|
if (turnId) {
|
|
186
193
|
this.completedTurnIds.add(turnId);
|
|
@@ -316,14 +323,6 @@ class CodexAppServerClient {
|
|
|
316
323
|
phase: item.phase
|
|
317
324
|
});
|
|
318
325
|
}
|
|
319
|
-
if (item.phase === "final_answer" && this.pendingTurnCompletion) {
|
|
320
|
-
this.emitRawTurnCompletion(
|
|
321
|
-
this.extractTurnId(params),
|
|
322
|
-
"completed",
|
|
323
|
-
null,
|
|
324
|
-
`${method}:final_answer`
|
|
325
|
-
);
|
|
326
|
-
}
|
|
327
326
|
return true;
|
|
328
327
|
}
|
|
329
328
|
return method.startsWith("item/");
|
|
@@ -661,6 +660,7 @@ class CodexAppServerClient {
|
|
|
661
660
|
}
|
|
662
661
|
resolvePendingTurn(aborted) {
|
|
663
662
|
if (!this.pendingTurnCompletion) return;
|
|
663
|
+
this.clearTurnWatchdog();
|
|
664
664
|
this.pendingTurnCompletion.resolve(aborted);
|
|
665
665
|
this.pendingTurnCompletion = null;
|
|
666
666
|
}
|
|
@@ -782,30 +782,55 @@ class CodexAppServerClient {
|
|
|
782
782
|
}
|
|
783
783
|
await this.ensureConnected();
|
|
784
784
|
const timeoutMs = opts?.turnTimeoutMs ?? CodexAppServerClient.TURN_TIMEOUT_MS;
|
|
785
|
-
let timer = null;
|
|
786
785
|
const completion = new Promise((resolve) => {
|
|
787
786
|
this.pendingTurnCompletion = {
|
|
788
787
|
resolve,
|
|
789
788
|
turnId: null
|
|
790
789
|
};
|
|
791
|
-
|
|
792
|
-
if (this.pendingTurnCompletion) {
|
|
793
|
-
logger.warn(`[CodexAppServer] Turn timed out after ${timeoutMs}ms \u2014 treating as abort`);
|
|
794
|
-
this.resolvePendingTurn(true);
|
|
795
|
-
}
|
|
796
|
-
}, timeoutMs);
|
|
790
|
+
this.armTurnWatchdog(timeoutMs);
|
|
797
791
|
});
|
|
798
792
|
try {
|
|
799
793
|
await this.sendTurn(prompt, opts);
|
|
800
794
|
} catch (err) {
|
|
801
|
-
|
|
795
|
+
this.clearTurnWatchdog();
|
|
802
796
|
this.pendingTurnCompletion = null;
|
|
803
797
|
throw err;
|
|
804
798
|
}
|
|
805
799
|
const aborted = await completion;
|
|
806
|
-
|
|
800
|
+
this.clearTurnWatchdog();
|
|
807
801
|
return { aborted };
|
|
808
802
|
}
|
|
803
|
+
armTurnWatchdog(timeoutMs) {
|
|
804
|
+
this.clearTurnWatchdog();
|
|
805
|
+
const timer = setTimeout(() => {
|
|
806
|
+
this.turnWatchdog = null;
|
|
807
|
+
if (!this.pendingTurnCompletion) return;
|
|
808
|
+
if (this.inflightServerRequests > 0) {
|
|
809
|
+
this.armTurnWatchdog(timeoutMs);
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
logger.warn(`[CodexAppServer] No notification from Codex for ${timeoutMs}ms \u2014 giving the turn up as aborted`);
|
|
813
|
+
const turnId = this.pendingTurnCompletion.turnId ?? this._turnId;
|
|
814
|
+
this.eventHandler?.({
|
|
815
|
+
type: "turn_aborted",
|
|
816
|
+
reason: "timeout",
|
|
817
|
+
...turnId ? { turn_id: turnId } : {},
|
|
818
|
+
error: { message: `Codex sent nothing for ${Math.max(1, Math.round(timeoutMs / 6e4))} minutes; this turn was given up. Send the message again, or restart the session if it keeps happening.` }
|
|
819
|
+
});
|
|
820
|
+
this.resolvePendingTurn(true);
|
|
821
|
+
}, timeoutMs);
|
|
822
|
+
this.turnWatchdog = { timer, timeoutMs };
|
|
823
|
+
}
|
|
824
|
+
/** Any sign of life from the app-server while a turn is pending restarts the clock. */
|
|
825
|
+
touchTurnWatchdog() {
|
|
826
|
+
if (!this.turnWatchdog || !this.pendingTurnCompletion) return;
|
|
827
|
+
this.armTurnWatchdog(this.turnWatchdog.timeoutMs);
|
|
828
|
+
}
|
|
829
|
+
clearTurnWatchdog() {
|
|
830
|
+
if (!this.turnWatchdog) return;
|
|
831
|
+
clearTimeout(this.turnWatchdog.timer);
|
|
832
|
+
this.turnWatchdog = null;
|
|
833
|
+
}
|
|
809
834
|
async interruptTurn() {
|
|
810
835
|
if (!this._threadId) return;
|
|
811
836
|
if (!this._turnId) {
|
|
@@ -1013,6 +1038,15 @@ class CodexAppServerClient {
|
|
|
1013
1038
|
};
|
|
1014
1039
|
}
|
|
1015
1040
|
async handleServerRequest(id, method, params) {
|
|
1041
|
+
this.inflightServerRequests += 1;
|
|
1042
|
+
try {
|
|
1043
|
+
await this.handleServerRequestInner(id, method, params);
|
|
1044
|
+
} finally {
|
|
1045
|
+
this.inflightServerRequests -= 1;
|
|
1046
|
+
this.touchTurnWatchdog();
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
async handleServerRequestInner(id, method, params) {
|
|
1016
1050
|
if (method === "mcpServer/elicitation/request") {
|
|
1017
1051
|
const toolName = this.parseToolNameFromElicitationMessage(params?.message) ?? params?.serverName ?? "McpTool";
|
|
1018
1052
|
const decision = await this.handleApproval({
|
|
@@ -1066,6 +1100,7 @@ class CodexAppServerClient {
|
|
|
1066
1100
|
return "denied";
|
|
1067
1101
|
}
|
|
1068
1102
|
handleNotification(method, params) {
|
|
1103
|
+
this.touchTurnWatchdog();
|
|
1069
1104
|
if (method === "codex/event" || method.startsWith("codex/event/")) {
|
|
1070
1105
|
this.notificationProtocol = "legacy";
|
|
1071
1106
|
const msg = params?.msg;
|
|
@@ -1125,6 +1160,21 @@ class CodexAppServerClient {
|
|
|
1125
1160
|
logger.debug(`[CodexAppServer] mcpServer startup status:`, params);
|
|
1126
1161
|
return;
|
|
1127
1162
|
}
|
|
1163
|
+
if (method === "error" && params?.willRetry === true) {
|
|
1164
|
+
const error = params?.error ?? {};
|
|
1165
|
+
const message = typeof error.message === "string" ? error.message : "";
|
|
1166
|
+
const info = error.codexErrorInfo;
|
|
1167
|
+
const httpStatus = info && typeof info === "object" ? info.responseStreamDisconnected?.httpStatusCode ?? info.httpStatusCode ?? null : null;
|
|
1168
|
+
const turnId = typeof params?.turnId === "string" ? params.turnId : null;
|
|
1169
|
+
this.eventHandler?.({
|
|
1170
|
+
type: "turn_retry",
|
|
1171
|
+
message,
|
|
1172
|
+
...typeof httpStatus === "number" ? { http_status: httpStatus } : {},
|
|
1173
|
+
...turnId ? { turn_id: turnId } : {},
|
|
1174
|
+
...typeof error.additionalDetails === "string" ? { details: error.additionalDetails } : {}
|
|
1175
|
+
});
|
|
1176
|
+
return;
|
|
1177
|
+
}
|
|
1128
1178
|
logger.debug(`[CodexAppServer] Notification: ${method}`);
|
|
1129
1179
|
}
|
|
1130
1180
|
}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { a as authAndSetupMachineIfNeeded } from './auth-
|
|
2
|
-
import { c as createEnvelope, o as BUILTIN_TODO_DISCOVERY, P as PROMPT_QUEUE_CAPABILITY } from './index-
|
|
1
|
+
import { a as authAndSetupMachineIfNeeded } from './auth-CiZfkTkd.mjs';
|
|
2
|
+
import { c as createEnvelope, o as BUILTIN_TODO_DISCOVERY, P as PROMPT_QUEUE_CAPABILITY } from './index-boE-d8CM.mjs';
|
|
3
3
|
import { p as publishForkBackfillWhenCommitted, F as FORK_BACKFILL_CAPABILITY } from './forkBackfill-DYIjlN1Z.mjs';
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
5
5
|
import { createId } from '@paralleldrive/cuid2';
|
|
6
6
|
import { r as registerAgentAttachmentDownloads } from './agentAttachments-M_B5qEF2.mjs';
|
|
7
|
-
import { C as CLAUDE_ATTACHMENT_KINDS, a as stageClaudeAttachments, b as appendStagedAttachmentsToPrompt } from './attachmentContent-
|
|
7
|
+
import { C as CLAUDE_ATTACHMENT_KINDS, a as stageClaudeAttachments, b as appendStagedAttachmentsToPrompt } from './attachmentContent-CSGb8uDJ.mjs';
|
|
8
8
|
import { useStdout, useInput, Box, Text, render } from 'ink';
|
|
9
|
-
import { c as claimSessionOrExit, a as applyServerSnapshot, b as applyHibernationReplay, w as withoutServerSnapshot, m as mergeReconnectMetadata } from './sessionLock-
|
|
9
|
+
import { c as claimSessionOrExit, a as applyServerSnapshot, b as applyHibernationReplay, w as withoutServerSnapshot, m as mergeReconnectMetadata } from './sessionLock-D_-T15Y-.mjs';
|
|
10
10
|
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
11
|
-
import { c as connectionState, A as ApiClient } from './api-
|
|
12
|
-
import { C as CodexAppServerClient } from './codexAppServerClient-
|
|
13
|
-
import { p as parseSpecialCommand, w as wrapperRateLimitReporter } from './specialCommands-
|
|
14
|
-
import { l as logger } from './logger-
|
|
15
|
-
import { B as BasePermissionHandler } from './BasePermissionHandler-
|
|
16
|
-
import { B as BaseReasoningProcessor } from './BaseReasoningProcessor-
|
|
11
|
+
import { c as connectionState, A as ApiClient } from './api-rOLB1-sV.mjs';
|
|
12
|
+
import { C as CodexAppServerClient } from './codexAppServerClient-pnCpJlD8.mjs';
|
|
13
|
+
import { p as parseSpecialCommand, w as wrapperRateLimitReporter } from './specialCommands-BbNlcS3G.mjs';
|
|
14
|
+
import { l as logger } from './logger-CUxbqfrp.mjs';
|
|
15
|
+
import { B as BasePermissionHandler } from './BasePermissionHandler-BiWdGyL1.mjs';
|
|
16
|
+
import { B as BaseReasoningProcessor } from './BaseReasoningProcessor-2sLuoRYw.mjs';
|
|
17
17
|
import { execSync } from 'node:child_process';
|
|
18
|
-
import { r as readSettings, l as latchKeepAwake, e as evaluateWrapperIdle, a as resolveCheckMs, H as HIBERNATION_CAPABILITY } from './persistence-
|
|
19
|
-
import { g as getInitialMachineMetadata } from './machineMetadata-
|
|
20
|
-
import { c as configuration } from './configuration-
|
|
21
|
-
import { M as MessageQueue2, r as registerKillSessionHandler } from './registerKillSessionHandler-
|
|
18
|
+
import { r as readSettings, l as latchKeepAwake, e as evaluateWrapperIdle, a as resolveCheckMs, H as HIBERNATION_CAPABILITY } from './persistence-CBToZ0R6.mjs';
|
|
19
|
+
import { g as getInitialMachineMetadata } from './machineMetadata-QfdvKIrL.mjs';
|
|
20
|
+
import { c as configuration } from './configuration-zOfO2qdB.mjs';
|
|
21
|
+
import { M as MessageQueue2, r as registerKillSessionHandler } from './registerKillSessionHandler-B7zpuzvS.mjs';
|
|
22
22
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
23
23
|
import { join } from 'node:path';
|
|
24
|
-
import { c as createSessionMetadata } from './createSessionMetadata-
|
|
25
|
-
import { h as hashObject, s as startHappyServer } from './deterministicJson-
|
|
24
|
+
import { c as createSessionMetadata } from './createSessionMetadata-CM7ErnPh.mjs';
|
|
25
|
+
import { h as hashObject, s as startHappyServer } from './deterministicJson-DVvfcibH.mjs';
|
|
26
26
|
import { M as MessageBuffer } from './messageBuffer-BWlGgR3A.mjs';
|
|
27
|
-
import { n as notifyDaemonSessionStarted, j as reportSessionEditToDaemon, c as checkDaemonHibernation } from './controlClient-
|
|
28
|
-
import { a as HibernationExitLatch, H as HibernationProbe, c as commitHibernation, b as DEFAULT_CODEX_PERMISSION_MODE } from './defaultPermissionMode-
|
|
27
|
+
import { n as notifyDaemonSessionStarted, j as reportSessionEditToDaemon, c as checkDaemonHibernation } from './controlClient-CbmWgWJW.mjs';
|
|
28
|
+
import { a as HibernationExitLatch, H as HibernationProbe, c as commitHibernation, b as DEFAULT_CODEX_PERMISSION_MODE } from './defaultPermissionMode-CmgCDVpL.mjs';
|
|
29
29
|
import { d as decodeBase64, e as encodeBase64 } from './authRelay-DSAvg1uv.mjs';
|
|
30
|
-
import { s as setupOfflineReconnection } from './setupOfflineReconnection-
|
|
30
|
+
import { s as setupOfflineReconnection } from './setupOfflineReconnection-D51KXWAP.mjs';
|
|
31
31
|
import { t as trimIdent } from './trimIdent-BAjmv_TG.mjs';
|
|
32
32
|
import { C as CHANGE_TITLE_INSTRUCTION } from './constants-BC4St0xd.mjs';
|
|
33
33
|
import { E as EditReportThrottle, a as extractCodexPatchPaths } from './editPaths-BVfS_FFL.mjs';
|
|
34
|
-
import { a as extractNoSandboxFlag, e as ensureDaemonRunning } from './ensureDaemonRunning-
|
|
34
|
+
import { a as extractNoSandboxFlag, e as ensureDaemonRunning } from './ensureDaemonRunning-CWo9yDAC.mjs';
|
|
35
35
|
import 'tweetnacl';
|
|
36
36
|
import 'axios';
|
|
37
|
-
import './time-
|
|
38
|
-
import './browser-
|
|
37
|
+
import './time-7iVn8KLQ.mjs';
|
|
38
|
+
import './browser-IVfX6PQT.mjs';
|
|
39
39
|
import 'open';
|
|
40
40
|
import 'zod';
|
|
41
41
|
import 'node:fs/promises';
|
|
42
|
-
import './attachmentLimits-
|
|
42
|
+
import './attachmentLimits-BLbji11b.mjs';
|
|
43
43
|
import 'node:fs';
|
|
44
|
-
import './lidState-
|
|
44
|
+
import './lidState-Bv862v_R.mjs';
|
|
45
45
|
import 'os';
|
|
46
46
|
import 'child_process';
|
|
47
47
|
import 'node:events';
|
|
48
48
|
import 'socket.io-client';
|
|
49
49
|
import './limits-DIo7rEBR.mjs';
|
|
50
|
-
import './registerCommonHandlers-
|
|
50
|
+
import './registerCommonHandlers-C_KbP5Mq.mjs';
|
|
51
51
|
import 'util';
|
|
52
52
|
import 'fs/promises';
|
|
53
53
|
import 'crypto';
|
|
54
54
|
import 'path';
|
|
55
55
|
import 'cross-spawn';
|
|
56
|
-
import './sync-
|
|
56
|
+
import './sync-MTpgBfV2.mjs';
|
|
57
57
|
import './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
58
58
|
import './contentLogMetadata-BlWI0egu.mjs';
|
|
59
59
|
import 'chalk';
|
|
@@ -61,36 +61,36 @@ import 'node:readline';
|
|
|
61
61
|
import './manager-BEsI4qt3.mjs';
|
|
62
62
|
import '@anthropic-ai/sandbox-runtime';
|
|
63
63
|
import 'node:os';
|
|
64
|
-
import './package-
|
|
65
|
-
import './rateLimitWindows-
|
|
64
|
+
import './package-DkI3yDe0.mjs';
|
|
65
|
+
import './rateLimitWindows-i2-530Zt.mjs';
|
|
66
66
|
import 'node:util';
|
|
67
67
|
import './detectCLI-CSGMlV51.mjs';
|
|
68
68
|
import 'fs';
|
|
69
|
-
import './localHappyAgentAuth-
|
|
69
|
+
import './localHappyAgentAuth-CLP3CBMK.mjs';
|
|
70
70
|
import './types-CkqAACXx.mjs';
|
|
71
71
|
import 'url';
|
|
72
|
-
import './client-
|
|
73
|
-
import './context-
|
|
74
|
-
import './sessionOps-
|
|
72
|
+
import './client-DbqP92Fy.mjs';
|
|
73
|
+
import './context-BTX3YYdt.mjs';
|
|
74
|
+
import './sessionOps-DfAtoDD5.mjs';
|
|
75
75
|
import './resources-BdFBQi8r.mjs';
|
|
76
|
-
import './tools-
|
|
77
|
-
import './reportProgressTool-
|
|
78
|
-
import './client-
|
|
76
|
+
import './tools-BSlqfWAq.mjs';
|
|
77
|
+
import './reportProgressTool-DujvMncK.mjs';
|
|
78
|
+
import './client-Bi1DOVy9.mjs';
|
|
79
79
|
import './precheckCompat-DeEbilbr.mjs';
|
|
80
80
|
import './agentGuidance-BDYt2Qy2.mjs';
|
|
81
|
-
import './peerTools-
|
|
81
|
+
import './peerTools-zfe59JAw.mjs';
|
|
82
82
|
import './ids-DU6sLx4C.mjs';
|
|
83
|
-
import './remoteSessionClient-
|
|
83
|
+
import './remoteSessionClient-Bk1Qzb5I.mjs';
|
|
84
84
|
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
85
85
|
import 'node:http';
|
|
86
86
|
import '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
87
|
-
import './downloadTarget-
|
|
87
|
+
import './downloadTarget-C-18yOBz.mjs';
|
|
88
88
|
import './terminals-Dlg0x3nY.mjs';
|
|
89
89
|
import './terminalTitleSuggest-CeKsX_V6.mjs';
|
|
90
90
|
import './tmuxSocket-B8Yx20sT.mjs';
|
|
91
|
-
import './bootstrap-
|
|
91
|
+
import './bootstrap-D1RRCJdQ.mjs';
|
|
92
92
|
import './previewPath-CXN4Vag0.mjs';
|
|
93
|
-
import './spawnHappyCLI-
|
|
93
|
+
import './spawnHappyCLI-CYS23qZY.mjs';
|
|
94
94
|
import './doctorReadiness-C208SMN9.mjs';
|
|
95
95
|
|
|
96
96
|
function getStartedSubagents(state) {
|
|
@@ -1028,18 +1028,41 @@ function unsupportedEffortReason(catalog, model, effort) {
|
|
|
1028
1028
|
return `Reasoning effort "${effort}" is not supported by ${model ?? "the default model"}. Choose a supported level.`;
|
|
1029
1029
|
}
|
|
1030
1030
|
|
|
1031
|
+
const UNEXPECTED_STATUS = /^unexpected status (\d{3}) ([^:]*?):\s*([\s\S]*?)(?:,\s*url:\s*(\S+))?$/;
|
|
1031
1032
|
function readableCodexErrorText(text) {
|
|
1032
1033
|
const trimmed = text.trim();
|
|
1033
|
-
|
|
1034
|
+
const status = UNEXPECTED_STATUS.exec(trimmed);
|
|
1035
|
+
if (status) {
|
|
1036
|
+
const [, code, reason, rawBody, url] = status;
|
|
1037
|
+
const head = `HTTP ${code} ${reason.trim()} from the model API`;
|
|
1038
|
+
const detail = readableHttpBody(rawBody, `${code} ${reason}`);
|
|
1039
|
+
return `${head}${detail ? `: ${detail}` : ""}${url ? ` (${url})` : ""}`;
|
|
1040
|
+
}
|
|
1041
|
+
return unwrapJsonMessage(trimmed) ?? trimmed;
|
|
1042
|
+
}
|
|
1043
|
+
function unwrapJsonMessage(text) {
|
|
1044
|
+
if (!text.startsWith("{")) return null;
|
|
1034
1045
|
try {
|
|
1035
|
-
const body = JSON.parse(
|
|
1046
|
+
const body = JSON.parse(text);
|
|
1036
1047
|
const inner = typeof body.error === "object" && body.error ? body.error.message : void 0;
|
|
1037
1048
|
const message = typeof inner === "string" && inner.trim() ? inner : typeof body.error === "string" && body.error.trim() ? body.error : typeof body.message === "string" && body.message.trim() ? body.message : null;
|
|
1038
|
-
return message ? message.trim() :
|
|
1049
|
+
return message ? message.trim() : null;
|
|
1039
1050
|
} catch {
|
|
1040
|
-
return
|
|
1051
|
+
return null;
|
|
1041
1052
|
}
|
|
1042
1053
|
}
|
|
1054
|
+
function readableHttpBody(raw, statusLine) {
|
|
1055
|
+
let body = unwrapJsonMessage(raw.trim()) ?? raw.trim();
|
|
1056
|
+
if (/<[a-z!/][^>]*>/i.test(body)) {
|
|
1057
|
+
const title = /<title[^>]*>([\s\S]*?)<\/title>/i.exec(body);
|
|
1058
|
+
body = title ? title[1] : body.replace(/<[^>]+>/g, " ");
|
|
1059
|
+
}
|
|
1060
|
+
body = body.replace(/\s+/g, " ").trim();
|
|
1061
|
+
if (!body) return null;
|
|
1062
|
+
const normalize = (value) => value.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
1063
|
+
if (normalize(body) === normalize(statusLine)) return null;
|
|
1064
|
+
return body.length > 240 ? `${body.slice(0, 240)}\u2026` : body;
|
|
1065
|
+
}
|
|
1043
1066
|
function describeCodexFailure(msg) {
|
|
1044
1067
|
const hasFailure = msg?.status === "failed" || msg?.error !== void 0 && msg?.error !== null;
|
|
1045
1068
|
if (!hasFailure) return null;
|
|
@@ -1050,6 +1073,12 @@ function describeCodexFailure(msg) {
|
|
|
1050
1073
|
}
|
|
1051
1074
|
return "Unknown error";
|
|
1052
1075
|
}
|
|
1076
|
+
function describeCodexRetry(msg) {
|
|
1077
|
+
const message = typeof msg?.message === "string" ? msg.message.trim() : "";
|
|
1078
|
+
const status = typeof msg?.http_status === "number" ? msg.http_status : null;
|
|
1079
|
+
const cause = status ? `HTTP ${status} from the model API` : "a model API error";
|
|
1080
|
+
return message ? `Codex is retrying after ${cause} (${message})` : `Codex is retrying after ${cause}`;
|
|
1081
|
+
}
|
|
1053
1082
|
const TRANSPORT_LOSS = /^Codex process (exited|disconnected)\b|stdin not writable| timed out after \d+ms/;
|
|
1054
1083
|
function describeThrownTurnError(error) {
|
|
1055
1084
|
const message = error instanceof Error ? error.message : typeof error === "string" ? error : "";
|
|
@@ -1741,6 +1770,10 @@ async function runCodex(opts) {
|
|
|
1741
1770
|
} else {
|
|
1742
1771
|
messageBuffer.addMessage("Turn aborted", "status");
|
|
1743
1772
|
}
|
|
1773
|
+
} else if (msg.type === "turn_retry") {
|
|
1774
|
+
const notice = describeCodexRetry(msg);
|
|
1775
|
+
messageBuffer.addMessage(notice, "status");
|
|
1776
|
+
session.sendSessionEvent({ type: "message", message: notice });
|
|
1744
1777
|
}
|
|
1745
1778
|
if (msg.type === "task_started") {
|
|
1746
1779
|
if (!thinking) {
|
|
@@ -1955,6 +1988,10 @@ async function runCodex(opts) {
|
|
|
1955
1988
|
if (!message) {
|
|
1956
1989
|
break;
|
|
1957
1990
|
}
|
|
1991
|
+
if (!thinking) {
|
|
1992
|
+
thinking = true;
|
|
1993
|
+
session.keepAlive(thinking, "remote");
|
|
1994
|
+
}
|
|
1958
1995
|
idleRelease.cancel();
|
|
1959
1996
|
turnActive = true;
|
|
1960
1997
|
if (isCodexClearText(message.message)) {
|
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var auth = require('./auth-
|
|
4
|
-
var index = require('./index-
|
|
3
|
+
var auth = require('./auth-BD2z4MCH.cjs');
|
|
4
|
+
var index = require('./index-BZdhwBKa.cjs');
|
|
5
5
|
var forkBackfill = require('./forkBackfill-8eLDeS73.cjs');
|
|
6
6
|
var node_crypto = require('node:crypto');
|
|
7
7
|
var cuid2 = require('@paralleldrive/cuid2');
|
|
8
8
|
var agentAttachments = require('./agentAttachments-Dbw8iMCZ.cjs');
|
|
9
|
-
var attachmentContent = require('./attachmentContent-
|
|
9
|
+
var attachmentContent = require('./attachmentContent-ULnsMsIL.cjs');
|
|
10
10
|
var ink = require('ink');
|
|
11
|
-
var sessionLock = require('./sessionLock-
|
|
11
|
+
var sessionLock = require('./sessionLock-ClIuWFru.cjs');
|
|
12
12
|
var React = require('react');
|
|
13
|
-
var api = require('./api-
|
|
14
|
-
var codexAppServerClient = require('./codexAppServerClient-
|
|
15
|
-
var specialCommands = require('./specialCommands-
|
|
16
|
-
var logger = require('./logger-
|
|
17
|
-
var BasePermissionHandler = require('./BasePermissionHandler-
|
|
18
|
-
var BaseReasoningProcessor = require('./BaseReasoningProcessor-
|
|
13
|
+
var api = require('./api-Cy_Mbe8W.cjs');
|
|
14
|
+
var codexAppServerClient = require('./codexAppServerClient-BWB1267F.cjs');
|
|
15
|
+
var specialCommands = require('./specialCommands-Dkg5wrXd.cjs');
|
|
16
|
+
var logger = require('./logger-XjIS0lU7.cjs');
|
|
17
|
+
var BasePermissionHandler = require('./BasePermissionHandler-CJQPjMEa.cjs');
|
|
18
|
+
var BaseReasoningProcessor = require('./BaseReasoningProcessor-BY9a3RTU.cjs');
|
|
19
19
|
var node_child_process = require('node:child_process');
|
|
20
|
-
var persistence = require('./persistence-
|
|
21
|
-
var machineMetadata = require('./machineMetadata-
|
|
22
|
-
var configuration = require('./configuration-
|
|
23
|
-
var registerKillSessionHandler = require('./registerKillSessionHandler-
|
|
20
|
+
var persistence = require('./persistence-BO7AS2NK.cjs');
|
|
21
|
+
var machineMetadata = require('./machineMetadata-DTxYqMdE.cjs');
|
|
22
|
+
var configuration = require('./configuration-Btwt68O2.cjs');
|
|
23
|
+
var registerKillSessionHandler = require('./registerKillSessionHandler-B_FqygY4.cjs');
|
|
24
24
|
var projectPath = require('./projectPath-ChLhdOyt.cjs');
|
|
25
25
|
var path = require('node:path');
|
|
26
|
-
var createSessionMetadata = require('./createSessionMetadata-
|
|
27
|
-
var deterministicJson = require('./deterministicJson-
|
|
26
|
+
var createSessionMetadata = require('./createSessionMetadata-Cgfcg0WZ.cjs');
|
|
27
|
+
var deterministicJson = require('./deterministicJson-B3V5Ss2l.cjs');
|
|
28
28
|
var messageBuffer = require('./messageBuffer-fJMH6uY8.cjs');
|
|
29
|
-
var controlClient = require('./controlClient-
|
|
30
|
-
var defaultPermissionMode = require('./defaultPermissionMode-
|
|
29
|
+
var controlClient = require('./controlClient-CEpaptre.cjs');
|
|
30
|
+
var defaultPermissionMode = require('./defaultPermissionMode-DqdkzYUY.cjs');
|
|
31
31
|
var authRelay = require('./authRelay-BdYkC1Po.cjs');
|
|
32
|
-
var setupOfflineReconnection = require('./setupOfflineReconnection-
|
|
32
|
+
var setupOfflineReconnection = require('./setupOfflineReconnection-BJCXuFad.cjs');
|
|
33
33
|
var trimIdent = require('./trimIdent-4gvk9Wk6.cjs');
|
|
34
34
|
var constants = require('./constants-VJ0N6WuG.cjs');
|
|
35
35
|
var editPaths = require('./editPaths-Bqp4OFPw.cjs');
|
|
36
|
-
var ensureDaemonRunning = require('./ensureDaemonRunning-
|
|
36
|
+
var ensureDaemonRunning = require('./ensureDaemonRunning-Dk1yo6aK.cjs');
|
|
37
37
|
require('tweetnacl');
|
|
38
38
|
require('axios');
|
|
39
|
-
require('./time-
|
|
40
|
-
require('./browser-
|
|
39
|
+
require('./time-ChuhR6SU.cjs');
|
|
40
|
+
require('./browser-i45hmvWw.cjs');
|
|
41
41
|
require('open');
|
|
42
42
|
require('zod');
|
|
43
43
|
require('node:fs/promises');
|
|
44
|
-
require('./attachmentLimits-
|
|
44
|
+
require('./attachmentLimits-D6bT2jU1.cjs');
|
|
45
45
|
require('node:fs');
|
|
46
|
-
require('./lidState-
|
|
46
|
+
require('./lidState-7uLoa43a.cjs');
|
|
47
47
|
require('os');
|
|
48
48
|
require('child_process');
|
|
49
49
|
require('node:events');
|
|
50
50
|
require('socket.io-client');
|
|
51
51
|
require('./limits-C-a7gr04.cjs');
|
|
52
|
-
require('./registerCommonHandlers-
|
|
52
|
+
require('./registerCommonHandlers-DTeuk3Hw.cjs');
|
|
53
53
|
require('util');
|
|
54
54
|
require('fs/promises');
|
|
55
55
|
require('crypto');
|
|
56
56
|
require('path');
|
|
57
57
|
require('cross-spawn');
|
|
58
|
-
require('./sync-
|
|
58
|
+
require('./sync-CGVTRg-R.cjs');
|
|
59
59
|
require('./backgroundTaskActivity-CBvUdj39.cjs');
|
|
60
60
|
require('./contentLogMetadata-ZSFk_NjQ.cjs');
|
|
61
61
|
require('chalk');
|
|
@@ -63,36 +63,36 @@ require('node:readline');
|
|
|
63
63
|
require('./manager-HrEj442o.cjs');
|
|
64
64
|
require('@anthropic-ai/sandbox-runtime');
|
|
65
65
|
require('node:os');
|
|
66
|
-
require('./package-
|
|
67
|
-
require('./rateLimitWindows-
|
|
66
|
+
require('./package-DFQUF2in.cjs');
|
|
67
|
+
require('./rateLimitWindows-U7NsRvIa.cjs');
|
|
68
68
|
require('node:util');
|
|
69
69
|
require('./detectCLI-DR9ZaN6B.cjs');
|
|
70
70
|
require('fs');
|
|
71
|
-
require('./localHappyAgentAuth-
|
|
71
|
+
require('./localHappyAgentAuth-CfILduPd.cjs');
|
|
72
72
|
require('./types-CRS-srZK.cjs');
|
|
73
73
|
require('url');
|
|
74
|
-
require('./client-
|
|
75
|
-
require('./context
|
|
76
|
-
require('./sessionOps-
|
|
74
|
+
require('./client-QtWC3yii.cjs');
|
|
75
|
+
require('./context-BknomZTq.cjs');
|
|
76
|
+
require('./sessionOps-C7wI8Ll6.cjs');
|
|
77
77
|
require('./resources-JDPugcDq.cjs');
|
|
78
|
-
require('./tools-
|
|
79
|
-
require('./reportProgressTool-
|
|
80
|
-
require('./client-
|
|
78
|
+
require('./tools-9hPR5-u8.cjs');
|
|
79
|
+
require('./reportProgressTool-oJMMqzKb.cjs');
|
|
80
|
+
require('./client-B6H6ZROd.cjs');
|
|
81
81
|
require('./precheckCompat-CWOi5c9L.cjs');
|
|
82
82
|
require('./agentGuidance-BtBx2xxE.cjs');
|
|
83
|
-
require('./peerTools-
|
|
83
|
+
require('./peerTools-DbI6tEk1.cjs');
|
|
84
84
|
require('./ids-B6ZC0HGt.cjs');
|
|
85
|
-
require('./remoteSessionClient-
|
|
85
|
+
require('./remoteSessionClient-D79ci1L8.cjs');
|
|
86
86
|
require('@modelcontextprotocol/sdk/server/mcp.js');
|
|
87
87
|
require('node:http');
|
|
88
88
|
require('@modelcontextprotocol/sdk/server/streamableHttp.js');
|
|
89
|
-
require('./downloadTarget-
|
|
89
|
+
require('./downloadTarget-DJKG6wVj.cjs');
|
|
90
90
|
require('./terminals-B_bfC9c2.cjs');
|
|
91
91
|
require('./terminalTitleSuggest-DhvRFX3H.cjs');
|
|
92
92
|
require('./tmuxSocket-D-Xt6Vn-.cjs');
|
|
93
|
-
require('./bootstrap-
|
|
93
|
+
require('./bootstrap-BYrt5zUv.cjs');
|
|
94
94
|
require('./previewPath-B0rBdhy1.cjs');
|
|
95
|
-
require('./spawnHappyCLI-
|
|
95
|
+
require('./spawnHappyCLI-CrKdy_rv.cjs');
|
|
96
96
|
require('./doctorReadiness-BCZGcN0a.cjs');
|
|
97
97
|
|
|
98
98
|
function getStartedSubagents(state) {
|
|
@@ -1030,18 +1030,41 @@ function unsupportedEffortReason(catalog, model, effort) {
|
|
|
1030
1030
|
return `Reasoning effort "${effort}" is not supported by ${model ?? "the default model"}. Choose a supported level.`;
|
|
1031
1031
|
}
|
|
1032
1032
|
|
|
1033
|
+
const UNEXPECTED_STATUS = /^unexpected status (\d{3}) ([^:]*?):\s*([\s\S]*?)(?:,\s*url:\s*(\S+))?$/;
|
|
1033
1034
|
function readableCodexErrorText(text) {
|
|
1034
1035
|
const trimmed = text.trim();
|
|
1035
|
-
|
|
1036
|
+
const status = UNEXPECTED_STATUS.exec(trimmed);
|
|
1037
|
+
if (status) {
|
|
1038
|
+
const [, code, reason, rawBody, url] = status;
|
|
1039
|
+
const head = `HTTP ${code} ${reason.trim()} from the model API`;
|
|
1040
|
+
const detail = readableHttpBody(rawBody, `${code} ${reason}`);
|
|
1041
|
+
return `${head}${detail ? `: ${detail}` : ""}${url ? ` (${url})` : ""}`;
|
|
1042
|
+
}
|
|
1043
|
+
return unwrapJsonMessage(trimmed) ?? trimmed;
|
|
1044
|
+
}
|
|
1045
|
+
function unwrapJsonMessage(text) {
|
|
1046
|
+
if (!text.startsWith("{")) return null;
|
|
1036
1047
|
try {
|
|
1037
|
-
const body = JSON.parse(
|
|
1048
|
+
const body = JSON.parse(text);
|
|
1038
1049
|
const inner = typeof body.error === "object" && body.error ? body.error.message : void 0;
|
|
1039
1050
|
const message = typeof inner === "string" && inner.trim() ? inner : typeof body.error === "string" && body.error.trim() ? body.error : typeof body.message === "string" && body.message.trim() ? body.message : null;
|
|
1040
|
-
return message ? message.trim() :
|
|
1051
|
+
return message ? message.trim() : null;
|
|
1041
1052
|
} catch {
|
|
1042
|
-
return
|
|
1053
|
+
return null;
|
|
1043
1054
|
}
|
|
1044
1055
|
}
|
|
1056
|
+
function readableHttpBody(raw, statusLine) {
|
|
1057
|
+
let body = unwrapJsonMessage(raw.trim()) ?? raw.trim();
|
|
1058
|
+
if (/<[a-z!/][^>]*>/i.test(body)) {
|
|
1059
|
+
const title = /<title[^>]*>([\s\S]*?)<\/title>/i.exec(body);
|
|
1060
|
+
body = title ? title[1] : body.replace(/<[^>]+>/g, " ");
|
|
1061
|
+
}
|
|
1062
|
+
body = body.replace(/\s+/g, " ").trim();
|
|
1063
|
+
if (!body) return null;
|
|
1064
|
+
const normalize = (value) => value.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
1065
|
+
if (normalize(body) === normalize(statusLine)) return null;
|
|
1066
|
+
return body.length > 240 ? `${body.slice(0, 240)}\u2026` : body;
|
|
1067
|
+
}
|
|
1045
1068
|
function describeCodexFailure(msg) {
|
|
1046
1069
|
const hasFailure = msg?.status === "failed" || msg?.error !== void 0 && msg?.error !== null;
|
|
1047
1070
|
if (!hasFailure) return null;
|
|
@@ -1052,6 +1075,12 @@ function describeCodexFailure(msg) {
|
|
|
1052
1075
|
}
|
|
1053
1076
|
return "Unknown error";
|
|
1054
1077
|
}
|
|
1078
|
+
function describeCodexRetry(msg) {
|
|
1079
|
+
const message = typeof msg?.message === "string" ? msg.message.trim() : "";
|
|
1080
|
+
const status = typeof msg?.http_status === "number" ? msg.http_status : null;
|
|
1081
|
+
const cause = status ? `HTTP ${status} from the model API` : "a model API error";
|
|
1082
|
+
return message ? `Codex is retrying after ${cause} (${message})` : `Codex is retrying after ${cause}`;
|
|
1083
|
+
}
|
|
1055
1084
|
const TRANSPORT_LOSS = /^Codex process (exited|disconnected)\b|stdin not writable| timed out after \d+ms/;
|
|
1056
1085
|
function describeThrownTurnError(error) {
|
|
1057
1086
|
const message = error instanceof Error ? error.message : typeof error === "string" ? error : "";
|
|
@@ -1743,6 +1772,10 @@ async function runCodex(opts) {
|
|
|
1743
1772
|
} else {
|
|
1744
1773
|
messageBuffer$1.addMessage("Turn aborted", "status");
|
|
1745
1774
|
}
|
|
1775
|
+
} else if (msg.type === "turn_retry") {
|
|
1776
|
+
const notice = describeCodexRetry(msg);
|
|
1777
|
+
messageBuffer$1.addMessage(notice, "status");
|
|
1778
|
+
session.sendSessionEvent({ type: "message", message: notice });
|
|
1746
1779
|
}
|
|
1747
1780
|
if (msg.type === "task_started") {
|
|
1748
1781
|
if (!thinking) {
|
|
@@ -1957,6 +1990,10 @@ async function runCodex(opts) {
|
|
|
1957
1990
|
if (!message) {
|
|
1958
1991
|
break;
|
|
1959
1992
|
}
|
|
1993
|
+
if (!thinking) {
|
|
1994
|
+
thinking = true;
|
|
1995
|
+
session.keepAlive(thinking, "remote");
|
|
1996
|
+
}
|
|
1960
1997
|
idleRelease.cancel();
|
|
1961
1998
|
turnActive = true;
|
|
1962
1999
|
if (isCodexClearText(message.message)) {
|
|
@@ -4,15 +4,15 @@ var fs = require('fs');
|
|
|
4
4
|
var path = require('path');
|
|
5
5
|
var os = require('os');
|
|
6
6
|
var child_process = require('child_process');
|
|
7
|
-
var logger = require('./logger-
|
|
7
|
+
var logger = require('./logger-XjIS0lU7.cjs');
|
|
8
8
|
var constants = require('./constants-VJ0N6WuG.cjs');
|
|
9
9
|
require('chalk');
|
|
10
10
|
require('node:util');
|
|
11
|
-
require('./configuration-
|
|
11
|
+
require('./configuration-Btwt68O2.cjs');
|
|
12
12
|
require('node:fs');
|
|
13
13
|
require('node:os');
|
|
14
14
|
require('node:path');
|
|
15
|
-
require('./package-
|
|
15
|
+
require('./package-DFQUF2in.cjs');
|
|
16
16
|
require('node:fs/promises');
|
|
17
17
|
require('./trimIdent-4gvk9Wk6.cjs');
|
|
18
18
|
|
|
@@ -2,15 +2,15 @@ import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
|
|
|
2
2
|
import { join } from 'path';
|
|
3
3
|
import { homedir } from 'os';
|
|
4
4
|
import { execSync } from 'child_process';
|
|
5
|
-
import { l as logger } from './logger-
|
|
5
|
+
import { l as logger } from './logger-CUxbqfrp.mjs';
|
|
6
6
|
import { D as DEFAULT_GEMINI_MODEL, G as GEMINI_MODEL_ENV } from './constants-BC4St0xd.mjs';
|
|
7
7
|
import 'chalk';
|
|
8
8
|
import 'node:util';
|
|
9
|
-
import './configuration-
|
|
9
|
+
import './configuration-zOfO2qdB.mjs';
|
|
10
10
|
import 'node:fs';
|
|
11
11
|
import 'node:os';
|
|
12
12
|
import 'node:path';
|
|
13
|
-
import './package-
|
|
13
|
+
import './package-DkI3yDe0.mjs';
|
|
14
14
|
import 'node:fs/promises';
|
|
15
15
|
import './trimIdent-BAjmv_TG.mjs';
|
|
16
16
|
|