Skip to content

release: promote dev → main (settings model override fix)#59

Merged
namastex888 merged 4 commits intomainfrom
dev
Apr 9, 2026
Merged

release: promote dev → main (settings model override fix)#59
namastex888 merged 4 commits intomainfrom
dev

Conversation

@namastex888
Copy link
Copy Markdown
Collaborator

@namastex888 namastex888 commented Apr 9, 2026

Summary

  • Settings model override fix: rlmx config set model.provider now actually takes effect over rlmx.yaml defaults
  • Includes pi-ai 0.66.1 bump for OpenAI gpt-5.x support

Test plan

  • tsc --noEmit clean
  • CLI verified end-to-end with openai/gpt-5.4-mini via settings override
  • All CI checks green

Summary by CodeRabbit

  • New Features

    • Global model settings now take precedence over project-specific configurations in query, cache, batch, and benchmark operations, enabling streamlined cross-project model management.
  • Chores

    • Version updated to 0.260409.3.

github-actions Bot and others added 3 commits April 9, 2026 03:26
`rlmx config set model.provider openai` saved to settings.json but was
ignored when a local rlmx.yaml existed — the yaml model was always used.

Now the documented priority (CLI flags > settings.json > rlmx.yaml >
defaults) is actually enforced for model.provider, model.model, and
model.sub-call-model across run, cache, batch, and benchmark commands.
fix: settings model override not applied to CLI
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 9, 2026

📝 Walkthrough

Walkthrough

This PR bumps the package version from 0.260409.1 to 0.260409.3 and introduces global model settings override functionality in the CLI, applying global model provider configurations to per-project settings across query, cache, batch, and benchmark commands.

Changes

Cohort / File(s) Summary
Version Updates
package.json, src/version.ts
Version bumped from 0.260409.1 to 0.260409.3.
Global Settings Override
src/cli.ts
Added module-level _globalSettings storage populated in main(), introduced applySettingsModelOverrides() function to copy global model settings (provider, model, sub-call-model) to per-project config, and integrated it into runQuery, runCache, runBatchCommand, and runBenchmarkCommand paths after config loading.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A settings solution, so clever and neat,
Global configs now make commands complete,
Version bumps dancing from one point to three,
Model overrides flowing wild and free! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: a release promoting dev to main that fixes settings model overrides, which is confirmed by the PR description and code changes.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f561305eca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli.ts
const s = settings ?? _globalSettings;
const provider = s["model.provider"];
const model = s["model.model"];
const subCallModel = s["model.sub-call-model"];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Read the documented sub-call model setting key

The new override path reads model.sub-call-model, but the CLI documentation for rlmx config tells users to set model.sub_call_model; because runConfig stores keys verbatim, users following the documented key will never override config.model.subCallModel and sub-calls will continue using the YAML/default model unexpectedly. This can skew cost/latency experiments that rely on a cheaper sub-call model.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a mechanism to apply model overrides from global settings, ensuring that settings defined in ~/.rlmx/settings.json take precedence over local rlmx.yaml configurations. The review identified a high-severity bug where the key used for sub-call models is inconsistent with the documentation, preventing the override from functioning correctly. Additionally, a duplicate and misplaced JSDoc comment was noted in src/cli.ts.

Comment thread src/cli.ts
const s = settings ?? _globalSettings;
const provider = s["model.provider"];
const model = s["model.model"];
const subCallModel = s["model.sub-call-model"];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The key model.sub-call-model is inconsistent with the documentation in CONFIG_HELP (line 665), which specifies model.sub_call_model (using an underscore). Since the rlmx config set command uses the keys defined in the help text, the settings stored in settings.json will use underscores, causing this override logic to fail to find the value.

Suggested change
const subCallModel = s["model.sub-call-model"];
const subCallModel = s["model.sub_call_model"];

Comment thread src/cli.ts
Comment on lines +19 to +25
/**
* Apply model overrides from global settings (~/.rlmx/settings.json).
* Priority: CLI flags > settings.json > rlmx.yaml > hardcoded defaults.
*
* This ensures `rlmx config set model.provider openai` actually takes effect
* even when a local rlmx.yaml exists with its own model defaults.
*/
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This JSDoc block is a duplicate of the one provided for the applySettingsModelOverrides function at lines 29-35. It is also misplaced here as it precedes the _globalSettings variable rather than the function it describes.

