Skip to content

test(agents,gateway): fix two main-baseline test breakages from #68726 and #65986#69173

Merged
omarshahine merged 2 commits into
mainfrom
fix/steer-restart-timing-expectation
Apr 20, 2026
Merged

test(agents,gateway): fix two main-baseline test breakages from #68726 and #65986#69173
omarshahine merged 2 commits into
mainfrom
fix/steer-restart-timing-expectation

Conversation

@omarshahine

@omarshahine omarshahine commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Unblocks the two baseline failures currently red on main.

1. checks-node-agentic-agents-plugins — broken by #68726

File: src/agents/subagent-registry.steer-restart.test.ts:566

#68726 added startedAt/endedAt/elapsedMs to subagent run outcomes but missed updating this test's toEqual. Fixed by adding the timing fields using the same expect.any(Number) matcher already used a few lines below.

2. checks-node-agentic-control-plane — broken by #65986

File: 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 calls sessions.create with agentId: "ops" and task: "hello from create" which auto-triggers chat.send, but the test never registered ops via testState.agentsConfig, so the new guard treated it as deleted and rejected the send. runStarted came back false instead of true.

Fixed by registering ops using the same testState.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 passed
  • pnpm test src/gateway/server.sessions.gateway-server-sessions-a.test.ts — 51 passed
  • CI checks-node-agentic-agents-plugins and checks-node-agentic-control-plane both green

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.
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Apr 20, 2026
@greptile-apps

greptile-apps Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a broken test in src/agents/subagent-registry.steer-restart.test.ts by updating the killed-run outcome assertion to include the startedAt, endedAt, and elapsedMs timing fields that were introduced in #68726 but missed in that test. The fix correctly uses expect.any(Number) matchers, consistent with how timing fields are already asserted in the adjacent runSubagentEndedHook expectation.

Confidence Score: 5/5

Safe 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.
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Apr 20, 2026
@omarshahine omarshahine changed the title test(agents): expect timing fields in killed-run outcome test(agents,gateway): fix two main-baseline test breakages from #68726 and #65986 Apr 20, 2026
@omarshahine omarshahine merged commit 97492cf into main Apr 20, 2026
52 of 53 checks passed
@omarshahine omarshahine deleted the fix/steer-restart-timing-expectation branch April 20, 2026 03:45
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…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>
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…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>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…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>
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request May 13, 2026
…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>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…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>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant