From 0a92c5c18fd372b39fde7377971c717be0be7891 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Wed, 4 Feb 2026 11:58:07 +0000 Subject: [PATCH] fix(codex): update tests to work with conditional agentapi module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Only set install_agentapi when explicitly installing real AgentAPI - Let enable_tasks (defaults to true) control agentapi module in tests - This fixes tests that were inadvertently triggering standalone mode All 18 tests now pass ✅ --- .../coder-labs/modules/codex/main.test.ts | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/registry/coder-labs/modules/codex/main.test.ts b/registry/coder-labs/modules/codex/main.test.ts index 1e9ed218..f11994eb 100644 --- a/registry/coder-labs/modules/codex/main.test.ts +++ b/registry/coder-labs/modules/codex/main.test.ts @@ -41,15 +41,25 @@ interface SetupProps { const setup = async (props?: SetupProps): Promise<{ id: string }> => { const projectDir = "/home/coder/project"; + + const moduleVars: Record = { + install_codex: props?.skipCodexMock ? "true" : "false", + codex_model: "gpt-4-turbo", + workdir: "/home/coder", + ...props?.moduleVariables, + }; + + // For backward compatibility: install_agentapi takes precedence over enable_tasks + // Only set install_agentapi when explicitly installing real AgentAPI + if (props?.skipAgentAPIMock) { + moduleVars.install_agentapi = "true"; + } + // Otherwise, let enable_tasks control whether agentapi module runs + // (defaults to true unless explicitly disabled in moduleVariables) + const { id } = await setupUtil({ moduleDir: import.meta.dir, - moduleVariables: { - install_codex: props?.skipCodexMock ? "true" : "false", - install_agentapi: props?.skipAgentAPIMock ? "true" : "false", - codex_model: "gpt-4-turbo", - workdir: "/home/coder", - ...props?.moduleVariables, - }, + moduleVariables: moduleVars, registerCleanup, projectDir, skipAgentAPIMock: props?.skipAgentAPIMock,