test: add codex launch/env integration coverage

This commit is contained in:
Prateek 2026-03-07 20:37:36 +05:30
parent e90c7f7ff2
commit e81a8a4e27
1 changed files with 45 additions and 0 deletions

View File

@ -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> = {}): 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");
});
});