Skip to content

fix: support Codex CLI gpt-5.5 structured outputs#1699

Open
seven017438 wants to merge 4 commits into
eyaltoledano:mainfrom
seven017438:fix/codex-cli-gpt55-structured-output
Open

fix: support Codex CLI gpt-5.5 structured outputs#1699
seven017438 wants to merge 4 commits into
eyaltoledano:mainfrom
seven017438:fix/codex-cli-gpt55-structured-output

Conversation

@seven017438

@seven017438 seven017438 commented May 6, 2026

Copy link
Copy Markdown

Summary

  • Add gpt-5.5 to the Codex CLI model catalog and reasoning-effort support.
  • Normalize structured-output object schemas recursively for OpenAI strict JSON schema requirements.
  • Keep the AI SDK 5-compatible ai-sdk-provider-codex-cli@^0.7.3 path and prefer the system codex binary (or explicit codexCli.codexPath) to avoid stale bundled Codex versions for ChatGPT OAuth users.

Validation

  • npm test -- --runTestsByPath tests/unit/ai-providers/codex-cli.test.js tests/unit/ai-providers/base-provider-schema.test.js tests/unit/ai-providers/codex-cli-supported-models.test.js tests/unit/ai-services-unified.test.js → 4 suites / 23 tests passed
  • npm run turbo:typecheck → 9 successful / 9 total
  • End-to-end smoke in test project: task-master parse-prd ... --tag gpt55-final-smoke with provider codex-cli and model gpt-5.5 generated tasks successfully

Notes

  • This avoids upgrading to ai-sdk-provider-codex-cli@1.1.0, which currently targets a newer provider spec than Task Master's AI SDK 5 stack supports.

Summary by CodeRabbit

  • New Features

    • Added GPT-5.5 to the Codex CLI model catalog
    • Codex CLI client now auto-detects system path with a configurable override
  • Bug Fixes

    • Improved JSON Schema normalization for strict OpenAI structured outputs (enforces object strictness and removes integer-only constraints)
  • Tests

    • Added tests for schema normalization, model catalog entry, and CLI path detection
  • Chores

    • Bumped provider dependency version

Review Change Stack


Note

Medium Risk
Changes structured-output JSON schema generation and Codex CLI invocation defaults, which can affect object-generation success and which codex binary is executed at runtime. Covered by new unit tests but still touches core provider behavior.

Overview
Fixes Codex CLI structured object generation and adds gpt-5.5 support.

Structured-output schemas are now recursively normalized for OpenAI strict mode (auto-populating additionalProperties: false and inferred required fields for object schemas, while preserving the existing removal of integer min/max constraints) before being passed into the AI SDK.

The Codex CLI provider now prefers an explicitly configured codexPath, otherwise auto-detects the system codex binary (cached) to avoid using a potentially stale bundled CLI; gpt-5.5 is added to the codex-cli model catalog and reasoning-effort support. Dependency ai-sdk-provider-codex-cli is bumped to ^0.7.3, and new unit tests cover schema normalization, model catalog, and codex path resolution.

Reviewed by Cursor Bugbot for commit a0a0f36. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented May 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a0a0f36

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
task-master-ai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aef18fe6-d555-47d6-ad34-4e3d85f2f3a3

📥 Commits

Reviewing files that changed from the base of the PR and between b88e357 and a0a0f36.

📒 Files selected for processing (2)
  • src/ai-providers/base-provider.js
  • tests/unit/ai-providers/base-provider-schema.test.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/unit/ai-providers/base-provider-schema.test.js
  • src/ai-providers/base-provider.js

📝 Walkthrough

Walkthrough

Adds GPT-5.5 to the Codex CLI model catalog, introduces a recursive JSON-schema normalizer for strict OpenAI structured outputs in BaseAIProvider, implements system Codex CLI path detection with caching, updates a dependency, and adds/updates tests to verify behavior.

Changes

Schema Normalization & Model Support

