@sapienx/agentos 0.4.5 → 0.4.7

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.
Files changed (233) hide show
  1. package/bundle/.next/BUILD_ID +1 -1
  2. package/bundle/.next/app-path-routes-manifest.json +15 -11
  3. package/bundle/.next/build-manifest.json +3 -3
  4. package/bundle/.next/prerender-manifest.json +3 -3
  5. package/bundle/.next/react-loadable-manifest.json +3 -3
  6. package/bundle/.next/routes-manifest.json +28 -0
  7. package/bundle/.next/server/app/_global-error/page.js +3 -3
  8. package/bundle/.next/server/app/_global-error/page.js.nft.json +1 -1
  9. package/bundle/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/bundle/.next/server/app/_global-error.html +1 -1
  11. package/bundle/.next/server/app/_global-error.rsc +1 -1
  12. package/bundle/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/bundle/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  14. package/bundle/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  15. package/bundle/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  16. package/bundle/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  17. package/bundle/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  18. package/bundle/.next/server/app/_not-found/page.js +2 -2
  19. package/bundle/.next/server/app/_not-found/page.js.nft.json +1 -1
  20. package/bundle/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  21. package/bundle/.next/server/app/_not-found.html +1 -1
  22. package/bundle/.next/server/app/_not-found.rsc +2 -2
  23. package/bundle/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  24. package/bundle/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  25. package/bundle/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  26. package/bundle/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  27. package/bundle/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  28. package/bundle/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  29. package/bundle/.next/server/app/api/agents/[agentId]/chat/route.js +5 -5
  30. package/bundle/.next/server/app/api/agents/[agentId]/chat/route.js.nft.json +1 -1
  31. package/bundle/.next/server/app/api/agents/route.js +1 -1
  32. package/bundle/.next/server/app/api/agents/route.js.nft.json +1 -1
  33. package/bundle/.next/server/app/api/diagnostics/route.js +1 -1
  34. package/bundle/.next/server/app/api/diagnostics/route.js.nft.json +1 -1
  35. package/bundle/.next/server/app/api/files/reveal/route.js +1 -1
  36. package/bundle/.next/server/app/api/files/reveal/route.js.nft.json +1 -1
  37. package/bundle/.next/server/app/api/gateway/control/route.js +1 -1
  38. package/bundle/.next/server/app/api/gateway/control/route.js.nft.json +1 -1
  39. package/bundle/.next/server/app/api/mission/route.js +1 -1
  40. package/bundle/.next/server/app/api/mission/route.js.nft.json +1 -1
  41. package/bundle/.next/server/app/api/models/catalog/route.js +2 -1
  42. package/bundle/.next/server/app/api/models/catalog/route.js.nft.json +1 -1
  43. package/bundle/.next/server/app/api/models/providers/route.js +2 -2
  44. package/bundle/.next/server/app/api/models/providers/route.js.nft.json +1 -1
  45. package/bundle/.next/server/app/api/onboarding/models/route.js +10 -7
  46. package/bundle/.next/server/app/api/onboarding/models/route.js.nft.json +1 -1
  47. package/bundle/.next/server/app/api/onboarding/route.js +8 -8
  48. package/bundle/.next/server/app/api/onboarding/route.js.nft.json +1 -1
  49. package/bundle/.next/server/app/api/openclaw/capabilities/route.js +1 -3
  50. package/bundle/.next/server/app/api/openclaw/capabilities/route.js.nft.json +1 -1
  51. package/bundle/.next/server/app/api/planner/[planId]/deploy/route.js +2 -2
  52. package/bundle/.next/server/app/api/planner/[planId]/deploy/route.js.nft.json +1 -1
  53. package/bundle/.next/server/app/api/planner/[planId]/document-rewrite/route.js +1 -1
  54. package/bundle/.next/server/app/api/planner/[planId]/document-rewrite/route.js.nft.json +1 -1
  55. package/bundle/.next/server/app/api/planner/[planId]/route.js +1 -1
  56. package/bundle/.next/server/app/api/planner/[planId]/route.js.nft.json +1 -1
  57. package/bundle/.next/server/app/api/planner/[planId]/simulate/route.js +1 -1
  58. package/bundle/.next/server/app/api/planner/[planId]/simulate/route.js.nft.json +1 -1
  59. package/bundle/.next/server/app/api/planner/[planId]/turn/route.js +1 -1
  60. package/bundle/.next/server/app/api/planner/[planId]/turn/route.js.nft.json +1 -1
  61. package/bundle/.next/server/app/api/planner/route.js +1 -1
  62. package/bundle/.next/server/app/api/planner/route.js.nft.json +1 -1
  63. package/bundle/.next/server/app/api/reset/route.js +3 -3
  64. package/bundle/.next/server/app/api/reset/route.js.nft.json +1 -1
  65. package/bundle/.next/server/app/api/runtimes/[runtimeId]/route.js +1 -1
  66. package/bundle/.next/server/app/api/runtimes/[runtimeId]/route.js.nft.json +1 -1
  67. package/bundle/.next/server/app/api/settings/gateway/route.js +1 -1
  68. package/bundle/.next/server/app/api/settings/gateway/route.js.nft.json +1 -1
  69. package/bundle/.next/server/app/api/settings/openclaw-binary/route.js +1 -0
  70. package/bundle/.next/server/app/api/settings/openclaw-binary/route.js.nft.json +1 -0
  71. package/bundle/.next/server/app/api/settings/openclaw-binary/route_client-reference-manifest.js +1 -0
  72. package/bundle/.next/server/app/api/settings/workspace-root/route.js +1 -1
  73. package/bundle/.next/server/app/api/settings/workspace-root/route.js.nft.json +1 -1
  74. package/bundle/.next/server/app/api/snapshot/route.js +1 -1
  75. package/bundle/.next/server/app/api/snapshot/route.js.nft.json +1 -1
  76. package/bundle/.next/server/app/api/stream/route.js +3 -3
  77. package/bundle/.next/server/app/api/stream/route.js.nft.json +1 -1
  78. package/bundle/.next/server/app/api/system/open-terminal/route.js +1 -1
  79. package/bundle/.next/server/app/api/system/open-terminal/route.js.nft.json +1 -1
  80. package/bundle/.next/server/app/api/tasks/[taskId]/abort/route.js +1 -1
  81. package/bundle/.next/server/app/api/tasks/[taskId]/abort/route.js.nft.json +1 -1
  82. package/bundle/.next/server/app/api/tasks/[taskId]/control/route.js +1 -0
  83. package/bundle/.next/server/app/api/tasks/[taskId]/control/route.js.nft.json +1 -0
  84. package/bundle/.next/server/app/api/tasks/[taskId]/control/route_client-reference-manifest.js +1 -0
  85. package/bundle/.next/server/app/api/tasks/[taskId]/stream/route.js +3 -3
  86. package/bundle/.next/server/app/api/tasks/[taskId]/stream/route.js.nft.json +1 -1
  87. package/bundle/.next/server/app/api/update/route.js +7 -4
  88. package/bundle/.next/server/app/api/update/route.js.nft.json +1 -1
  89. package/bundle/.next/server/app/api/workspaces/[workspaceId]/channels/discovered-groups/route.js +1 -1
  90. package/bundle/.next/server/app/api/workspaces/[workspaceId]/channels/discovered-groups/route.js.nft.json +1 -1
  91. package/bundle/.next/server/app/api/workspaces/[workspaceId]/channels/route.js +1 -1
  92. package/bundle/.next/server/app/api/workspaces/[workspaceId]/channels/route.js.nft.json +1 -1
  93. package/bundle/.next/server/app/api/workspaces/[workspaceId]/edit-draft/route.js +1 -1
  94. package/bundle/.next/server/app/api/workspaces/[workspaceId]/edit-draft/route.js.nft.json +1 -1
  95. package/bundle/.next/server/app/api/workspaces/[workspaceId]/files/route.js +1 -0
  96. package/bundle/.next/server/app/api/workspaces/[workspaceId]/files/route.js.nft.json +1 -0
  97. package/bundle/.next/server/app/api/workspaces/[workspaceId]/files/route_client-reference-manifest.js +1 -0
  98. package/bundle/.next/server/app/api/workspaces/[workspaceId]/surfaces/discovery/route.js +1 -1
  99. package/bundle/.next/server/app/api/workspaces/[workspaceId]/surfaces/discovery/route.js.nft.json +1 -1
  100. package/bundle/.next/server/app/api/workspaces/route.js +2 -2
  101. package/bundle/.next/server/app/api/workspaces/route.js.nft.json +1 -1
  102. package/bundle/.next/server/app/page.js +2 -194
  103. package/bundle/.next/server/app/page.js.nft.json +1 -1
  104. package/bundle/.next/server/app/page_client-reference-manifest.js +1 -1
  105. package/bundle/.next/server/app/settings/page.js +2 -0
  106. package/bundle/.next/server/app/settings/page.js.nft.json +1 -0
  107. package/bundle/.next/server/app/settings/page_client-reference-manifest.js +1 -0
  108. package/bundle/.next/server/app-paths-manifest.json +15 -11
  109. package/bundle/.next/server/chunks/3816.js +280 -0
  110. package/bundle/.next/server/chunks/408.js +10 -10
  111. package/bundle/.next/server/chunks/5151.js +173 -0
  112. package/bundle/.next/server/chunks/5678.js +1 -0
  113. package/bundle/.next/server/chunks/6035.js +45 -0
  114. package/bundle/.next/server/chunks/6639.js +11 -0
  115. package/bundle/.next/server/chunks/7125.js +188 -0
  116. package/bundle/.next/server/chunks/7639.js +98 -0
  117. package/bundle/.next/server/chunks/7661.js +1 -0
  118. package/bundle/.next/server/chunks/7825.js +1 -0
  119. package/bundle/.next/server/chunks/8155.js +15 -0
  120. package/bundle/.next/server/chunks/9663.js +2 -0
  121. package/bundle/.next/server/functions-config-manifest.json +12 -0
  122. package/bundle/.next/server/middleware-build-manifest.js +1 -1
  123. package/bundle/.next/server/middleware-react-loadable-manifest.js +1 -1
  124. package/bundle/.next/server/middleware.js +18 -0
  125. package/bundle/.next/server/pages/404.html +1 -1
  126. package/bundle/.next/server/pages/500.html +1 -1
  127. package/bundle/.next/server/server-reference-manifest.json +1 -1
  128. package/bundle/.next/server/webpack-runtime.js +1 -1
  129. package/bundle/.next/static/chunks/1994.af8e615920391b12.js +1 -0
  130. package/bundle/.next/static/chunks/2798.05bb8e435bca457c.js +1 -0
  131. package/bundle/.next/static/chunks/3254-31132332d1368b3c.js +15 -0
  132. package/bundle/.next/static/chunks/7442-edd29c3664c12f82.js +188 -0
  133. package/bundle/.next/static/chunks/app/_global-error/page-a39fe5a18111b91d.js +1 -0
  134. package/bundle/.next/static/chunks/app/_not-found/page-a39fe5a18111b91d.js +1 -0
  135. package/bundle/.next/static/chunks/app/api/agents/[agentId]/chat/route-a39fe5a18111b91d.js +1 -0
  136. package/bundle/.next/static/chunks/app/api/agents/route-a39fe5a18111b91d.js +1 -0
  137. package/bundle/.next/static/chunks/app/api/diagnostics/route-a39fe5a18111b91d.js +1 -0
  138. package/bundle/.next/static/chunks/app/api/files/reveal/route-a39fe5a18111b91d.js +1 -0
  139. package/bundle/.next/static/chunks/app/api/gateway/control/route-a39fe5a18111b91d.js +1 -0
  140. package/bundle/.next/static/chunks/app/api/mission/route-a39fe5a18111b91d.js +1 -0
  141. package/bundle/.next/static/chunks/app/api/models/catalog/route-a39fe5a18111b91d.js +1 -0
  142. package/bundle/.next/static/chunks/app/api/models/providers/route-a39fe5a18111b91d.js +1 -0
  143. package/bundle/.next/static/chunks/app/api/onboarding/models/route-a39fe5a18111b91d.js +1 -0
  144. package/bundle/.next/static/chunks/app/api/onboarding/route-a39fe5a18111b91d.js +1 -0
  145. package/bundle/.next/static/chunks/app/api/openclaw/capabilities/route-a39fe5a18111b91d.js +1 -0
  146. package/bundle/.next/static/chunks/app/api/planner/[planId]/deploy/route-a39fe5a18111b91d.js +1 -0
  147. package/bundle/.next/static/chunks/app/api/planner/[planId]/document-rewrite/route-a39fe5a18111b91d.js +1 -0
  148. package/bundle/.next/static/chunks/app/api/planner/[planId]/route-a39fe5a18111b91d.js +1 -0
  149. package/bundle/.next/static/chunks/app/api/planner/[planId]/simulate/route-a39fe5a18111b91d.js +1 -0
  150. package/bundle/.next/static/chunks/app/api/planner/[planId]/turn/route-a39fe5a18111b91d.js +1 -0
  151. package/bundle/.next/static/chunks/app/api/planner/route-a39fe5a18111b91d.js +1 -0
  152. package/bundle/.next/static/chunks/app/api/reset/route-a39fe5a18111b91d.js +1 -0
  153. package/bundle/.next/static/chunks/app/api/runtimes/[runtimeId]/route-a39fe5a18111b91d.js +1 -0
  154. package/bundle/.next/static/chunks/app/api/settings/gateway/route-a39fe5a18111b91d.js +1 -0
  155. package/bundle/.next/static/chunks/app/api/settings/openclaw-binary/route-a39fe5a18111b91d.js +1 -0
  156. package/bundle/.next/static/chunks/app/api/settings/workspace-root/route-a39fe5a18111b91d.js +1 -0
  157. package/bundle/.next/static/chunks/app/api/snapshot/route-a39fe5a18111b91d.js +1 -0
  158. package/bundle/.next/static/chunks/app/api/stream/route-a39fe5a18111b91d.js +1 -0
  159. package/bundle/.next/static/chunks/app/api/system/open-terminal/route-a39fe5a18111b91d.js +1 -0
  160. package/bundle/.next/static/chunks/app/api/tasks/[taskId]/abort/route-a39fe5a18111b91d.js +1 -0
  161. package/bundle/.next/static/chunks/app/api/tasks/[taskId]/control/route-a39fe5a18111b91d.js +1 -0
  162. package/bundle/.next/static/chunks/app/api/tasks/[taskId]/stream/route-a39fe5a18111b91d.js +1 -0
  163. package/bundle/.next/static/chunks/app/api/update/route-a39fe5a18111b91d.js +1 -0
  164. package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/channels/discovered-groups/route-a39fe5a18111b91d.js +1 -0
  165. package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/channels/route-a39fe5a18111b91d.js +1 -0
  166. package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/edit-draft/route-a39fe5a18111b91d.js +1 -0
  167. package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/files/route-a39fe5a18111b91d.js +1 -0
  168. package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/surfaces/discovery/route-a39fe5a18111b91d.js +1 -0
  169. package/bundle/.next/static/chunks/app/api/workspaces/route-a39fe5a18111b91d.js +1 -0
  170. package/bundle/.next/static/chunks/app/not-found-a39fe5a18111b91d.js +1 -0
  171. package/bundle/.next/static/chunks/app/page-9bd535a80e3968e2.js +1 -0
  172. package/bundle/.next/static/chunks/app/settings/page-3794e22c77091d4b.js +1 -0
  173. package/bundle/.next/static/chunks/{main-eb49e7f5b314b5dc.js → main-2c126219b824eed3.js} +1 -1
  174. package/bundle/.next/static/chunks/next/dist/client/components/builtin/app-error-a39fe5a18111b91d.js +1 -0
  175. package/bundle/.next/static/chunks/next/dist/client/components/builtin/forbidden-a39fe5a18111b91d.js +1 -0
  176. package/bundle/.next/static/chunks/next/dist/client/components/builtin/unauthorized-a39fe5a18111b91d.js +1 -0
  177. package/bundle/.next/static/chunks/{webpack-be44493d75a62d03.js → webpack-49728cc9bb386219.js} +1 -1
  178. package/bundle/.next/static/css/91a0269a0b865189.css +3 -0
  179. package/bundle/.next/static/iPRBqdKl76C39456l6e-i/_buildManifest.js +1 -0
  180. package/bundle/package.json +7 -3
  181. package/bundle/scripts/openclaw-mission-dispatch-runner.mjs +103 -2
  182. package/package.json +4 -2
  183. package/bundle/.next/server/chunks/199.js +0 -412
  184. package/bundle/.next/server/chunks/35.js +0 -45
  185. package/bundle/.next/server/chunks/639.js +0 -98
  186. package/bundle/.next/server/chunks/661.js +0 -1
  187. package/bundle/.next/server/chunks/678.js +0 -1
  188. package/bundle/.next/server/chunks/825.js +0 -1
  189. package/bundle/.next/static/-Hi163pOppz8WaePTrAsR/_buildManifest.js +0 -1
  190. package/bundle/.next/static/chunks/2999.fef298fbe30cd4bd.js +0 -1
  191. package/bundle/.next/static/chunks/5261.80260874ddbc586a.js +0 -1
  192. package/bundle/.next/static/chunks/7963-6bd42810c5733ae8.js +0 -15
  193. package/bundle/.next/static/chunks/app/_global-error/page-cde9c645dcfceb9f.js +0 -1
  194. package/bundle/.next/static/chunks/app/_not-found/page-cde9c645dcfceb9f.js +0 -1
  195. package/bundle/.next/static/chunks/app/api/agents/[agentId]/chat/route-cde9c645dcfceb9f.js +0 -1
  196. package/bundle/.next/static/chunks/app/api/agents/route-cde9c645dcfceb9f.js +0 -1
  197. package/bundle/.next/static/chunks/app/api/diagnostics/route-cde9c645dcfceb9f.js +0 -1
  198. package/bundle/.next/static/chunks/app/api/files/reveal/route-cde9c645dcfceb9f.js +0 -1
  199. package/bundle/.next/static/chunks/app/api/gateway/control/route-cde9c645dcfceb9f.js +0 -1
  200. package/bundle/.next/static/chunks/app/api/mission/route-cde9c645dcfceb9f.js +0 -1
  201. package/bundle/.next/static/chunks/app/api/models/catalog/route-cde9c645dcfceb9f.js +0 -1
  202. package/bundle/.next/static/chunks/app/api/models/providers/route-cde9c645dcfceb9f.js +0 -1
  203. package/bundle/.next/static/chunks/app/api/onboarding/models/route-cde9c645dcfceb9f.js +0 -1
  204. package/bundle/.next/static/chunks/app/api/onboarding/route-cde9c645dcfceb9f.js +0 -1
  205. package/bundle/.next/static/chunks/app/api/openclaw/capabilities/route-cde9c645dcfceb9f.js +0 -1
  206. package/bundle/.next/static/chunks/app/api/planner/[planId]/deploy/route-cde9c645dcfceb9f.js +0 -1
  207. package/bundle/.next/static/chunks/app/api/planner/[planId]/document-rewrite/route-cde9c645dcfceb9f.js +0 -1
  208. package/bundle/.next/static/chunks/app/api/planner/[planId]/route-cde9c645dcfceb9f.js +0 -1
  209. package/bundle/.next/static/chunks/app/api/planner/[planId]/simulate/route-cde9c645dcfceb9f.js +0 -1
  210. package/bundle/.next/static/chunks/app/api/planner/[planId]/turn/route-cde9c645dcfceb9f.js +0 -1
  211. package/bundle/.next/static/chunks/app/api/planner/route-cde9c645dcfceb9f.js +0 -1
  212. package/bundle/.next/static/chunks/app/api/reset/route-cde9c645dcfceb9f.js +0 -1
  213. package/bundle/.next/static/chunks/app/api/runtimes/[runtimeId]/route-cde9c645dcfceb9f.js +0 -1
  214. package/bundle/.next/static/chunks/app/api/settings/gateway/route-cde9c645dcfceb9f.js +0 -1
  215. package/bundle/.next/static/chunks/app/api/settings/workspace-root/route-cde9c645dcfceb9f.js +0 -1
  216. package/bundle/.next/static/chunks/app/api/snapshot/route-cde9c645dcfceb9f.js +0 -1
  217. package/bundle/.next/static/chunks/app/api/stream/route-cde9c645dcfceb9f.js +0 -1
  218. package/bundle/.next/static/chunks/app/api/system/open-terminal/route-cde9c645dcfceb9f.js +0 -1
  219. package/bundle/.next/static/chunks/app/api/tasks/[taskId]/abort/route-cde9c645dcfceb9f.js +0 -1
  220. package/bundle/.next/static/chunks/app/api/tasks/[taskId]/stream/route-cde9c645dcfceb9f.js +0 -1
  221. package/bundle/.next/static/chunks/app/api/update/route-cde9c645dcfceb9f.js +0 -1
  222. package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/channels/discovered-groups/route-cde9c645dcfceb9f.js +0 -1
  223. package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/channels/route-cde9c645dcfceb9f.js +0 -1
  224. package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/edit-draft/route-cde9c645dcfceb9f.js +0 -1
  225. package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/surfaces/discovery/route-cde9c645dcfceb9f.js +0 -1
  226. package/bundle/.next/static/chunks/app/api/workspaces/route-cde9c645dcfceb9f.js +0 -1
  227. package/bundle/.next/static/chunks/app/not-found-cde9c645dcfceb9f.js +0 -1
  228. package/bundle/.next/static/chunks/app/page-5de22cbc4ffb588d.js +0 -179
  229. package/bundle/.next/static/chunks/next/dist/client/components/builtin/app-error-cde9c645dcfceb9f.js +0 -1
  230. package/bundle/.next/static/chunks/next/dist/client/components/builtin/forbidden-cde9c645dcfceb9f.js +0 -1
  231. package/bundle/.next/static/chunks/next/dist/client/components/builtin/unauthorized-cde9c645dcfceb9f.js +0 -1
  232. package/bundle/.next/static/css/0633750bbe1c3acc.css +0 -3
  233. /package/bundle/.next/static/{-Hi163pOppz8WaePTrAsR → iPRBqdKl76C39456l6e-i}/_ssgManifest.js +0 -0
@@ -6,6 +6,9 @@ import path from "node:path";
6
6
 
7
7
  const recordPath = process.argv[2];
8
8
  const heartbeatIntervalMs = 15_000;
9
+ const defaultAgentTimeoutSeconds = 45;
10
+ const agentTimeoutGraceMs = 15_000;
11
+ const agentForceKillGraceMs = 2_000;
9
12
  const runnerDiagnosticJsonKeys = new Set([
10
13
  "cause",
11
14
  "code",
@@ -31,6 +34,7 @@ async function main() {
31
34
  }
32
35
 
33
36
  const openClawBin = process.env.OPENCLAW_BIN || "openclaw";
37
+ const timeoutSeconds = resolveAgentTimeoutSeconds(record);
34
38
  const startedAt = new Date().toISOString();
35
39
  const sessionId = typeof record.sessionId === "string" && record.sessionId.trim() ? record.sessionId.trim() : null;
36
40
  const runnerLogPath = resolveRunnerLogPath(record);
@@ -48,7 +52,8 @@ async function main() {
48
52
  pid: process.pid,
49
53
  startedAt,
50
54
  lastHeartbeatAt: startedAt,
51
- logPath: runnerLogPath
55
+ logPath: runnerLogPath,
56
+ timeoutSeconds
52
57
  }
53
58
  }));
