Skip to content

Improve model configuration resilience - #4

Merged
boh5 merged 1 commit into
mainfrom
codex/model-settings-fixes
Jul 29, 2026
Merged

Improve model configuration resilience#4
boh5 merged 1 commit into
mainfrom
codex/model-settings-fixes

Conversation

@boh5

@boh5 boh5 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • keep the Settings save footer inside the bounded dialog when apply or restart notices are visible
  • replace comma-delimited model modality inputs with accessible text, image, audio, and video multi-select controls
  • allow model variant edits to save when a Profile still references a removed variant
  • mark affected Profiles with visible and accessible attention states
  • resolve missing Profile variants to the model default while preserving Profile call options
  • normalize empty Profile variants to Default and reject empty variant names
  • surface the concrete configuration validation message in Settings

Root cause

The apply notice and Settings workspace each claimed the dialog height, which pushed the footer beyond the visible boundary. The modality text input normalized its controlled value after every keystroke, so users could not naturally type a comma-separated second value. Variant replacement was rejected by whole-document validation when an existing Profile referenced a removed key, even though the model itself remained usable.

User impact

Users can always reach the save action, select modalities without editing delimiter syntax, and save a valid model variant map without first coordinating every Profile reference. Profiles that need repair remain explicit, while execution deterministically uses the model default until the reference is fixed.

Validation

  • Agent Core unit tests: 2,793 passed
  • Web unit and interaction tests: 651 passed
  • Agent Core TypeScript check passed
  • Web TypeScript check passed
  • Web production build passed
  • git diff --check passed
  • browser-level Settings layout and interaction QA completed

Review in cubic

Summary by CodeRabbit

  • New Features
    • Edit model input/output modalities using checkbox controls.
    • Settings now detects missing Profile variants, highlights the Profiles section, and explains that runtime falls back to the model default.
  • Bug Fixes
    • Empty Profile variant values now correctly normalize to “model default.”
    • Saving configs with removed variants preserves the referenced variant and applies the model-default fallback at runtime.
    • Configuration validation errors now surface more reliably in the dialog.
  • Documentation
    • Updated documentation for behavior with removed or empty Profile variants.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Profile variant parsing and runtime fallback behavior now support removed variants. Settings highlights affected Profiles, preserves references on save, and replaces modality text inputs with accessible checkbox controls alongside updated layout and interaction coverage.

Changes

Profile variant configuration and runtime