Layer / File(s) Summary
Changeset & Catalog
.changeset/fix-codex-cli-gpt55-structured-output.md, scripts/modules/supported-models.json
Changeset entry documents schema normalization and GPT-5.5 addition; GPT-5.5 model with metadata added to codex-cli catalog.
Dependency / Manifest
package.json
ai-sdk-provider-codex-cli bumped from ^0.7.0 to ^0.7.3; workspaces array reformatted to multi-line.
Core Schema Logic
src/ai-providers/base-provider.js
New normalizeSchemaForStructuredOutputs recursively processes JSON schemas, strips integer constraints for integer types, sets additionalProperties: false for object-like schemas when appropriate, and infers required from properties; applied in buildSafeSchema.
Provider Integration
src/ai-providers/codex-cli.js
Added gpt-5.5 to reasoning-effort map; added getSystemCodexPath() using execSync, instance caching via _resolveSystemCodexPath(), and updated getClient() to prefer configured codexPath, fallback to system detection, and merge into defaultSettings when present.
Tests & Verification
tests/unit/ai-providers/base-provider-schema.test.js, tests/unit/ai-providers/codex-cli-supported-models.test.js, tests/unit/ai-providers/codex-cli.test.js
Added/updated tests to validate schema normalization behavior, presence of gpt-5.5 in supported models, and codex CLI path detection precedence, failure, and caching (with execSync mocked).

Sequence Diagram

sequenceDiagram
  participant Client
  participant BaseAIProvider
  participant Normalizer
  participant OpenAI
  Client->>BaseAIProvider: generateObject(schema)
  BaseAIProvider->>Normalizer: normalizeSchemaForStructuredOutputs
  Normalizer-->>BaseAIProvider: strict sanitized schema
  BaseAIProvider->>OpenAI: generateObject with strict schema
  OpenAI-->>BaseAIProvider: structured output
  BaseAIProvider-->>Client: return result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • eyaltoledano
  • Crunchyman-ralph
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding gpt-5.5 support to Codex CLI with structured output normalization, which is the primary objective across multiple file modifications.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (6)
tests/unit/ai-providers/codex-cli-supported-models.test.js (1)

4-10: 💤 Low value

Resolve the catalog path relative to the test file, not process.cwd().

process.cwd() makes the test pass only when Jest is invoked from the repo root. Resolving via import.meta.url keeps the test stable regardless of working directory and is the idiomatic ESM equivalent of __dirname.

♻️ Proposed change
 import fs from 'fs';
 import path from 'path';
+import { fileURLToPath } from 'url';

-const supportedModelsPath = path.resolve(
-	process.cwd(),
-	'scripts/modules/supported-models.json'
-);
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+const supportedModelsPath = path.resolve(
+	__dirname,
+	'../../../scripts/modules/supported-models.json'
+);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/ai-providers/codex-cli-supported-models.test.js` around lines 4 -
10, The test currently resolves supportedModelsPath using process.cwd(), which
makes it fragile; change the resolution to be relative to the test file using
import.meta.url: import { fileURLToPath } from 'url' and compute const __dirname
= path.dirname(fileURLToPath(import.meta.url)), then build supportedModelsPath
with path.resolve(__dirname, '../../scripts/modules/supported-models.json') (or
the correct relative steps from the test file) so supportedModelsPath and the
JSON read (supportedModels) are stable regardless of the working directory.
tests/unit/ai-providers/codex-cli.test.js (1)

21-25: ⚡ Quick win

Add a test for the "no Codex anywhere" fallback.

You cover (a) system path detected and (b) explicit override, but not the case where getSystemCodexPath() returns null (e.g., execSync throws). Worth one more case asserting that defaultSettings is created without a codexPath key when neither config nor system provides one — that's the path most ChatGPT-OAuth users without @openai/codex globally installed will hit.

♻️ Suggested addition
+	it('omits codexPath when neither config nor system provides one', async () => {
+		const { execSync } = await import('child_process');
+		execSync.mockImplementationOnce(() => {
+			throw new Error('not found');
+		});
+
+		await provider.getClient({ commandName: 'parse-prd' });
+
+		const call = createCodexCli.mock.calls.at(-1)[0];
+		expect(call.defaultSettings.codexPath).toBeUndefined();
+	});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/ai-providers/codex-cli.test.js` around lines 21 - 25, Add a unit
test in tests/unit/ai-providers/codex-cli.test.js that simulates "no Codex
anywhere" by mocking child_process.execSync to throw so getSystemCodexPath()
returns null, then call the code-path that produces defaultSettings (the
function/flow that builds defaultSettings in the codex-cli module) and assert
the resulting defaultSettings object does NOT contain a codexPath key; this
ensures the fallback when neither config nor system-provided Codex exists is
covered.
src/ai-providers/base-provider.js (1)

57-119: ⚡ Quick win

Edge cases worth confirming in the recursive normalizer.

