Skip to content

[Bug]: gateway.test.ts e2e fails on clean main — test config omits the "dev" agent its sessionKey requires #99513

Description

@masatohoshino

Summary

The clean-base e2e test src/gateway/gateway.test.ts > gateway e2e > accepts a gateway agent request over ws and returns a run id fails on current main with:

GatewayClientRequestError: Agent "dev" no longer exists in configuration
 ❯ GatewayClient.handleMessage packages/gateway-client/src/client.ts:1483:11

This blocks local pre-push gates (pnpm check:changed / precheck flows) for contributors, because the failure reproduces on an untouched checkout of main regardless of their diff.

Reproduction

git checkout 776b34a4e642
pnpm install
pnpm test src/gateway/gateway.test.ts

Result on 776b34a4e642 (also reproduced earlier on df350e6720 and 8d535fb039):

 ❯ src/gateway/gateway.test.ts (4 tests | 1 failed)
     × accepts a gateway agent request over ws and returns a run id
GatewayClientRequestError: Agent "dev" no longer exists in configuration
 Test Files  1 failed (1)
      Tests  1 failed | 3 passed (4)

Source-level cause

The failing test requests sessionKey = "agent:dev:mock-openai" (src/gateway/gateway.test.ts:227), but its gateway config (src/gateway/gateway.test.ts:195-217) only defines agents.defaults — there is no agents.list entry declaring an agent with id dev. The gateway therefore rejects the run with "Agent "dev" no longer exists in configuration".

The sibling test in the same file ("lists agents over ws", src/gateway/gateway.test.ts:292-294) declares agents.list: [{ id: "main", default: true, ... }] and passes, which suggests the fix is to declare the dev agent in the failing test's config (or switch the session key to a declared agent).

Expected behavior

pnpm test src/gateway/gateway.test.ts passes on a clean checkout of main.

Notes

  • PR fix: resolve scheduled live and e2e CI failures on main #98686 ("fix: resolve scheduled live and e2e CI failures on main") appears to have attempted a fix in this area but was closed unmerged with no public discussion, so the intended resolution is unclear from the outside.
  • Scope of this issue is only the gateway.test.ts clean-base failure above; no claim about other scheduled/live suites on current main.

Environment

  • main @ 776b34a4e642 (Linux, Node 22.22.2, pnpm 11.2.2)

🤖 Filed with AI assistance (Claude Fable 5); failure and source-level cause verified by hand on the SHA above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.no-staleExclude from stale automation

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions