mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:00:42 +00:00
test: use synthetic agent session fixtures
This commit is contained in:
@@ -63,7 +63,7 @@ async function spawn(params: {
|
||||
},
|
||||
{
|
||||
agentSessionKey: params.requesterSessionKey ?? "main",
|
||||
agentChannel: params.requesterChannel ?? "whatsapp",
|
||||
agentChannel: params.requesterChannel ?? "mobilechat",
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ async function finalizeTurn(
|
||||
}
|
||||
|
||||
describe("runEmbeddedAttempt context engine sessionKey forwarding", () => {
|
||||
const sessionKey = "agent:main:discord:channel:test-ctx-engine";
|
||||
const sessionKey = "agent:main:guildchat:channel:test-ctx-engine";
|
||||
const tempPaths: string[] = [];
|
||||
beforeEach(() => {
|
||||
resetEmbeddedAttemptHarness();
|
||||
|
||||
@@ -204,7 +204,7 @@ describe("embedded attempt context injection", () => {
|
||||
assemble,
|
||||
} satisfies AttemptContextEngine,
|
||||
sessionId: "session",
|
||||
sessionKey: "agent:main:discord:dm:test-user",
|
||||
sessionKey: "agent:main:guildchat:dm:test-user",
|
||||
messages: limited,
|
||||
modelId: "gpt-test",
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@ describe("runEmbeddedAttempt resource loader wiring", () => {
|
||||
|
||||
it("passes an explicit resourceLoader to createAgentSession even without extension factories", async () => {
|
||||
await createContextEngineAttemptRunner({
|
||||
sessionKey: "agent:main:discord:dm:test-resource-loader",
|
||||
sessionKey: "agent:main:guildchat:dm:test-resource-loader",
|
||||
tempPaths,
|
||||
contextEngine: {
|
||||
assemble: async ({ messages }) => ({
|
||||
|
||||
@@ -13,7 +13,7 @@ describe("createOpenClawCodingTools message provider policy", () => {
|
||||
);
|
||||
|
||||
it("keeps tts tool for non-voice providers", () => {
|
||||
const names = new Set(filterToolNamesByMessageProvider(DEFAULT_TOOL_NAMES, "discord"));
|
||||
const names = new Set(filterToolNamesByMessageProvider(DEFAULT_TOOL_NAMES, "guildchat"));
|
||||
expect(names.has("tts")).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -104,7 +104,7 @@ describe("sandbox explain helpers", () => {
|
||||
|
||||
const msg = formatSandboxToolPolicyBlockedMessage({
|
||||
cfg,
|
||||
sessionKey: "agent:main:whatsapp:group:g1",
|
||||
sessionKey: "agent:main:mobilechat:group:g1",
|
||||
toolName: "browser",
|
||||
});
|
||||
expect(msg).toBeTruthy();
|
||||
|
||||
@@ -75,7 +75,7 @@ describe("spawnSubagentDirect runtime model persistence", () => {
|
||||
},
|
||||
{
|
||||
agentSessionKey: "agent:main:main",
|
||||
agentChannel: "discord",
|
||||
agentChannel: "guildchat",
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user