mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 04:10:46 +00:00
fix(plugins): late-binding subagent runtime for non-gateway load paths (#46648)
Merged via squash.
Prepared head SHA: 44742652c9
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
@@ -5,9 +5,10 @@ import type {
|
||||
SetSessionConfigOptionRequest,
|
||||
SetSessionModeRequest,
|
||||
} from "@agentclientprotocol/sdk";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { GatewayClient } from "../gateway/client.js";
|
||||
import type { EventFrame } from "../gateway/protocol/index.js";
|
||||
import { resetProviderRuntimeHookCacheForTest } from "../plugins/provider-runtime.js";
|
||||
import { createInMemorySessionStore } from "./session.js";
|
||||
import { AcpGatewayAgent } from "./translator.js";
|
||||
import { createAcpConnection, createAcpGateway } from "./translator.test-helpers.js";
|
||||
@@ -119,6 +120,10 @@ async function expectOversizedPromptRejected(params: { sessionId: string; text:
|
||||
sessionStore.clearAllSessionsForTest();
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
resetProviderRuntimeHookCacheForTest();
|
||||
});
|
||||
|
||||
describe("acp session creation rate limit", () => {
|
||||
it("rate limits excessive newSession bursts", async () => {
|
||||
const sessionStore = createInMemorySessionStore();
|
||||
@@ -297,7 +302,14 @@ describe("acp session UX bridge behavior", () => {
|
||||
const result = await agent.loadSession(createLoadSessionRequest("agent:main:work"));
|
||||
|
||||
expect(result.modes?.currentModeId).toBe("high");
|
||||
expect(result.modes?.availableModes.map((mode) => mode.id)).toContain("xhigh");
|
||||
expect(result.modes?.availableModes.map((mode) => mode.id)).toEqual([
|
||||
"off",
|
||||
"minimal",
|
||||
"low",
|
||||
"medium",
|
||||
"high",
|
||||
"adaptive",
|
||||
]);
|
||||
expect(result.configOptions).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
|
||||
Reference in New Issue
Block a user