Skip to content

fix(agents): include codex mcp resume install setting in shape#113

Open
cdenneen wants to merge 1 commit intohappier-dev:devfrom
cdenneen:fix/codex-mcp-resume-settings-shape
Open

fix(agents): include codex mcp resume install setting in shape#113
cdenneen wants to merge 1 commit intohappier-dev:devfrom
cdenneen:fix/codex-mcp-resume-settings-shape

Conversation

@cdenneen
Copy link

@cdenneen cdenneen commented Mar 6, 2026

Summary

  • add codexMcpResumeInstallSpec to Codex provider defaults in packages/agents
  • add codexMcpResumeInstallSpec to Codex provider settings shape validation
  • add a focused unit test that guards shape/default parity for this field

Why

apps/ui registers this field in the Codex provider plugin, but packages/agents did not define it in shape/defaults. This caused runtime plugin-registry validation failures in UI tests.

Validation

  • yarn workspace @happier-dev/agents test src/providerSettings/definitions/codex.settingsShape.test.ts

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for MCP resume installation specification in Codex provider configuration.
  • Tests

    • Implemented validation tests to ensure provider settings configuration consistency with defined defaults.

@cdenneen
Copy link
Author

cdenneen commented Mar 6, 2026

@coderabbitai review

@cdenneen
Copy link
Author

cdenneen commented Mar 6, 2026

@greptile review

@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Walkthrough

The changes add a new codexMcpResumeInstallSpec setting to the Codex provider configuration with an empty string default value, along with corresponding unit tests to verify its presence in both the settings shape definition and defaults object.

Changes

Cohort / File(s) Summary
Codex Provider Settings
packages/agents/src/providerSettings/definitions/codex.ts, packages/agents/src/providerSettings/definitions/codex.settingsShape.test.ts
Adds codexMcpResumeInstallSpec property (string type) to Codex provider settings defaults with empty string value and includes unit test assertions verifying the property exists in both the settings shape and defaults.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Description check ❓ Inconclusive The description covers key sections but is missing the 'How to test' section with step-by-step verification and omits the required checklist. Add a 'How to test' section with clear step-by-step instructions and include the full checklist with checkboxes to meet the template requirements.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding the codex mcp resume install setting to the provider settings shape.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 6, 2026

Greptile Summary

This PR fixes a shape/default mismatch in packages/agents by adding codexMcpResumeInstallSpec to both CODEX_PROVIDER_SETTINGS_DEFAULTS and buildCodexProviderSettingsShape, closing a validation gap that caused runtime plugin-registry failures in UI tests.

Key changes:

  • codex.ts: codexMcpResumeInstallSpec: '' added to frozen defaults object and codexMcpResumeInstallSpec: zod.string() added to the shape builder — both following the exact same pattern already established by codexAcpInstallSpec.
  • codex.settingsShape.test.ts: New focused unit test that asserts the field is present in both shape and defaults, preventing the same regression from reappearing silently.
  • The field is consumed by apps/ui's installablesRegistry (as installSpecSettingKey) and surfaced as a user-editable text field in the Codex settings plugin UI — the agents package was simply missing its half of the contract.
  • No behavioural logic changes; resolveCodexSpawnExtrasFromSettings and CODEX_PROVIDER_SETTINGS_DEFINITION are untouched.

Confidence Score: 5/5

  • Safe to merge — the change is additive, consistent with existing patterns, and directly resolves a documented validation failure.
  • The diff is two-line additions that mirror an already-working field (codexAcpInstallSpec), are validated by a new unit test, and are confirmed to be what apps/ui expects. No logic, transforms, or existing defaults are altered. The test is appropriately focused on guarding the specific parity issue that prompted this fix.
  • No files require special attention.

Last reviewed commit: 3635b0c

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/agents/src/providerSettings/definitions/codex.settingsShape.test.ts (1)

13-14: Avoid pinning the exact default string here.

packages/agents/src/providerSettings/registry.ts already covers shape/default key parity across providers, so the highest-value check in this test is that the field exists. Locking the default to '' makes this test noisier than necessary unless that exact value is part of the public contract.

♻️ Suggested tightening
     expect(shape).toHaveProperty('codexMcpResumeInstallSpec');
-    expect(CODEX_PROVIDER_SETTINGS_DEFAULTS).toHaveProperty('codexMcpResumeInstallSpec', '');
+    expect(CODEX_PROVIDER_SETTINGS_DEFAULTS).toHaveProperty('codexMcpResumeInstallSpec');
+    expect(typeof CODEX_PROVIDER_SETTINGS_DEFAULTS.codexMcpResumeInstallSpec).toBe('string');

