Skip to content

🐛 Add enabled property to llm proxy client#1374

Merged
djzager merged 5 commits into
konveyor:mainfrom
abrugaro:1365-llm-proxy-bug
Apr 29, 2026
Merged

🐛 Add enabled property to llm proxy client#1374
djzager merged 5 commits into
konveyor:mainfrom
abrugaro:1365-llm-proxy-bug

Conversation

@abrugaro

@abrugaro abrugaro commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Resolves #1365

Operator PR with new configmap property: konveyor/operator#558

If the enabled property is not present in the configmap, it is assumed to be true to ensure compatibility with older versions of the operator. To prevent the bug from occurring, both the operator and the extension will need to be updated

Summary by CodeRabbit

  • Bug Fixes
    • The LLM proxy client now supports an enabled configuration setting to control whether the proxy is active in your environment.

Signed-off-by: Alejandro Brugarolas <abrugaro@redhat.com>
@abrugaro abrugaro self-assigned this Apr 29, 2026
@abrugaro abrugaro requested a review from a team as a code owner April 29, 2026 11:04
@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

These changes address the issue where the LLM proxy client was attempting connections despite being disabled by operators. An enabled property has been added to the LLM proxy client configuration. The ProfileSyncClient now reads this field from the Hub-provided configuration, normalizing both boolean and string representations (treating "false" and false as disabled). When disabled, the client sets the proxy as unavailable and exits early instead of attempting connection. A changelog entry documents this bugfix.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: adding an enabled property to the LLM proxy client to respect the operator's disabled state.
Description check ✅ Passed The PR description provides necessary context including issue reference, operator PR link, and backward compatibility approach, though it doesn't follow the template format with emoji prefix.
Linked Issues check ✅ Passed The code changes directly address issue #1365 by adding the enabled property handling to prevent connection attempts when the proxy is disabled by the operator.
Out of Scope Changes check ✅ Passed All changes are scoped to implementing the enabled property feature and updating changelog, with no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

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

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

Signed-off-by: Alejandro Brugarolas <abrugaro@redhat.com>
Signed-off-by: Alejandro Brugarolas <abrugaro@redhat.com>
Signed-off-by: Alejandro Brugarolas <abrugaro@redhat.com>
@djzager

djzager commented Apr 29, 2026

Copy link
Copy Markdown
Member

Adding release-0.4 cherry-pick label. Remove if I'm wrong please.

Comment thread changes/unreleased/1374-add-enavled-property-to-llmproxy-client.yaml Outdated
Signed-off-by: Alejandro Brugarolas <abrugaro@redhat.com>

@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 (2)
changes/unreleased/1374-add-enavled-property-to-llmproxy-client.yaml (1)

1-3: Consider fixing the changelog filename typo (enavledenabled).

The content is fine, but correcting the filename spelling will keep changelog entries easier to scan and search.

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

In `@changes/unreleased/1374-add-enavled-property-to-llmproxy-client.yaml` around
lines 1 - 3, The changelog filename contains a typo ("enavled"); rename the file
from 1374-add-enavled-property-to-llmproxy-client.yaml to
1374-add-enabled-property-to-llmproxy-client.yaml and update any references (CI,
release tooling, or changelog indexes) that mention the old filename so searches
and automated tooling use the corrected "enabled" spelling.
vscode/core/src/clients/ProfileSyncClient.ts (1)

182-200: Add focused tests for enabled normalization and fallback behavior.

Please add coverage for at least: enabled: false, enabled: "false", and missing enabled (defaults to true) to prevent regressions in proxy routing.

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