Layer / File(s) Summary
Normalize and resolve profile variants
packages/agent-core/src/config/..., packages/agent-core/src/models/..., docs/configuration.md
Empty variants normalize to undefined, empty model variant keys are rejected, missing profile variants remain saveable, and runtime resolution falls back to model defaults.
Validation and persistence coverage
packages/agent-core/src/config/*test.ts, packages/agent-core/src/models/*test.ts
Tests cover normalized empty variants, persisted removed variants, runtime fallback behavior, and continued rejection of unknown models.
Surface invalid profile variants
apps/web/src/components/features/settings-helpers.ts, apps/web/src/components/features/SettingsDialog.tsx, apps/web/src/components/features/settings-panels.tsx, apps/web/src/components/features/SettingsDialog.interaction.tsx
Settings detects missing profile variants, marks Profiles for attention, displays invalid selections, and verifies that affected references remain in saved configuration.

Settings controls

Layer / File(s) Summary
Update settings controls and interactions
apps/web/src/components/features/settings-panels.tsx, apps/web/src/components/features/SettingsDialog.tsx, apps/web/src/components/features/SettingsDialog.interaction.tsx
Modality editing uses accessible checkbox controls, the final selected modality cannot be disabled, layout wrappers constrain the notice and workspace, and interaction selectors use ARIA labels.
🚥 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
Title check ✅ Passed It clearly matches the main change: making model configuration handling more resilient.
Description check ✅ Passed Mostly matches the template and includes the key sections, though it omits the explicit Why section and checklist/issue fields.
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.

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

@boh5
boh5 marked this pull request as ready for review July 29, 2026 09:37
@cubic-dev-ai

cubic-dev-ai Bot commented Jul 29, 2026

Copy link
Copy Markdown

We've triggered an ultrareview automatically — This PR changes core model configuration validation and resolution logic, including replacing a strict validation error with a silent fallback for missing profile variants; a subtle bug could cause incorrect model selection across all profiles, making multi-pass review valuable.. I'll post findings when complete.

An ultrareview is cubic's deepest review, catching hard-to-find bugs in the most critical PRs. It runs a longer, multi-pass analysis using cubic's most capable review models, and typically takes around 30 minutes. It consumes your team's reviewed-lines allowance at 3× the standard rate.

Automated ultrareviews are disabled by default. We triggered this run as part of your trial. Want cubic to do this for every high-risk PR? Enable auto-ultrareview in your settings.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 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 `@apps/web/src/components/features/settings-panels.tsx`:
- Around line 34-73: Update the onChange handler in ModalityField to preserve
modality values from the original value that are not present in
MODEL_MODALITIES, while still applying the checkbox change and maintaining the
tuple’s ordering for recognized entries. Emit the combined result through
onChange so toggling a checkbox cannot discard unrecognized entries.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d7abcc7e-e311-40b3-b12d-f08d7bdcace3

📥 Commits

Reviewing files that changed from the base of the PR and between a8fe439 and 52ed6b5.

📒 Files selected for processing (12)
  • apps/web/src/components/features/SettingsDialog.interaction.tsx
  • apps/web/src/components/features/SettingsDialog.tsx
  • apps/web/src/components/features/settings-helpers.ts
  • apps/web/src/components/features/settings-panels.tsx
  • docs/configuration.md
  • packages/agent-core/src/config/config.test.ts
  • packages/agent-core/src/config/provider.ts
  • packages/agent-core/src/config/schema.ts
  • packages/agent-core/src/config/server-config-service.test.ts
  • packages/agent-core/src/config/server-config-service.ts
  • packages/agent-core/src/models/model-runtime-snapshot.ts
  • packages/agent-core/src/models/model-selection-resolver.test.ts
💤 Files with no reviewable changes (1)
  • packages/agent-core/src/config/server-config-service.ts

Comment thread apps/web/src/components/features/settings-panels.tsx

@cubic-dev-ai cubic-dev-ai 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.

Ultrareview completed in 12m 5s

All reported issues were addressed across 12 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/agent-core/src/config/server-config-service.ts
Comment thread apps/web/src/components/features/SettingsDialog.interaction.tsx Outdated
Comment thread apps/web/src/components/features/SettingsDialog.tsx
@boh5
boh5 force-pushed the codex/model-settings-fixes branch from 52ed6b5 to 68e1e58 Compare July 29, 2026 10:01

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
packages/agent-core/src/config/server-config-service.test.ts (1)

517-535: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Exercise Profile call-option preservation in both fallback paths.

Both tests use fast without options, so they would pass even if removed- or empty-variant resolution dropped Profile call options. Add a valid Profile option and assert it remains in the saved config and resolved runtime default.

Also applies to: 538-554

🤖 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 `@packages/agent-core/src/config/server-config-service.test.ts` around lines
517 - 535, Update both fallback tests, including “saves a missing Profile
variant and publishes its model-default fallback” and the empty-variant test, to
set a valid Profile call option on fast. Assert that the option is preserved in
the saved config and in both resolved runtime defaults returned by
getProfileDefault and catalog.profileDefaults, covering removed- and
empty-variant resolution paths.
🤖 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 `@packages/agent-core/src/config/server-config-service.test.ts`:
- Around line 517-535: Update both fallback tests, including “saves a missing
Profile variant and publishes its model-default fallback” and the empty-variant
test, to set a valid Profile call option on fast. Assert that the option is
preserved in the saved config and in both resolved runtime defaults returned by
getProfileDefault and catalog.profileDefaults, covering removed- and
empty-variant resolution paths.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 053a9cd4-a958-40a8-8318-cf3677342291

📥 Commits

Reviewing files that changed from the base of the PR and between 52ed6b5 and 68e1e58.

📒 Files selected for processing (12)
  • apps/web/src/components/features/SettingsDialog.interaction.tsx
  • apps/web/src/components/features/SettingsDialog.tsx
  • apps/web/src/components/features/settings-helpers.ts
  • apps/web/src/components/features/settings-panels.tsx
  • docs/configuration.md
  • packages/agent-core/src/config/config.test.ts
  • packages/agent-core/src/config/provider.ts
  • packages/agent-core/src/config/schema.ts
  • packages/agent-core/src/config/server-config-service.test.ts
  • packages/agent-core/src/config/server-config-service.ts
  • packages/agent-core/src/models/model-runtime-snapshot.ts
  • packages/agent-core/src/models/model-selection-resolver.test.ts
💤 Files with no reviewable changes (1)
  • packages/agent-core/src/config/server-config-service.ts
🚧 Files skipped from review as they are similar to previous changes (9)
  • packages/agent-core/src/config/schema.ts
  • packages/agent-core/src/config/provider.ts
  • packages/agent-core/src/config/config.test.ts
  • apps/web/src/components/features/SettingsDialog.tsx
  • apps/web/src/components/features/settings-helpers.ts
  • packages/agent-core/src/models/model-runtime-snapshot.ts
  • apps/web/src/components/features/settings-panels.tsx
  • packages/agent-core/src/models/model-selection-resolver.test.ts
  • apps/web/src/components/features/SettingsDialog.interaction.tsx

@boh5
boh5 merged commit ee62f7e into main Jul 29, 2026
7 checks passed
@boh5
boh5 deleted the codex/model-settings-fixes branch July 29, 2026 10:06
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