test: use synthetic agent session fixtures

This commit is contained in:
Peter Steinberger
2026-04-21 01:24:34 +01:00
parent 9f2f89320e
commit 97e528ed54
7 changed files with 7 additions and 7 deletions

View File

@@ -63,7 +63,7 @@ async function spawn(params: {
},
{
agentSessionKey: params.requesterSessionKey ?? "main",
agentChannel: params.requesterChannel ?? "whatsapp",
agentChannel: params.requesterChannel ?? "mobilechat",
},
);
}

View File

@@ -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();

View File

@@ -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",
});

View File

@@ -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 }) => ({

View File

@@ -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);
});
});

View File

@@ -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();

View File

@@ -75,7 +75,7 @@ describe("spawnSubagentDirect runtime model persistence", () => {
},
{
agentSessionKey: "agent:main:main",
agentChannel: "discord",
agentChannel: "guildchat",
},
);