Skip to content

Commit 0146aaf

Browse files
committed
test(agents): scope extension fixtures to explicit owners
1 parent 8733dcd commit 0146aaf

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

‎extensions/codex/src/app-server/attempt-startup.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function createAttemptParams(paths: AttemptPaths): EmbeddedRunAttemptParams {
6363
hostCapabilities: createCodexTestHostCapabilities(),
6464
prompt: "hello",
6565
sessionId: "session-1",
66-
sessionKey: "agent:main:session-1",
66+
sessionKey: "agent:agent-1:session-1",
6767
agentDir: paths.agentDir,
6868
sessionFile: paths.sessionFile,
6969
effectiveCwd: paths.cwd,

‎extensions/copilot/src/attempt.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,10 @@ function makeParams(
486486
runId: "run-1",
487487
sessionFile: "session.json",
488488
sessionId: "session-1",
489-
sessionKey: "agent:main:session-1",
489+
sessionKey: "agent:agent-1:session-1",
490490
sessionTarget: {
491491
sessionId: "session-1",
492-
sessionKey: "agent:main:session-1",
492+
sessionKey: "agent:agent-1:session-1",
493493
storePath: "openclaw-agent.sqlite",
494494
},
495495
timeoutMs: 5000,
@@ -1717,7 +1717,7 @@ describe("runCopilotAttempt", () => {
17171717
modelId: "gpt-4o",
17181718
modelProvider: "github-copilot",
17191719
sessionId: "session-1",
1720-
sessionKey: "agent:main:session-1",
1720+
sessionKey: "agent:agent-1:session-1",
17211721
workspaceDir: "C:\\workspace",
17221722
}),
17231723
);

‎extensions/copilot/src/tool-bridge.test.ts‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ describe("createCopilotToolBridge", () => {
325325
attemptParams: {
326326
config: { tools: { toolSearch: true } },
327327
runId: "run-tool-search",
328-
sessionKey: "agent:main:main",
328+
sessionKey: "agent:agent-1:main",
329329
} as never,
330330
createOpenClawCodingTools,
331331
modelId: "gpt-4o",
@@ -359,7 +359,7 @@ describe("createCopilotToolBridge", () => {
359359
attemptParams: {
360360
config: { tools: { toolSearch: true } },
361361
runId: "run-tool-search",
362-
sessionKey: "agent:main:main",
362+
sessionKey: "agent:agent-1:main",
363363
toolsAllow: ["read"],
364364
} as never,
365365
createOpenClawCodingTools,
@@ -389,7 +389,7 @@ describe("createCopilotToolBridge", () => {
389389
attemptParams: {
390390
config: { tools: { toolSearch: true } },
391391
runId: "run-tool-search",
392-
sessionKey: "agent:main:main",
392+
sessionKey: "agent:agent-1:main",
393393
toolsAllow: ["read"],
394394
} as never,
395395
createOpenClawCodingTools,
@@ -412,7 +412,7 @@ describe("createCopilotToolBridge", () => {
412412
attemptParams: {
413413
config: { tools: { codeMode: true } },
414414
runId: "run-code-mode",
415-
sessionKey: "agent:main:main",
415+
sessionKey: "agent:agent-1:main",
416416
} as never,
417417
createOpenClawCodingTools,
418418
modelId: "gpt-4o",
@@ -457,7 +457,7 @@ describe("createCopilotToolBridge", () => {
457457
config: { tools: { codeMode: true } },
458458
hostCapabilities: { ...testHostCapabilities, bindToolSurface },
459459
runId: "run-code-mode-bound",
460-
sessionKey: "agent:main:main",
460+
sessionKey: "agent:agent-1:main",
461461
},
462462
createOpenClawCodingTools: async () => [makeTool({ execute: hiddenExecute, name: "read" })],
463463
modelId: "gpt-test",
@@ -503,7 +503,7 @@ describe("createCopilotToolBridge", () => {
503503
attemptParams: {
504504
config: { tools: { codeMode: false } },
505505
runId: "run-no-code-mode",
506-
sessionKey: "agent:main:main",
506+
sessionKey: "agent:agent-1:main",
507507
} as never,
508508
createOpenClawCodingTools: vi.fn(async () => [makeTool({ name: "read" })]),
509509
modelId: "gpt-4o",
@@ -525,7 +525,7 @@ describe("createCopilotToolBridge", () => {
525525
attemptParams: {
526526
config: { tools: { codeMode: true } },
527527
runId: "run-code-mode",
528-
sessionKey: "agent:main:main",
528+
sessionKey: "agent:agent-1:main",
529529
toolsAllow: ["read"],
530530
} as never,
531531
createOpenClawCodingTools,
@@ -550,7 +550,7 @@ describe("createCopilotToolBridge", () => {
550550
attemptParams: {
551551
config: { tools: { codeMode: true } },
552552
runId: "run-code-mode",
553-
sessionKey: "agent:main:main",
553+
sessionKey: "agent:agent-1:main",
554554
toolsAllow: ["read"],
555555
} as never,
556556
createOpenClawCodingTools,
@@ -923,8 +923,8 @@ describe("createCopilotToolBridge", () => {
923923
// sandbox key and the real run key is exposed as runSessionKey
924924
// so `session_status: "current"` resolves to the live session.
925925
attemptParams: {
926-
sandboxSessionKey: "sandbox:agent:main",
927-
sessionKey: "agent:main:main",
926+
sandboxSessionKey: "sandbox:agent:agent-1",
927+
sessionKey: "agent:agent-1:main",
928928
} as never,
929929
createOpenClawCodingTools,
930930
modelId: "gpt-4o",
@@ -933,24 +933,24 @@ describe("createCopilotToolBridge", () => {
933933
});
934934

935935
const opts = getOpts();
936-
expect(opts.sessionKey).toBe("sandbox:agent:main");
937-
expect(opts.runSessionKey).toBe("agent:main:main");
936+
expect(opts.sessionKey).toBe("sandbox:agent:agent-1");
937+
expect(opts.runSessionKey).toBe("agent:agent-1:main");
938938
});
939939

940940
it("derives runSessionKey as undefined when sandboxSessionKey equals sessionKey", async () => {
941941
const { createOpenClawCodingTools, getOpts } = captureCall();
942942

943943
await createCopilotToolBridge({
944944
agentId: "agent-1",
945-
attemptParams: { sessionKey: "agent:main:main" } as never,
945+
attemptParams: { sessionKey: "agent:agent-1:main" } as never,
946946
createOpenClawCodingTools,
947947
modelId: "gpt-4o",
948948
modelProvider: "github-copilot",
949949
sessionId: "session-1",
950950
});
951951

952952
const opts = getOpts();
953-
expect(opts.sessionKey).toBe("agent:main:main");
953+
expect(opts.sessionKey).toBe("agent:agent-1:main");
954954
expect(opts.runSessionKey).toBeUndefined();
955955
});
956956

@@ -1278,14 +1278,14 @@ describe("createCopilotToolBridge", () => {
12781278
deny: ["exec", "process", "write", "edit", "ask_user"],
12791279
},
12801280
runId: "policy-run",
1281-
sessionKey: "agent:main:policy-session",
1281+
sessionKey: "agent:agent-1:policy-session",
12821282
workspaceDir,
12831283
} as never,
12841284
createOpenClawCodingTools: createRealOpenClawCodingTools,
12851285
modelId: "gpt-4o",
12861286
modelProvider: "github-copilot",
12871287
sessionId: "policy-session",
1288-
sessionKey: "agent:main:policy-session",
1288+
sessionKey: "agent:agent-1:policy-session",
12891289
workspaceDir,
12901290
});
12911291
const names = result.sdkTools.map((tool) => tool.name);
@@ -2043,7 +2043,7 @@ describe("createCopilotToolBridge tool conversion", () => {
20432043
config: { tools: { toolSearch: true } },
20442044
observeToolTerminal,
20452045
runId: "run-tool-search",
2046-
sessionKey: "agent:main:main",
2046+
sessionKey: "agent:agent-1:main",
20472047
} as never,
20482048
createOpenClawCodingTools: async (options: unknown) => {
20492049
catalogExecutor = (options as { toolSearchCatalogExecutor?: CatalogExecutor })

0 commit comments

Comments
 (0)