A few subtleties in normalizeSchemaForStructuredOutputs that you may want to nail down with explicit tests:

  • propertyKeys-based detection (isObjectSchema = next.type === 'object' || propertyKeys.length > 0) treats anything with properties as an object even when type is a nullable union like ['object','null']. That's likely fine, but additionalProperties:false will then be added to nullable object schemas as well — verify that's desirable for structured outputs.
  • oneOf/anyOf/allOf branches are recursed, but the parent schema still gets additionalProperties:false if it happens to define properties alongside the combinator. JSON Schema allows that combination but OpenAI strict mode is finicky about it.
  • items handling at line 98 only normalizes when truthy; tuple-style items: [] (empty array) is falsy in the existing check (if (next.items) is true for empty arrays actually — arrays are truthy), but you skip the array-of-schemas tuple form. Consider Array.isArray(next.items) and mapping each entry.

Non-blocking, but the schema test in tests/unit/ai-providers/base-provider-schema.test.js only covers a single happy-path object; adding a case with a pre-existing required, a nullable object, and a tuple-style items would lock the contract down.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ai-providers/base-provider.js` around lines 57 - 119, The recursive
normalizer normalizeSchemaForStructuredOutputs should: treat type arrays
(nullable unions) correctly by checking Array.isArray(next.type) and using
next.type.includes('object') when deciding isObjectSchema; avoid forcing
additionalProperties=false when the schema uses combinators (oneOf/anyOf/allOf)
by skipping that assignment if any of those keys exist on next; preserve an
existing next.required (don’t overwrite it with propertyKeys) and only set
required = propertyKeys when next.required is undefined; and handle tuple-style
items by checking Array.isArray(next.items) and mapping
normalizeSchemaForStructuredOutputs over each element (and otherwise recurse for
single-item schemas). Ensure these changes are applied inside
normalizeSchemaForStructuredOutputs and reference next, propertyKeys,
isObjectSchema, and next.items when implementing.
src/ai-providers/codex-cli.js (2)

46-62: ⚡ Quick win

Cache the system Codex path lookup; it currently spawns a subprocess per getClient call.

getClient is invoked for every text/object generation, and each call now runs execSync('command -v codex' | 'where codex') synchronously on the request thread when no explicit codexPath is configured. Even with timeout: 1000, that's avoidable overhead (and a synchronous syscall on the hot path). Cache it on the instance like the existing _codexCliChecked flag.

♻️ Proposed change
 	constructor() {
 		super();
 		...
 		// CLI availability check cache
 		this._codexCliChecked = false;
 		this._codexCliAvailable = null;
+		// System Codex path detection cache
+		this._systemCodexPathChecked = false;
+		this._systemCodexPath = null;
 	}
+
+	_resolveSystemCodexPath() {
+		if (!this._systemCodexPathChecked) {
+			this._systemCodexPath = getSystemCodexPath();
+			this._systemCodexPathChecked = true;
+		}
+		return this._systemCodexPath;
+	}
@@
-			const codexPath = settings.codexPath || getSystemCodexPath();
+			const codexPath = settings.codexPath || this._resolveSystemCodexPath();

Also applies to: 180-206

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ai-providers/codex-cli.js` around lines 46 - 62, The getSystemCodexPath
function is currently invoked on every getClient call and runs a synchronous
execSync lookup each time; cache the resolved system path on the instance
(similar to the existing _codexCliChecked flag) so the subprocess is only
spawned once: modify getClient (and the code paths around _codexCliChecked and
the fallback logic referenced at the block around 180-206) to first check an
instance property like _codexCliPath and only call getSystemCodexPath to
populate it once, store null if not found, and then reuse that cached
_codexCliPath on subsequent getClient calls to avoid repeated execSync
invocations.

46-62: 💤 Low value

Consider adding a clarifying comment on the command -v logic.

