mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:50:43 +00:00
* test(agents): expect timing fields in killed-run outcome Aligns the steer-restart killed-run test with the timing fields added to subagent run outcomes in #68726. The production code now returns startedAt/endedAt/elapsedMs alongside status and error on the error outcome, but this test's toEqual still asserted only status+error, so it has been failing on main since #68726 landed. Uses the same expect.any(Number) matcher already in use a few lines below for the ended hook payload. * test(gateway): register ops agent in sessions.create task-start test The "sessions.create can start the first agent turn from an initial task" test triggers the auto chat.send path by passing `task:`. After #65986 added a deleted-agent guard to chat.send, an unregistered `ops` agent triggers the reject path and the auto-started run never happens, so runStarted comes back false. Register `ops` via testState.agentsConfig (matching the pattern already used by other ops-agent tests in this file) so the guard lets chat.send through and the first turn starts as expected. --------- Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
This commit is contained in:
@@ -563,7 +563,13 @@ describe("subagent registry steer restarts", () => {
|
||||
expect(mod.isSubagentSessionRunActive(childSessionKey)).toBe(false);
|
||||
|
||||
const run = listMainRuns()[0];
|
||||
expect(run?.outcome).toEqual({ status: "error", error: "manual kill" });
|
||||
expect(run?.outcome).toEqual({
|
||||
status: "error",
|
||||
error: "manual kill",
|
||||
startedAt: expect.any(Number),
|
||||
endedAt: expect.any(Number),
|
||||
elapsedMs: expect.any(Number),
|
||||
});
|
||||
expect(run?.cleanupHandled).toBe(true);
|
||||
expect(typeof run?.cleanupCompletedAt).toBe("number");
|
||||
await flushAnnounce();
|
||||
|
||||
@@ -590,6 +590,9 @@ describe("gateway server sessions", () => {
|
||||
|
||||
test("sessions.create can start the first agent turn from an initial task", async () => {
|
||||
await createSessionStoreDir();
|
||||
// Register "ops" so the deleted-agent guard added in #65986 does not
|
||||
// reject the auto-started chat.send triggered by `task:`.
|
||||
testState.agentsConfig = { list: [{ id: "ops", default: true }] };
|
||||
const { ws } = await openClient();
|
||||
|
||||
const created = await rpcReq<{
|
||||
|
||||
Reference in New Issue
Block a user