@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.
- package/bundle/.next/BUILD_ID +1 -1
- package/bundle/.next/app-path-routes-manifest.json +15 -11
- package/bundle/.next/build-manifest.json +3 -3
- package/bundle/.next/prerender-manifest.json +3 -3
- package/bundle/.next/react-loadable-manifest.json +3 -3
- package/bundle/.next/routes-manifest.json +28 -0
- package/bundle/.next/server/app/_global-error/page.js +3 -3
- package/bundle/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/bundle/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/bundle/.next/server/app/_global-error.html +1 -1
- package/bundle/.next/server/app/_global-error.rsc +1 -1
- package/bundle/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/bundle/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/bundle/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/bundle/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/bundle/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/bundle/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/bundle/.next/server/app/_not-found/page.js +2 -2
- package/bundle/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/bundle/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/bundle/.next/server/app/_not-found.html +1 -1
- package/bundle/.next/server/app/_not-found.rsc +2 -2
- package/bundle/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/bundle/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/bundle/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/bundle/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/bundle/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/bundle/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/bundle/.next/server/app/api/agents/[agentId]/chat/route.js +5 -5
- package/bundle/.next/server/app/api/agents/[agentId]/chat/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/agents/route.js +1 -1
- package/bundle/.next/server/app/api/agents/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/diagnostics/route.js +1 -1
- package/bundle/.next/server/app/api/diagnostics/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/files/reveal/route.js +1 -1
- package/bundle/.next/server/app/api/files/reveal/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/gateway/control/route.js +1 -1
- package/bundle/.next/server/app/api/gateway/control/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/mission/route.js +1 -1
- package/bundle/.next/server/app/api/mission/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/models/catalog/route.js +2 -1
- package/bundle/.next/server/app/api/models/catalog/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/models/providers/route.js +2 -2
- package/bundle/.next/server/app/api/models/providers/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/onboarding/models/route.js +10 -7
- package/bundle/.next/server/app/api/onboarding/models/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/onboarding/route.js +8 -8
- package/bundle/.next/server/app/api/onboarding/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/openclaw/capabilities/route.js +1 -3
- package/bundle/.next/server/app/api/openclaw/capabilities/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/deploy/route.js +2 -2
- package/bundle/.next/server/app/api/planner/[planId]/deploy/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/document-rewrite/route.js +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/document-rewrite/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/route.js +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/simulate/route.js +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/simulate/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/turn/route.js +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/turn/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/planner/route.js +1 -1
- package/bundle/.next/server/app/api/planner/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/reset/route.js +3 -3
- package/bundle/.next/server/app/api/reset/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/runtimes/[runtimeId]/route.js +1 -1
- package/bundle/.next/server/app/api/runtimes/[runtimeId]/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/settings/gateway/route.js +1 -1
- package/bundle/.next/server/app/api/settings/gateway/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/settings/openclaw-binary/route.js +1 -0
- package/bundle/.next/server/app/api/settings/openclaw-binary/route.js.nft.json +1 -0
- package/bundle/.next/server/app/api/settings/openclaw-binary/route_client-reference-manifest.js +1 -0
- package/bundle/.next/server/app/api/settings/workspace-root/route.js +1 -1
- package/bundle/.next/server/app/api/settings/workspace-root/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/snapshot/route.js +1 -1
- package/bundle/.next/server/app/api/snapshot/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/stream/route.js +3 -3
- package/bundle/.next/server/app/api/stream/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/system/open-terminal/route.js +1 -1
- package/bundle/.next/server/app/api/system/open-terminal/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/tasks/[taskId]/abort/route.js +1 -1
- package/bundle/.next/server/app/api/tasks/[taskId]/abort/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/tasks/[taskId]/control/route.js +1 -0
- package/bundle/.next/server/app/api/tasks/[taskId]/control/route.js.nft.json +1 -0
- package/bundle/.next/server/app/api/tasks/[taskId]/control/route_client-reference-manifest.js +1 -0
- package/bundle/.next/server/app/api/tasks/[taskId]/stream/route.js +3 -3
- package/bundle/.next/server/app/api/tasks/[taskId]/stream/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/update/route.js +7 -4
- package/bundle/.next/server/app/api/update/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/channels/discovered-groups/route.js +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/channels/discovered-groups/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/channels/route.js +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/channels/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/edit-draft/route.js +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/edit-draft/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/files/route.js +1 -0
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/files/route.js.nft.json +1 -0
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/files/route_client-reference-manifest.js +1 -0
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/surfaces/discovery/route.js +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/surfaces/discovery/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/workspaces/route.js +2 -2
- package/bundle/.next/server/app/api/workspaces/route.js.nft.json +1 -1
- package/bundle/.next/server/app/page.js +2 -194
- package/bundle/.next/server/app/page.js.nft.json +1 -1
- package/bundle/.next/server/app/page_client-reference-manifest.js +1 -1
- package/bundle/.next/server/app/settings/page.js +2 -0
- package/bundle/.next/server/app/settings/page.js.nft.json +1 -0
- package/bundle/.next/server/app/settings/page_client-reference-manifest.js +1 -0
- package/bundle/.next/server/app-paths-manifest.json +15 -11
- package/bundle/.next/server/chunks/3816.js +280 -0
- package/bundle/.next/server/chunks/408.js +10 -10
- package/bundle/.next/server/chunks/5151.js +173 -0
- package/bundle/.next/server/chunks/5678.js +1 -0
- package/bundle/.next/server/chunks/6035.js +45 -0
- package/bundle/.next/server/chunks/6639.js +11 -0
- package/bundle/.next/server/chunks/7125.js +188 -0
- package/bundle/.next/server/chunks/7639.js +98 -0
- package/bundle/.next/server/chunks/7661.js +1 -0
- package/bundle/.next/server/chunks/7825.js +1 -0
- package/bundle/.next/server/chunks/8155.js +15 -0
- package/bundle/.next/server/chunks/9663.js +2 -0
- package/bundle/.next/server/functions-config-manifest.json +12 -0
- package/bundle/.next/server/middleware-build-manifest.js +1 -1
- package/bundle/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/bundle/.next/server/middleware.js +18 -0
- package/bundle/.next/server/pages/404.html +1 -1
- package/bundle/.next/server/pages/500.html +1 -1
- package/bundle/.next/server/server-reference-manifest.json +1 -1
- package/bundle/.next/server/webpack-runtime.js +1 -1
- package/bundle/.next/static/chunks/1994.af8e615920391b12.js +1 -0
- package/bundle/.next/static/chunks/2798.05bb8e435bca457c.js +1 -0
- package/bundle/.next/static/chunks/3254-31132332d1368b3c.js +15 -0
- package/bundle/.next/static/chunks/7442-edd29c3664c12f82.js +188 -0
- package/bundle/.next/static/chunks/app/_global-error/page-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/_not-found/page-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/agents/[agentId]/chat/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/agents/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/diagnostics/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/files/reveal/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/gateway/control/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/mission/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/models/catalog/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/models/providers/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/onboarding/models/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/onboarding/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/openclaw/capabilities/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/planner/[planId]/deploy/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/planner/[planId]/document-rewrite/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/planner/[planId]/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/planner/[planId]/simulate/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/planner/[planId]/turn/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/planner/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/reset/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/runtimes/[runtimeId]/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/settings/gateway/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/settings/openclaw-binary/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/settings/workspace-root/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/snapshot/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/stream/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/system/open-terminal/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/tasks/[taskId]/abort/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/tasks/[taskId]/control/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/tasks/[taskId]/stream/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/update/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/channels/discovered-groups/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/channels/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/edit-draft/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/files/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/surfaces/discovery/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/api/workspaces/route-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/not-found-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/app/page-9bd535a80e3968e2.js +1 -0
- package/bundle/.next/static/chunks/app/settings/page-3794e22c77091d4b.js +1 -0
- package/bundle/.next/static/chunks/{main-eb49e7f5b314b5dc.js → main-2c126219b824eed3.js} +1 -1
- package/bundle/.next/static/chunks/next/dist/client/components/builtin/app-error-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/next/dist/client/components/builtin/forbidden-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/next/dist/client/components/builtin/unauthorized-a39fe5a18111b91d.js +1 -0
- package/bundle/.next/static/chunks/{webpack-be44493d75a62d03.js → webpack-49728cc9bb386219.js} +1 -1
- package/bundle/.next/static/css/91a0269a0b865189.css +3 -0
- package/bundle/.next/static/iPRBqdKl76C39456l6e-i/_buildManifest.js +1 -0
- package/bundle/package.json +7 -3
- package/bundle/scripts/openclaw-mission-dispatch-runner.mjs +103 -2
- package/package.json +4 -2
- package/bundle/.next/server/chunks/199.js +0 -412
- package/bundle/.next/server/chunks/35.js +0 -45
- package/bundle/.next/server/chunks/639.js +0 -98
- package/bundle/.next/server/chunks/661.js +0 -1
- package/bundle/.next/server/chunks/678.js +0 -1
- package/bundle/.next/server/chunks/825.js +0 -1
- package/bundle/.next/static/-Hi163pOppz8WaePTrAsR/_buildManifest.js +0 -1
- package/bundle/.next/static/chunks/2999.fef298fbe30cd4bd.js +0 -1
- package/bundle/.next/static/chunks/5261.80260874ddbc586a.js +0 -1
- package/bundle/.next/static/chunks/7963-6bd42810c5733ae8.js +0 -15
- package/bundle/.next/static/chunks/app/_global-error/page-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/_not-found/page-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/agents/[agentId]/chat/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/agents/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/diagnostics/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/files/reveal/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/gateway/control/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/mission/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/models/catalog/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/models/providers/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/onboarding/models/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/onboarding/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/openclaw/capabilities/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/planner/[planId]/deploy/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/planner/[planId]/document-rewrite/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/planner/[planId]/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/planner/[planId]/simulate/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/planner/[planId]/turn/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/planner/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/reset/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/runtimes/[runtimeId]/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/settings/gateway/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/settings/workspace-root/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/snapshot/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/stream/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/system/open-terminal/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/tasks/[taskId]/abort/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/tasks/[taskId]/stream/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/update/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/channels/discovered-groups/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/channels/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/edit-draft/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/workspaces/[workspaceId]/surfaces/discovery/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/api/workspaces/route-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/not-found-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/app/page-5de22cbc4ffb588d.js +0 -179
- package/bundle/.next/static/chunks/next/dist/client/components/builtin/app-error-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/next/dist/client/components/builtin/forbidden-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/chunks/next/dist/client/components/builtin/unauthorized-cde9c645dcfceb9f.js +0 -1
- package/bundle/.next/static/css/0633750bbe1c3acc.css +0 -3
- /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.
|
|
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",
|