Based on learnings: Applies to **/*.{test,spec}.{ts,tsx} : Avoid brittle 'content policing' tests that pin default config values, exact Markdown wording/format/length, or user-facing copy unless copy itself is the product requirement.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/agents/src/providerSettings/definitions/codex.settingsShape.test.ts`
around lines 13 - 14, The test currently asserts an exact default value for
CODEX_PROVIDER_SETTINGS_DEFAULTS.codexMcpResumeInstallSpec which is brittle;
change the test to only assert the presence of the key/shape (keep
expect(shape).toHaveProperty('codexMcpResumeInstallSpec')) and remove the
assertion that pins CODEX_PROVIDER_SETTINGS_DEFAULTS to ''. Update the test to
not reference the exact string default (leave CODEX_PROVIDER_SETTINGS_DEFAULTS
existence checks only) so shape/default parity is still covered by registry.ts
without locking this test to a specific default value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@packages/agents/src/providerSettings/definitions/codex.settingsShape.test.ts`:
- Around line 13-14: The test currently asserts an exact default value for
CODEX_PROVIDER_SETTINGS_DEFAULTS.codexMcpResumeInstallSpec which is brittle;
change the test to only assert the presence of the key/shape (keep
expect(shape).toHaveProperty('codexMcpResumeInstallSpec')) and remove the
assertion that pins CODEX_PROVIDER_SETTINGS_DEFAULTS to ''. Update the test to
not reference the exact string default (leave CODEX_PROVIDER_SETTINGS_DEFAULTS
existence checks only) so shape/default parity is still covered by registry.ts
without locking this test to a specific default value.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 72084cdb-7de7-497a-88fe-c218b941b809

📥 Commits

Reviewing files that changed from the base of the PR and between cd992ae and 3635b0c.

📒 Files selected for processing (2)
  • packages/agents/src/providerSettings/definitions/codex.settingsShape.test.ts
  • packages/agents/src/providerSettings/definitions/codex.ts

@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Walkthrough

The changes add a new codexMcpResumeInstallSpec string field to the Codex provider settings with a default value of an empty string, and include a unit test to verify parity between the settings shape and defaults configuration.

Changes

Cohort / File(s) Summary
Codex Provider Settings
packages/agents/src/providerSettings/definitions/codex.ts, packages/agents/src/providerSettings/definitions/codex.settingsShape.test.ts
Added new codexMcpResumeInstallSpec string field to the Codex provider settings shape with empty string default; includes unit test verifying the field exists in both shape definition and defaults object.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a missing codex MCP resume install setting to the provider settings shape.
Description check ✅ Passed The description includes Summary, Why, and Validation sections covering the changes and rationale, though it omits the formal checklist and some optional template sections.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/agents/src/providerSettings/definitions/codex.settingsShape.test.ts (1)

9-16: Test structure looks good, though the value assertion is somewhat redundant.

The registry validation in registry.ts already enforces shape/defaults parity at build time (throws if keys are missing). This test adds fast unit-level feedback, which is useful.

One minor note: asserting the exact default value '' on line 14 could be slightly brittle if someone needs to change the default later. The presence check on line 13 already verifies the field exists in the shape. Consider whether pinning the exact value is necessary, or if just checking toHaveProperty('codexMcpResumeInstallSpec') for both would suffice.

That said, for a "spec" field, an empty string default is a reasonable invariant to verify.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/agents/src/providerSettings/definitions/codex.settingsShape.test.ts`
around lines 9 - 16, The test currently asserts an exact default value for
codexMcpResumeInstallSpec which is brittle; update the test so it only checks
that the defaults object has the key instead of pinning the value: locate the
test using buildCodexProviderSettingsShape and CODEX_PROVIDER_SETTINGS_DEFAULTS
and replace the expectation
expect(CODEX_PROVIDER_SETTINGS_DEFAULTS).toHaveProperty('codexMcpResumeInstallSpec',
'') with a presence check like toHaveProperty('codexMcpResumeInstallSpec') so
the shape/default parity is still verified without locking the specific default
string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@packages/agents/src/providerSettings/definitions/codex.settingsShape.test.ts`:
- Around line 9-16: The test currently asserts an exact default value for
codexMcpResumeInstallSpec which is brittle; update the test so it only checks
that the defaults object has the key instead of pinning the value: locate the
test using buildCodexProviderSettingsShape and CODEX_PROVIDER_SETTINGS_DEFAULTS
and replace the expectation
expect(CODEX_PROVIDER_SETTINGS_DEFAULTS).toHaveProperty('codexMcpResumeInstallSpec',
'') with a presence check like toHaveProperty('codexMcpResumeInstallSpec') so
the shape/default parity is still verified without locking the specific default
string.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 988aa271-3d28-43df-ba9d-d7b78a1bfe92

📥 Commits

Reviewing files that changed from the base of the PR and between cd992ae and 3635b0c.

📒 Files selected for processing (2)
  • packages/agents/src/providerSettings/definitions/codex.settingsShape.test.ts
  • packages/agents/src/providerSettings/definitions/codex.ts

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