In `@vscode/core/src/clients/ProfileSyncClient.ts` around lines 182 - 200, Add
unit tests for ProfileSyncClient that exercise the LLM proxy config
normalization branch where rawConfig may be a string or object: specifically
test when enabled is false (boolean), enabled is "false" (string), and when
enabled is omitted (should default to true). Instantiate or call the method that
parses rawConfig (the code path that produces config and sets
this.llmProxyConfig / logs, i.e., the LLM proxy config fetch/normalize logic in
ProfileSyncClient) with each variant and assert the resulting
this.llmProxyConfig.available flag and endpoint, plus that logs or returned
config.model/ enabled match expectations to ensure proxy routing/fallback
behaves correctly. Make tests cover both stringified JSON input and object input
to match the existing typeof rawConfig === "string" branch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@changes/unreleased/1374-add-enavled-property-to-llmproxy-client.yaml`:
- Around line 1-3: The changelog filename contains a typo ("enavled"); rename
the file from 1374-add-enavled-property-to-llmproxy-client.yaml to
1374-add-enabled-property-to-llmproxy-client.yaml and update any references (CI,
release tooling, or changelog indexes) that mention the old filename so searches
and automated tooling use the corrected "enabled" spelling.

In `@vscode/core/src/clients/ProfileSyncClient.ts`:
- Around line 182-200: Add unit tests for ProfileSyncClient that exercise the
LLM proxy config normalization branch where rawConfig may be a string or object:
specifically test when enabled is false (boolean), enabled is "false" (string),
and when enabled is omitted (should default to true). Instantiate or call the
method that parses rawConfig (the code path that produces config and sets
this.llmProxyConfig / logs, i.e., the LLM proxy config fetch/normalize logic in
ProfileSyncClient) with each variant and assert the resulting
this.llmProxyConfig.available flag and endpoint, plus that logs or returned
config.model/ enabled match expectations to ensure proxy routing/fallback
behaves correctly. Make tests cover both stringified JSON input and object input
to match the existing typeof rawConfig === "string" branch.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 67f43eb4-157a-46cb-9410-f0a9afdbd842

📥 Commits

Reviewing files that changed from the base of the PR and between 591e016 and ecfa8f7.

📒 Files selected for processing (2)
  • changes/unreleased/1374-add-enavled-property-to-llmproxy-client.yaml
  • vscode/core/src/clients/ProfileSyncClient.ts

@abrugaro abrugaro requested a review from djzager April 29, 2026 14:04
@djzager djzager merged commit 3d97606 into konveyor:main Apr 29, 2026
22 checks passed
@konveyor-ci-bot

Copy link
Copy Markdown

PR cherry-picked to branch release-0.4. Backport PR: #1378

djzager pushed a commit that referenced this pull request May 1, 2026
Resolves #1365

Operator PR with new configmap property:
konveyor/operator#558

If the `enabled` property is not present in the configmap, it is assumed
to be true to ensure compatibility with older versions of the operator.
To prevent the bug from occurring, both the operator and the extension
will need to be updated

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* The LLM proxy client now supports an `enabled` configuration setting
to control whether the proxy is active in your environment.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Alejandro Brugarolas <abrugaro@redhat.com>
Signed-off-by: Cherry Picker <noreply@github.com>

Signed-off-by: Alejandro Brugarolas <abrugaro@redhat.com>
Signed-off-by: Cherry Picker <noreply@github.com>
Co-authored-by: Alejandro Brugarolas <117646518+abrugaro@users.noreply.github.com>
ibolton336 pushed a commit to ibolton336/editor-extensions that referenced this pull request May 1, 2026
Resolves konveyor#1365

Operator PR with new configmap property:
konveyor/operator#558

If the `enabled` property is not present in the configmap, it is assumed
to be true to ensure compatibility with older versions of the operator.
To prevent the bug from occurring, both the operator and the extension
will need to be updated

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* The LLM proxy client now supports an `enabled` configuration setting
to control whether the proxy is active in your environment.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Alejandro Brugarolas <abrugaro@redhat.com>
Signed-off-by: ibolton336 <ibolton@redhat.com>
ibolton336 pushed a commit to ibolton336/editor-extensions that referenced this pull request May 20, 2026
Resolves konveyor#1365

Operator PR with new configmap property:
konveyor/operator#558

If the `enabled` property is not present in the configmap, it is assumed
to be true to ensure compatibility with older versions of the operator.
To prevent the bug from occurring, both the operator and the extension
will need to be updated

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* The LLM proxy client now supports an `enabled` configuration setting
to control whether the proxy is active in your environment.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Alejandro Brugarolas <abrugaro@redhat.com>
Signed-off-by: ibolton336 <ibolton@redhat.com>
ibolton336 pushed a commit to ibolton336/editor-extensions that referenced this pull request Jun 9, 2026
Resolves konveyor#1365

Operator PR with new configmap property:
konveyor/operator#558

If the `enabled` property is not present in the configmap, it is assumed
to be true to ensure compatibility with older versions of the operator.
To prevent the bug from occurring, both the operator and the extension
will need to be updated

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* The LLM proxy client now supports an `enabled` configuration setting
to control whether the proxy is active in your environment.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Alejandro Brugarolas <abrugaro@redhat.com>
Signed-off-by: ibolton336 <ibolton@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LLM proxy attempts connection even when disabled by operator

2 participants