fix(test): Gateway E2E shard 1/4 fails after the concise error copy and keyed agent roster changes (#163623)

* fix(test): align reply-entry fallback E2E with concise error copy

The reply-entry fallback E2E still expected the pre-#163381 rate-limit and
auth-failure copy, so its two OpenAI cases fail on main. Hourly main CI skips
src E2E files, so the break stayed invisible there.

Assert the new pinned rate-limit copy and the exported auth copy constant.
The anthropic-attempt count still catches the original fallbackConfigured
defect, which surfaced as "temporarily rate-limited" after a fallback attempt.

The non-OpenAI failures reported on 2026-10-01 were a separate, already-fixed
fixture gap: #161103 added reply-path thinking-catalog hydration that calls
preparedModelRuntimeConfigsMatch through the prepared-model-runtime module,
and the shared E2E mock lacked that export until #148089. No product change.

* fix(test): migrate Gateway E2E fixtures to keyed agent rosters

#162612 made ordinary config reads reject a populated agents.list, but the
dreaming restart-cleanup and WhatsApp login-authority E2E fixtures still wrote
legacy rosters to disk. Both Gateways now refuse to start (code 78 or
InvalidConfigError) before any assertion runs, which fails Gateway E2E shard
1/4 on main. Hourly main CI does not run these files.

Write the canonical shapes Doctor produces: a sole keyed main entry for the
WhatsApp fixture, and explicit ownership with main as the system agent for the
two-agent dreaming fixture. Assertions are unchanged.
This commit is contained in:
Peter Steinberger 2026-10-02 14:29:41 -07:00 • committed by GitHub
parent 7fdad03cdc
commit 97eb729b25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 11 deletions

View file

@ -20,6 +20,7 @@ import type {
EmbeddedRunAttemptParams,
EmbeddedRunAttemptResult,
} from "./embedded-agent-runner/run/types.js";
import { AUTH_INVALID_TOKEN_USER_TEXT } from "./failover/user-copy.js";
import { resetFallbackSkipCacheForTest } from "./fallback-skip-cache.test-support.js";
import {
makeModelFallbackConfig,
@ -301,8 +302,8 @@ describe("getReplyFromConfig fallback availability", () => {
expect(delivered[0]?.payload.text?.trim().length).toBeGreaterThan(0);
if (errorMessage === RATE_LIMIT_ERROR_MESSAGE) {
expect(countProviderAttempts("openai")).toBeGreaterThan(2);
expect(text).toContain("API rate limit reached");
expect(delivered[0]?.payload.text).toContain("API rate limit reached");
expect(text).toContain("The AI service needs a short break");
expect(delivered[0]?.payload.text).toContain("The AI service needs a short break");
} else if (loginCommand) {
expect(countProviderAttempts(provider)).toBe(1);
if (reservedProviders.includes(provider)) {
@ -358,7 +359,7 @@ describe("getReplyFromConfig fallback availability", () => {
});
} else {
expect(countProviderAttempts(provider)).toBe(1);
expect(delivered[0]?.payload.text).toContain("Authentication failed");
expect(delivered[0]?.payload.text).toBe(AUTH_INVALID_TOKEN_USER_TEXT);
expect(delivered[0]?.payload.text).not.toContain("/login");
expect(delivered[0]?.payload.presentation).toBeUndefined();
}

View file

@ -81,7 +81,11 @@ async function connect(instance: OpenClawTestInstance): Promise<GatewaySessionCl
describe("Gateway dreaming session restart cleanup", () => {
it("removes stale child sessions after a real restart even when dreaming and cron are disabled", async () => {
const config = {
agents: { list: [{ id: "main", default: true }, { id: "worker" }] },
agents: {
ownership: "explicit",
defaults: { systemAgent: { agentId: "main" } },
entries: { main: {}, worker: {} },
},
plugins: {
enabled: true,
allow: ["memory-core"],

View file

@ -44,13 +44,7 @@ describe("Gateway WhatsApp login authority", () => {
entries: { whatsapp: { enabled: true } },
},
agents: {
list: [
{
id: "main",
default: true,
tools: { allow: ["whatsapp_login"] },
},
],
entries: { main: { tools: { allow: ["whatsapp_login"] } } },
},
gateway: { tools: { allow: ["whatsapp_login"] } },
},