Skip to content
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

Use Continue/version as the user-agent in customFetch #3874

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jhrozek
Copy link

@jhrozek jhrozek commented Jan 28, 2025

Description

When continue is frontent by a proxy (such as codegate), the proxy
benefits from knowing who it is that is talking to it instead of a
generic JS user-agent.

This patch enhances the requestOptions with a custom header set to
Continue+version.

Checklist

  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screenshots

N/A

Testing instructions

N/A

Copy link

netlify bot commented Jan 28, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit dc56ccb
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/67a27b0ce639b1000833111c

@jhrozek
Copy link
Author

jhrozek commented Jan 28, 2025

Oops sorry:

    SyntaxError: The requested module '../package.json' does not provide an export named 'version'

      at Runtime.linkAndEvaluateModule (node_modules/jest-runtime/build/index.js:708:5)

I gotta look at this, I wonder why the code worked locally for me when I ran the extension.

@jhrozek jhrozek force-pushed the user-agent-in-fetch branch from 3af6cb6 to b604e3e Compare January 31, 2025 12:33
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:33 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:34 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:37 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:37 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:37 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:37 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:37 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:37 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:37 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:37 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:37 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:37 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:37 — with GitHub Actions Inactive
@jhrozek jhrozek temporarily deployed to tests-requiring-secrets January 31, 2025 12:37 — with GitHub Actions Inactive
@jhrozek
Copy link
Author

jhrozek commented Jan 31, 2025

The checks that were failing earlier are now passing. I'm not sure if the tests that are failing now are related to my changes and it seems that I lack the permissions to re-run them.

When continue is frontent by a proxy (such as codegate), the proxy
benefits from knowing who it is that is talking to it instead of a
generic JS user-agent.

This patch enhances the requestOptions with a custom header set to
Continue+version.
@jhrozek jhrozek force-pushed the user-agent-in-fetch branch from b604e3e to 2cabcef Compare February 3, 2025 10:45
@jhrozek
Copy link
Author

jhrozek commented Feb 3, 2025

resolved conflicts, no other changes

@jhrozek
Copy link
Author

jhrozek commented Feb 6, 2025

@sestinj is this something that continue would be interested in merging? Only after opening this PR did I notice PR #2988 so the answer might very well be "no" - that's fine, but in that case, would Continue be interested in merging a custom header (e.g. x-coding-assistant: continue) ?

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