1. An engineer is testing a locally running Copilot Extension backend on their development machine. Since GitHub must be able to reach the backend to deliver Copilot Chat messages, which tool or technique is MOST appropriate for enabling this during development?
- A. Deploy the backend to a staging environment on a cloud provider for every test iteration
- B. Use the GitHub Copilot Extension CLI with local tunneling (e.g., via a tool like ngrok or the CLI's built-in tunnel) to expose the local server to GitHub✓ Correct
- C. Configure a GitHub Actions workflow to spin up a runner that connects to the local machine
- D. Set the Copilot Agent URL to localhost in the GitHub App settings, since GitHub resolves localhost to the developer's machine
Explanation
The standard and recommended approach for local development of Copilot Extensions is to use local tunneling tools—such as ngrok, or the tunneling capability provided by the GitHub Copilot Extension CLI—which create a publicly reachable URL that forwards traffic to your local server. The Copilot Extension CLI is specifically designed to streamline this testing workflow. Option A is incorrect because re-deploying to a cloud environment for every test iteration is impractical and slow; local tunneling is the standard developer workflow. Option C is incorrect because GitHub Actions runners are ephemeral CI/CD workers and cannot be used to proxy traffic to a developer's local machine in the way described. Option D is incorrect because GitHub's servers cannot resolve 'localhost' to the developer's own machine—localhost refers to the machine running the process (GitHub's servers in this case), not the developer's workstation.