Skip to content

Add getCallbackUri to the HostProvider #5361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 5, 2025
Merged

Add getCallbackUri to the HostProvider #5361

merged 3 commits into from
Aug 5, 2025

Conversation

sjf
Copy link
Contributor

@sjf sjf commented Aug 5, 2025

Resubmission of #5322 with fixes for test files.

The original PR broke the tests because the constructor of the HostProvider was updated in main after the PR was created. We need to run the tests against HEAD when the PR is merged, not just when it is sent for review.

Adds a util function to create a mock HostProvider for tests.


Important

Adds getCallbackUri to HostProvider and refactors tests to use a mock setup for improved testability.

  • Behavior:
    • Adds getCallbackUri method to HostProvider to return a callback URI for Cline.
    • Updates HostProvider.initialize() to include getCallbackUri parameter in host-provider.ts.
    • Modifies AuthHandler.getCallbackUri() to throw an error if not enabled in AuthHandler.ts.
  • Testing:
    • Introduces setVscodeHostProviderMock in host-provider-test-utils.ts for consistent test setup.
    • Refactors tests in FileContextTracker.test.ts, index.test.ts, TerminalProcess.test.ts, and cline-api.test.ts to use setVscodeHostProviderMock.
  • Misc:
    • Updates maybeSetupHostProviders in extension.ts and setupHostProvider in cline-core.ts to use getCallbackUri.

This description was created by Ellipsis for b80ec9a. You can customize this summary. It will automatically update as commits are pushed.

Copy link

changeset-bot bot commented Aug 5, 2025

⚠️ No Changeset found

Latest commit: b80ec9a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sjf sjf changed the title Add a util to set up the HostProvider for tests Add getCallbackUri to the HostProvider Aug 5, 2025
Copy link
Contributor

github-actions bot commented Aug 5, 2025

Coverage Report

Extension Coverage

Base branch: 47%

PR branch: 48%

✅ Coverage increased or remained the same

Webview Coverage

Base branch: 17%

PR branch: 17%

✅ Coverage increased or remained the same

Overall Assessment

Test coverage has been maintained or improved

Last updated: 2025-08-05T03:38:11.264798

@tseglevskiy tseglevskiy merged commit 0d067f7 into main Aug 5, 2025
13 checks passed
@sjf sjf deleted the sjf-a5-ap branch August 14, 2025 12:53
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.

3 participants