Copy link
Copy Markdown

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/cli.ts (1)

19-35: Remove duplicated header comment block for override helper.

Lines 19-25 and 29-35 repeat the same doc content. Keeping one block improves readability.

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

In `@src/cli.ts` around lines 19 - 35, Remove the duplicated module-level doc
comment block that repeats the "Apply model overrides..." header; keep a single
copy immediately above the module-level reference declaration so the
module-level ref comment for _globalSettings: GlobalSettings remains documented
once. Ensure the retained comment explains the override priority and why it
exists, and delete the redundant second block without changing the
_globalSettings identifier or its type.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/cli.ts`:
- Around line 36-40: The applySettingsModelOverrides function only reads
s["model.sub-call-model"], so settings keyed with model.sub_call_model are
ignored; update the logic to accept both forms by reading subCallModel from
s["model.sub-call-model"] ?? s["model.sub_call_model"] (and similarly handle any
other model keys with hyphen/underscore variants) and then use that value in the
same places as the current subCallModel variable so underscore-named settings
are applied consistently alongside hyphen-named ones.

---

Nitpick comments:
In `@src/cli.ts`:
- Around line 19-35: Remove the duplicated module-level doc comment block that
repeats the "Apply model overrides..." header; keep a single copy immediately
above the module-level reference declaration so the module-level ref comment for
_globalSettings: GlobalSettings remains documented once. Ensure the retained
comment explains the override priority and why it exists, and delete the
redundant second block without changing the _globalSettings identifier or its
type.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9c35c867-e4a4-4934-ac5c-12dcd4d26b45

📥 Commits

Reviewing files that changed from the base of the PR and between 1a29697 and f561305.

📒 Files selected for processing (3)
  • package.json
  • src/cli.ts
  • src/version.ts

Comment thread src/cli.ts
Comment on lines +36 to +40
function applySettingsModelOverrides(config: RlmxConfig, settings?: GlobalSettings): void {
const s = settings ?? _globalSettings;
const provider = s["model.provider"];
const model = s["model.model"];
const subCallModel = s["model.sub-call-model"];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Support both model.sub-call-model and model.sub_call_model keys to avoid silent misses.

Line 40 only reads model.sub-call-model, but this file’s own help text (Line 665) still advertises model.sub_call_model. Settings created with underscore won’t be applied.

🔧 Proposed compatibility fix
 function applySettingsModelOverrides(config: RlmxConfig, settings?: GlobalSettings): void {
   const s = settings ?? _globalSettings;
   const provider = s["model.provider"];
   const model = s["model.model"];
-  const subCallModel = s["model.sub-call-model"];
+  const subCallModel = s["model.sub-call-model"] ?? s["model.sub_call_model"];
   if (typeof provider === "string" && provider) {
     config.model.provider = provider;
   }
   if (typeof model === "string" && model) {
     config.model.model = model;
   }
   if (typeof subCallModel === "string" && subCallModel) {
     config.model.subCallModel = subCallModel;
   }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function applySettingsModelOverrides(config: RlmxConfig, settings?: GlobalSettings): void {
const s = settings ?? _globalSettings;
const provider = s["model.provider"];
const model = s["model.model"];
const subCallModel = s["model.sub-call-model"];
function applySettingsModelOverrides(config: RlmxConfig, settings?: GlobalSettings): void {
const s = settings ?? _globalSettings;
const provider = s["model.provider"];
const model = s["model.model"];
const subCallModel = s["model.sub-call-model"] ?? s["model.sub_call_model"];
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/cli.ts` around lines 36 - 40, The applySettingsModelOverrides function
only reads s["model.sub-call-model"], so settings keyed with
model.sub_call_model are ignored; update the logic to accept both forms by
reading subCallModel from s["model.sub-call-model"] ?? s["model.sub_call_model"]
(and similarly handle any other model keys with hyphen/underscore variants) and
then use that value in the same places as the current subCallModel variable so
underscore-named settings are applied consistently alongside hyphen-named ones.

@namastex888 namastex888 merged commit 4eaca79 into main Apr 9, 2026
2 checks passed
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.

2 participants