diff --git a/apps/server/src/provider/CodexManagedRuntime.test.ts b/apps/server/src/provider/CodexManagedRuntime.test.ts index 2c697f8fa8531..4863fda790bf5 100644 --- a/apps/server/src/provider/CodexManagedRuntime.test.ts +++ b/apps/server/src/provider/CodexManagedRuntime.test.ts @@ -201,7 +201,7 @@ it.live.each( assert.include(args, "features.multi_agent_v2=false"); assert.notInclude(effective.config.launchArgs, "model_catalog_json"); assert.notInclude(effective.config.launchArgs, "x-openai-chatpass-test"); - assert.include(provider, "supports_websockets=false"); + assert.include(provider, "supports_websockets=true"); assert.include(provider, "requires_openai_auth=false"); for (const secret of ["dummy-owned-access", "dummy-refresh", "ambient-bearer"]) { assert.notInclude(effective.config.launchArgs, secret); diff --git a/apps/server/src/provider/CodexManagedRuntime.ts b/apps/server/src/provider/CodexManagedRuntime.ts index 3704c919c2791..d627bf33499e0 100644 --- a/apps/server/src/provider/CodexManagedRuntime.ts +++ b/apps/server/src/provider/CodexManagedRuntime.ts @@ -23,7 +23,9 @@ const managedCodexLaunchArgs = (command: string, args: ReadonlyArray) => [ 'model_provider="openai_token_sharing"', // Codex persists this provider ID in rollouts and needs it unchanged to resume. - `model_providers.openai_token_sharing={name="OpenAI Token Sharing",base_url="https://api.openai.com/v1",model_catalog_url="https://api.openai.com/v1/models",wire_api="responses",requires_openai_auth=false,supports_websockets=false,auth={command=${JSON.stringify(command)},args=${JSON.stringify(args)},timeout_ms=${COMMAND_TIMEOUT_MS},refresh_interval_ms=0}}`, + // WebSockets send each step's new input only; over HTTP every step re-uploads the + // whole history, including every image, which made image-heavy turns take minutes. + `model_providers.openai_token_sharing={name="OpenAI Token Sharing",base_url="https://api.openai.com/v1",model_catalog_url="https://api.openai.com/v1/models",wire_api="responses",requires_openai_auth=false,supports_websockets=true,auth={command=${JSON.stringify(command)},args=${JSON.stringify(args)},timeout_ms=${COMMAND_TIMEOUT_MS},refresh_interval_ms=0}}`, "features.api_key_model_discovery=true", "features.multi_agent=false", "features.multi_agent_v2=false",