test(agents,gateway): fix two main-baseline test breakages from #68726 and #65986#69173
Conversation
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.
Greptile SummaryThis PR fixes a broken test in Confidence Score: 5/5Safe to merge — minimal one-test fix with no logic changes. The change is a straightforward test expectation update with no production code modifications. It correctly aligns the assertion with the actual outcome shape, using the same matcher pattern already present in the file. No files require special attention. Reviews (1): Last reviewed commit: "test(agents): expect timing fields in ki..." | Re-trigger Greptile |
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.
…law#68726 and openclaw#65986 (openclaw#69173) * 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 openclaw#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 openclaw#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 openclaw#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>
…law#68726 and openclaw#65986 (openclaw#69173) * 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 openclaw#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 openclaw#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 openclaw#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>
…law#68726 and openclaw#65986 (openclaw#69173) * 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 openclaw#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 openclaw#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 openclaw#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>
…law#68726 and openclaw#65986 (openclaw#69173) * 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 openclaw#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 openclaw#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 openclaw#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>
…law#68726 and openclaw#65986 (openclaw#69173) * 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 openclaw#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 openclaw#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 openclaw#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>
…law#68726 and openclaw#65986 (openclaw#69173) * 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 openclaw#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 openclaw#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 openclaw#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>
Summary
Unblocks the two baseline failures currently red on main.
1.
checks-node-agentic-agents-plugins— broken by #68726File:
src/agents/subagent-registry.steer-restart.test.ts:566#68726 added
startedAt/endedAt/elapsedMsto subagent run outcomes but missed updating this test'stoEqual. Fixed by adding the timing fields using the sameexpect.any(Number)matcher already used a few lines below.2.
checks-node-agentic-control-plane— broken by #65986File:
src/gateway/server.sessions.gateway-server-sessions-a.test.ts:591("sessions.create can start the first agent turn from an initial task")#65986 added a deleted-agent guard to
chat.send. This test callssessions.createwithagentId: "ops"andtask: "hello from create"which auto-triggerschat.send, but the test never registeredopsviatestState.agentsConfig, so the new guard treated it as deleted and rejected the send.runStartedcame backfalseinstead oftrue.Fixed by registering
opsusing the sametestState.agentsConfig = { list: [{ id: "ops", default: true }] }pattern the file uses at lines 2129/2162/2211.Test plan
pnpm test src/agents/subagent-registry.steer-restart.test.ts— 15 passedpnpm test src/gateway/server.sessions.gateway-server-sessions-a.test.ts— 51 passedchecks-node-agentic-agents-pluginsandchecks-node-agentic-control-planeboth green