54
59
  await enqueueRunnerStatus(
@@ -68,6 +73,8 @@ async function main() {
68
73
  record.routedMission,
69
74
  "--thinking",
70
75
  typeof record.thinking === "string" ? record.thinking : "medium",
76
+ "--timeout",
77
+ String(timeoutSeconds),
71
78
  "--json"
72
79
  ],
73
80
  {
@@ -80,7 +87,10 @@ async function main() {
80
87
  let stdout = "";
81
88
  let stderr = "";
82
89
  let settled = false;
90
+ let timedOut = false;
91
+ let childClosed = false;
83
92
  let heartbeat = null;
93
+ let watchdog = null;
84
94
 
85
95
  await mutateRecord((latest) => ({
86
96
  ...latest,
@@ -90,7 +100,8 @@ async function main() {
90
100
  childPid: child.pid ?? latest.runner?.childPid ?? null,
91
101
  startedAt: latest.runner?.startedAt || startedAt,
92
102
  lastHeartbeatAt: startedAt,
93
- logPath: latest.runner?.logPath || runnerLogPath
103
+ logPath: latest.runner?.logPath || runnerLogPath,
104
+ timeoutSeconds
94
105
  }
95
106
  }));
96
107
  await enqueueRunnerStatus(
@@ -113,6 +124,9 @@ async function main() {
113
124
  heartbeat = setInterval(() => {
114
125
  void tickHeartbeat();
115
126
  }, heartbeatIntervalMs);
127
+ watchdog = setTimeout(() => {
128
+ void timeoutOpenClawAgentProcess();
129
+ }, timeoutSeconds * 1000 + agentTimeoutGraceMs);
116
130
 
117
131
  child.stdout.on("data", (chunk) => {
118
132
  const text = chunk.toString();
@@ -136,7 +150,12 @@ async function main() {
136
150
  });
137
151
 
138
152
  child.on("close", (code) => {
153
+ childClosed = true;
139
154
  void (async () => {
155
+ if (timedOut) {
156
+ return;
157
+ }
158
+
140
159
  await flushBufferedRunnerOutput();
141
160
  const current = await readRecord();
142
161
 
@@ -213,6 +232,7 @@ async function main() {
213
232
 
214
233
  settled = true;
215
234
  clearInterval(heartbeat);
235
+ clearTimeout(watchdog);
216
236
  await flushBufferedRunnerOutput();
217
237
  const finishedAt = new Date().toISOString();
218
238
 
@@ -236,6 +256,69 @@ async function main() {
236
256
  process.exit(0);
237
257
  }
238
258
 
259
+ async function timeoutOpenClawAgentProcess() {
260
+ if (settled) {
261
+ return;
262
+ }
263
+
264
+ timedOut = true;
265
+ await enqueueRunnerStatus(`OpenClaw agent process exceeded ${timeoutSeconds}s timeout. Terminating fallback process.`);
266
+ await stopChildProcessForTimeout();
267
+ void finalize({
268
+ status: "stalled",
269
+ result: tryParseMissionPayload(stdout || stderr),
270
+ error: `OpenClaw mission timed out after ${timeoutSeconds} seconds.`
271
+ });
272
+ }
273
+
274
+ async function stopChildProcessForTimeout() {
275
+ if (childClosed) {
276
+ return;
277
+ }
278
+
279
+ try {
280
+ child.kill("SIGTERM");
281
+ } catch {}
282
+
283
+ if (await waitForChildClose(agentForceKillGraceMs)) {
284
+ return;
285
+ }
286
+
287
+ try {
288
+ child.kill("SIGKILL");
289
+ } catch {}
290
+
291
+ await waitForChildClose(500);
292
+ }
293
+
294
+ async function waitForChildClose(timeoutMs) {
295
+ if (childClosed) {
296
+ return true;
297
+ }
298
+
299
+ return await new Promise((resolve) => {
300
+ let resolved = false;
301
+ const timer = setTimeout(() => {
302
+ if (resolved) {
303
+ return;
304
+ }
305
+ resolved = true;
306
+ child.off("close", onClose);
307
+ resolve(false);
308
+ }, timeoutMs);
309
+ const onClose = () => {
310
+ if (resolved) {
311
+ return;
312
+ }
313
+ resolved = true;
314
+ clearTimeout(timer);
315
+ childClosed = true;
316
+ resolve(true);
317
+ };
318
+ child.once("close", onClose);
319
+ });
320
+ }
321
+
239
322
  function enqueueRunnerStatus(text) {
240
323
  return enqueueRunnerLog("status", text);
241
324
  }
@@ -341,6 +424,24 @@ function resolveRunnerLogPath(record) {
341
424
  return typeof existingPath === "string" && existingPath.trim() ? existingPath.trim() : `${recordPath}.log.jsonl`;
342
425
  }
343
426
 
427
+ function resolveAgentTimeoutSeconds(record) {
428
+ const candidates = [
429
+ record?.timeoutSeconds,
430
+ record?.runner?.timeoutSeconds,
431
+ process.env.OPENCLAW_AGENT_TIMEOUT_SECONDS,
432
+ process.env.AGENTOS_OPENCLAW_AGENT_TIMEOUT_SECONDS
433
+ ];
434
+
435
+ for (const candidate of candidates) {
436
+ const value = Number(candidate);
437
+ if (Number.isFinite(value) && value > 0) {
438
+ return Math.min(3600, Math.max(1, Math.floor(value)));
439
+ }
440
+ }
441
+
442
+ return defaultAgentTimeoutSeconds;
443
+ }
444
+
344
445
  function normalizeRunnerLogText(value) {
345
446
  return String(value || "")
346
447
  .replace(/\u0000/g, "")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapienx/agentos",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "AgentOS control plane launcher",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -13,8 +13,10 @@
13
13
  "bundle"
14
14
  ],
15
15
  "scripts": {
16
+ "check:release": "node scripts/check-release-consistency.mjs",
16
17
  "prepare:bundle": "node scripts/prepare-bundle.mjs",
17
- "prepack": "node scripts/run-prepack.mjs"
18
+ "prepack": "node scripts/check-release-consistency.mjs && node scripts/run-prepack.mjs",
19
+ "prepublishOnly": "node scripts/check-release-consistency.mjs"
18
20
  },
19
21
  "keywords": [
20
22
  "agentos",