The shell implementation correctly uses command -v codex on POSIX systems, which is reliably available in /bin/sh across Alpine, Debian (dash), and macOS. This is more portable than which, which isn't guaranteed to exist on minimal Linux containers. A one-line comment (e.g., // 'command -v' is POSIX-compliant; avoids 'which' which may not exist in minimal environments) would prevent future readers from refactoring it to which.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ai-providers/codex-cli.js` around lines 46 - 62, In getSystemCodexPath(),
add a one-line clarifying comment above the command assignment explaining why we
use 'command -v codex' on POSIX systems (e.g., "'command -v' is POSIX-compliant
and available in /bin/sh; prefer it over 'which' which may be missing in minimal
containers") so future maintainers don't replace it with 'which'; place the
comment right next to the const command = ... line to make the intent obvious.
tests/unit/ai-providers/base-provider-schema.test.js (1)

90-125: ⚡ Quick win

Good baseline — please extend coverage to lock down the required contract.

The happy-path assertions look solid. To pin the contract precisely (and to catch regressions tied to the broader concern raised in base-provider.js), add at least one case that:

  1. Passes a schema where zodSchema mock returns required: ['title'] (caller-defined).
  2. Asserts whether the normalizer preserves it or overwrites with all keys.

That single test will document the intended behavior unambiguously and fail loudly if it's later changed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/ai-providers/base-provider-schema.test.js` around lines 90 - 125,
Add a new unit test that calls TestProvider.generateObject (same pattern as the
existing test) but mock the zod-to-json-schema call so it returns a schema with
required: ['title']; then assert against
mockJsonSchema.mock.calls[0][0].required to explicitly verify the normalizer's
contract (for example, expect it to equal ['title'] if you intend to preserve
caller-defined required, or expect the full set if you intend to override);
reference TestProvider.generateObject and mockJsonSchema when adding the
assertion so the behavior is pinned and will fail if changed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/ai-providers/base-provider.js`:
- Around line 102-116: The buildSafeSchema logic in
BaseAIProvider.generateObject currently overwrites caller-supplied required and
forces additionalProperties:false for every provider; change buildSafeSchema so
it only sets next.required = propertyKeys when next.required is undefined
(preserve any caller-provided required array) and only sets
next.additionalProperties = false if next.additionalProperties is undefined (do
not force it); additionally consider adding an opt-in boolean (e.g.
strictStructuredOutputs) on BaseAIProvider or generateObject so providers that
need OpenAI-strict semantics can opt into forcing all properties required (apply
the strict behavior only when strictStructuredOutputs is true).

---

Nitpick comments:
In `@src/ai-providers/base-provider.js`:
- Around line 57-119: The recursive normalizer
normalizeSchemaForStructuredOutputs should: treat type arrays (nullable unions)
correctly by checking Array.isArray(next.type) and using
next.type.includes('object') when deciding isObjectSchema; avoid forcing
additionalProperties=false when the schema uses combinators (oneOf/anyOf/allOf)
by skipping that assignment if any of those keys exist on next; preserve an
existing next.required (don’t overwrite it with propertyKeys) and only set
required = propertyKeys when next.required is undefined; and handle tuple-style
items by checking Array.isArray(next.items) and mapping
normalizeSchemaForStructuredOutputs over each element (and otherwise recurse for
single-item schemas). Ensure these changes are applied inside
normalizeSchemaForStructuredOutputs and reference next, propertyKeys,
isObjectSchema, and next.items when implementing.

In `@src/ai-providers/codex-cli.js`:
- Around line 46-62: The getSystemCodexPath function is currently invoked on
every getClient call and runs a synchronous execSync lookup each time; cache the
resolved system path on the instance (similar to the existing _codexCliChecked
flag) so the subprocess is only spawned once: modify getClient (and the code
paths around _codexCliChecked and the fallback logic referenced at the block
around 180-206) to first check an instance property like _codexCliPath and only
call getSystemCodexPath to populate it once, store null if not found, and then
reuse that cached _codexCliPath on subsequent getClient calls to avoid repeated
execSync invocations.
- Around line 46-62: In getSystemCodexPath(), add a one-line clarifying comment
above the command assignment explaining why we use 'command -v codex' on POSIX
systems (e.g., "'command -v' is POSIX-compliant and available in /bin/sh; prefer
it over 'which' which may be missing in minimal containers") so future
maintainers don't replace it with 'which'; place the comment right next to the
const command = ... line to make the intent obvious.

In `@tests/unit/ai-providers/base-provider-schema.test.js`:
- Around line 90-125: Add a new unit test that calls TestProvider.generateObject
(same pattern as the existing test) but mock the zod-to-json-schema call so it
returns a schema with required: ['title']; then assert against
mockJsonSchema.mock.calls[0][0].required to explicitly verify the normalizer's
contract (for example, expect it to equal ['title'] if you intend to preserve
caller-defined required, or expect the full set if you intend to override);
reference TestProvider.generateObject and mockJsonSchema when adding the
assertion so the behavior is pinned and will fail if changed.

In `@tests/unit/ai-providers/codex-cli-supported-models.test.js`:
- Around line 4-10: The test currently resolves supportedModelsPath using
process.cwd(), which makes it fragile; change the resolution to be relative to
the test file using import.meta.url: import { fileURLToPath } from 'url' and
compute const __dirname = path.dirname(fileURLToPath(import.meta.url)), then
build supportedModelsPath with path.resolve(__dirname,
'../../scripts/modules/supported-models.json') (or the correct relative steps
from the test file) so supportedModelsPath and the JSON read (supportedModels)
are stable regardless of the working directory.

In `@tests/unit/ai-providers/codex-cli.test.js`:
- Around line 21-25: Add a unit test in
tests/unit/ai-providers/codex-cli.test.js that simulates "no Codex anywhere" by
mocking child_process.execSync to throw so getSystemCodexPath() returns null,
then call the code-path that produces defaultSettings (the function/flow that
builds defaultSettings in the codex-cli module) and assert the resulting
defaultSettings object does NOT contain a codexPath key; this ensures the
fallback when neither config nor system-provided Codex exists is covered.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 06e3aab8-e89f-41d4-9d61-15d99e0dfdb6

📥 Commits

Reviewing files that changed from the base of the PR and between c0c98d3 and 2566be7.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • .changeset/fix-codex-cli-gpt55-structured-output.md
  • package.json
  • scripts/modules/supported-models.json
  • src/ai-providers/base-provider.js
  • src/ai-providers/codex-cli.js
  • tests/unit/ai-providers/base-provider-schema.test.js
  • tests/unit/ai-providers/codex-cli-supported-models.test.js
  • tests/unit/ai-providers/codex-cli.test.js

Comment thread src/ai-providers/base-provider.js

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/unit/ai-providers/codex-cli.test.js (1)

104-118: ⚡ Quick win

Consider verifying that system detection is skipped when config provides codexPath.

The test correctly verifies that the configured path takes precedence, but adding an assertion that execSync is not called would confirm the performance optimization and make the precedence behavior more explicit.

🔍 Proposed enhancement
 	it('preserves explicitly configured codexPath over system Codex path', async () => {
 		getCodexCliSettingsForCommand.mockReturnValueOnce({
 			allowNpx: true,
 			codexPath: '/custom/bin/codex'
 		});
 
 		await provider.getClient({ commandName: 'parse-prd' });
 
+		// Verify system detection is skipped when config provides path
+		expect(execSync).not.toHaveBeenCalled();
+
 		expect(createCodexCli).toHaveBeenCalledWith({
 			defaultSettings: expect.objectContaining({
 				allowNpx: true,
 				codexPath: '/custom/bin/codex'
 			})
 		});
 	});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/ai-providers/codex-cli.test.js` around lines 104 - 118, Add an
assertion that system detection via execSync is skipped when an explicit
codexPath is provided: after calling provider.getClient({ commandName:
'parse-prd' }) and the existing expect(createCodexCli)... check, add an
expectation that execSync (the mocked system detection function) was not called
(e.g., expect(execSync).not.toHaveBeenCalled()). This ensures
getCodexCliSettingsForCommand returning codexPath prevents any fallback system
discovery and makes the test assert the performance/precedence behavior
explicitly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/unit/ai-providers/codex-cli.test.js`:
- Around line 104-118: Add an assertion that system detection via execSync is
skipped when an explicit codexPath is provided: after calling
provider.getClient({ commandName: 'parse-prd' }) and the existing
expect(createCodexCli)... check, add an expectation that execSync (the mocked
system detection function) was not called (e.g.,
expect(execSync).not.toHaveBeenCalled()). This ensures
getCodexCliSettingsForCommand returning codexPath prevents any fallback system
discovery and makes the test assert the performance/precedence behavior
explicitly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5b33946b-ea98-4490-b02b-bf0eda43875d

📥 Commits

Reviewing files that changed from the base of the PR and between 2566be7 and a9aa95a.

📒 Files selected for processing (5)
  • src/ai-providers/base-provider.js
  • src/ai-providers/codex-cli.js
  • tests/unit/ai-providers/base-provider-schema.test.js
  • tests/unit/ai-providers/codex-cli-supported-models.test.js
  • tests/unit/ai-providers/codex-cli.test.js
🚧 Files skipped from review as they are similar to previous changes (4)
  • tests/unit/ai-providers/codex-cli-supported-models.test.js
  • tests/unit/ai-providers/base-provider-schema.test.js
  • src/ai-providers/base-provider.js
  • src/ai-providers/codex-cli.js

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b88e357. Configure here.

Comment thread src/ai-providers/base-provider.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant