Skip to content

fix(config): require custom provider endpoint - #249

Open
404-Page-Found wants to merge 1 commit into
mainfrom
fix/201-require-custom-provider-url
Open

fix(config): require custom provider endpoint#249
404-Page-Found wants to merge 1 commit into
mainfrom
fix/201-require-custom-provider-url

Conversation

@404-Page-Found

Copy link
Copy Markdown
Contributor

Summary

Prevents config set provider __custom__ from saving a configuration that has no custom endpoint.

Changes

  • Validate the complete updated configuration before saving.
  • Reject custom-provider selections without a baseUrl.
  • Add command-level regression coverage.

Testing

  • npm run build
  • node --test tests/config-command.test.mjs

Related

Closes #201

Prevent saving custom provider configurations without a base URL.

Closes #201
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@404-Page-Found, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 46661973-55b4-4094-af22-495e57526868

📥 Commits

Reviewing files that changed from the base of the PR and between 76c6e18 and 327119e.

📒 Files selected for processing (2)
  • src/commands/config.ts
  • tests/config-command.test.mjs

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.

@404-Page-Found

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 327119e66f

ℹ️ 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/commands/config.ts
Comment on lines +109 to +110
if (updatedConfig.provider === CUSTOM_PROVIDER_KEY && !updatedConfig.baseUrl) {
throw new Error('Custom provider requires a configured baseUrl. Set baseUrl before selecting __custom__.');

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 Honor environment-provided custom endpoints

When COMMIT_ECHO_BASE_URL supplies the custom endpoint, config set provider __custom__ now fails because configSetCommand constructs this value from loadRawConfig(), so updatedConfig.baseUrl ignores the environment override. The same check also blocks every config set operation for an existing raw custom-provider config whose endpoint is environment-only, even though loadConfig() produces a valid runtime configuration. Accept the effective environment endpoint for validation without persisting it, since all config keys, including baseUrl, are supported through COMMIT_ECHO_* overrides.

AGENTS.md reference: AGENTS.md:L60-L60

Useful? React with 👍 / 👎.

@sonarqubecloud

Copy link
Copy Markdown

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.

[Config] config set provider __custom__ can save an unusable config without baseUrl

1 participant