Skip to content

replace proxy #72

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

replace proxy #72

wants to merge 1 commit into from

Conversation

salvador-barboza
Copy link
Collaborator

No description provided.

@Copilot Copilot AI review requested due to automatic review settings June 18, 2025 22:22
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the local development proxy setup by replacing individual /\_spark/{service} routes with a single dynamic catch-all proxy to the GitHub API and injects authentication headers.

  • Introduce GITHUB_API_URL environment variable with a default fallback
  • Replace separate /\_spark/kv, /\_spark/llm, /\_spark/user proxies with one /\_spark/** rule
  • Add path rewriting to runtime/{GITHUB_RUNTIME_PERMANENT_NAME}/{serviceName} and GitHub token header injection
Comments suppressed due to low confidence (3)

vite.config.ts:77

  • [nitpick] This comment lists specific services but the code dynamically handles any service name. Update the comment to reflect that all /\_spark/{service} paths are supported.
          // Extract the service name (kv, llm, user) from the path

vite.config.ts:19

  • If GITHUB_API_URL or GITHUB_RUNTIME_PERMANENT_NAME is undefined or malformed, proxy paths may break. Consider validating or failing fast when these environment variables are missing.
const GITHUB_API_URL = process.env.GITHUB_API_URL || "https://api.github.com";

vite.config.ts:84

  • [nitpick] Accessing process.env.GITHUB_TOKEN on every request can incur overhead. Consider reading it once into a constant outside the request handler.
            if (process.env.GITHUB_TOKEN) {

@jasonrclark
Copy link
Member

This may need changes for the LLM path and status endpoints https://github.com/github/workbench-sdk/blob/main/spark-proxy/proxy.ts#L46

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