@@ -691,6 +691,47 @@ describe("runCodexAppServerAttempt", () => {
|
691 | 691 | } |
692 | 692 | }); |
693 | 693 | |
| 694 | +it("passes auth profiles into Codex dynamic tool construction", async () => { |
| 695 | +const sessionFile = path.join(tempDir, "session.jsonl"); |
| 696 | +const workspaceDir = path.join(tempDir, "workspace"); |
| 697 | +const params = createParams(sessionFile, workspaceDir); |
| 698 | +const authProfileStore = { |
| 699 | +version: 1, |
| 700 | +profiles: { |
| 701 | +"openai:api-key-backup": { |
| 702 | +provider: "openai", |
| 703 | +type: "api_key", |
| 704 | +key: "not-a-real-key", |
| 705 | +}, |
| 706 | +}, |
| 707 | +} satisfies EmbeddedRunAttemptParams["authProfileStore"]; |
| 708 | +params.disableTools = false; |
| 709 | +params.authProfileStore = authProfileStore; |
| 710 | + |
| 711 | +const factoryOptions: unknown[] = []; |
| 712 | +__testing.setOpenClawCodingToolsFactoryForTests((options) => { |
| 713 | +factoryOptions.push(options); |
| 714 | +return []; |
| 715 | +}); |
| 716 | + |
| 717 | +await __testing.buildDynamicTools({ |
| 718 | + params, |
| 719 | +resolvedWorkspace: workspaceDir, |
| 720 | +effectiveWorkspace: workspaceDir, |
| 721 | +sandboxSessionKey: params.sessionKey!, |
| 722 | +sandbox: null as never, |
| 723 | +runAbortController: new AbortController(), |
| 724 | +sessionAgentId: "main", |
| 725 | +pluginConfig: {}, |
| 726 | +onYieldDetected: () => undefined, |
| 727 | +}); |
| 728 | + |
| 729 | +expect(factoryOptions).toHaveLength(1); |
| 730 | +expect(factoryOptions[0]).toMatchObject({ |
| 731 | + authProfileStore, |
| 732 | +}); |
| 733 | +}); |
| 734 | + |
694 | 735 | it("normalizes Codex dynamic toolsAllow entries before filtering", () => { |
695 | 736 | const tools = ["exec", "apply_patch", "read", "message"].map((name) => ({ name })); |
696 | 737 | |
|