mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 02:48:27 +00:00
refactor: align agent lifecycle
This commit is contained in:
@@ -288,10 +288,6 @@ export const agentHandlers: GatewayRequestHandlers = {
|
||||
}
|
||||
const p = params as AgentWaitParams;
|
||||
const runId = p.runId.trim();
|
||||
const afterMs =
|
||||
typeof p.afterMs === "number" && Number.isFinite(p.afterMs)
|
||||
? Math.max(0, Math.floor(p.afterMs))
|
||||
: undefined;
|
||||
const timeoutMs =
|
||||
typeof p.timeoutMs === "number" && Number.isFinite(p.timeoutMs)
|
||||
? Math.max(0, Math.floor(p.timeoutMs))
|
||||
@@ -299,7 +295,6 @@ export const agentHandlers: GatewayRequestHandlers = {
|
||||
|
||||
const snapshot = await waitForAgentJob({
|
||||
runId,
|
||||
afterMs,
|
||||
timeoutMs,
|
||||
});
|
||||
if (!snapshot) {
|
||||
@@ -311,7 +306,7 @@ export const agentHandlers: GatewayRequestHandlers = {
|
||||
}
|
||||
respond(true, {
|
||||
runId,
|
||||
status: snapshot.state === "done" ? "ok" : "error",
|
||||
status: snapshot.status,
|
||||
startedAt: snapshot.startedAt,
|
||||
endedAt: snapshot.endedAt,
|
||||
error: snapshot.error,
|
||||
|
||||
Reference in New Issue
Block a user