diff --git a/packages/integration-tests/src/agent-codex-launch-env.integration.test.ts b/packages/integration-tests/src/agent-codex-launch-env.integration.test.ts new file mode 100644 index 000000000..6ad47f861 --- /dev/null +++ b/packages/integration-tests/src/agent-codex-launch-env.integration.test.ts @@ -0,0 +1,45 @@ +import { describe, expect, it } from "vitest"; +import type { AgentLaunchConfig } from "@composio/ao-core"; +import codexPlugin from "@composio/ao-plugin-agent-codex"; + +function makeLaunchConfig(overrides: Partial = {}): AgentLaunchConfig { + return { + sessionId: "sess-int-1", + projectConfig: { + name: "my-project", + repo: "owner/repo", + path: "/workspace/repo", + defaultBranch: "main", + sessionPrefix: "my", + }, + ...overrides, + }; +} + +describe("agent-codex launch/env wiring (integration)", () => { + const agent = codexPlugin.create(); + + it("includes check_for_update_on_startup=false in launch command", () => { + const cmd = agent.getLaunchCommand(makeLaunchConfig()); + expect(cmd).toContain("-c check_for_update_on_startup=false"); + }); + + it("preserves update-check override alongside other flags", () => { + const cmd = agent.getLaunchCommand( + makeLaunchConfig({ + permissions: "skip", + model: "o3-mini", + prompt: "Do the thing", + }), + ); + expect(cmd).toContain("-c check_for_update_on_startup=false"); + expect(cmd).toContain("--dangerously-bypass-approvals-and-sandbox"); + expect(cmd).toContain("--model 'o3-mini'"); + expect(cmd).toContain("-c model_reasoning_effort=high"); + }); + + it("sets CODEX_DISABLE_UPDATE_CHECK=1 in environment", () => { + const env = agent.getEnvironment(makeLaunchConfig()); + expect(env["CODEX_DISABLE_UPDATE_CHECK"]).toBe("1"); + }); +});