A small logging proxy server for intercepting and logging code completion requests from copilot.

Overview

PilotWatch

PilotWatch is a small logging proxy server written in node.js for intercepting and logging code completion requests from Github's Copilot.

Run the PilotWatch Proxy

Assuming you have node.js properly installed the following command will download and run the PilotWatch proxy server on port 3000 and log all code completion requests to a sub-directory called "data" in the current working directory.

npx --yes github:johnrobinsn/pilotwatch

Note if you'd like to download the code for PilotWatch and run it locally, you can follow these directions.

Configure the Copilot Plugin

Next you need to configure the Copilot plugin in VSCode to point at the PilotWatch proxy. You can do this by adding the following lines to the VSCode settings.json file. On Linux you can find it at the following location:

${HOME}/.config/Code/User/settings.json

Add the following lines to that file.

    "github.copilot.advanced": {
        "debug.testOverrideProxyUrl": "http://localhost:3000",
        "debug.overrideProxyUrl": "http://localhost:3000"
    }

For other platforms, Please refer to the VSCode documentation.

Now as you use copilot normally you should see JSON files being created in a subdirectory called "data" in the current working directory for PilotWatch.

Each one of these JSON files represents a separate Copilot code completion request to the Copilot backend. They will each look something like this example:

{
  "timestamp": "20230505194816096",
  "completionid": "ead1bdbb-8bb1-4b17-b4d7-1245df3ae066",
  "request": {
    "prompt": "# Path: test.py\n# function to calculate the taylor series of sin(x) and cos(x)\ndef ",
    "suffix": "",
    "max_tokens": 500,
    "temperature": 0.2,
    "top_p": 1,
    "n": 3,
    "stop": [
      "\ndef ",
      "\nclass ",
      "\nif ",
      "\n\n#"
    ],
    "stream": true,
    "extra": {
      "language": "python",
      "next_indent": 0,
      "trim_by_indentation": true,
      "prompt_tokens": 28,
      "suffix_tokens": 0
    }
  },
  "responseHeaders": {
    "azureml-model-deployment": "xcfc31672b2a6",
    "content-security-policy": "default-src 'none'; sandbox",
    "content-type": "text/event-stream",
    "openai-processing-ms": "289.6858",
    "strict-transport-security": "max-age=31536000",
    "x-request-id": "41af5a31-6a5c-4787-8d67-d2c8c50fbb37",
    "date": "Fri, 05 May 2023 19:48:15 GMT",
    "connection": "close",
    "transfer-encoding": "chunked"
  },
  "response": [
    "sin_cos(x, n):\n    # initialize the sum\n    sum = 0.0\n    # loop over the first n terms in the sum\n    for i in range(n):\n        # calculate the ith term\n        term = ((-1)**i)*(x**(2*i+1))/math.factorial(2*i+1)\n        # add the ith term to the sum\n        sum += term\n    # return the sum\n    return sum",
    "sin_cos(x, n):\n    # initialize the sum to 0\n    sum = 0\n    # loop over the number of terms in the series\n    for i in range(n):\n        # calculate the numerator\n        num = (-1)**i * x**(2*i + 1)\n        # calculate the denominator\n        den = factorial(2*i + 1)\n        # add the term to the sum\n        sum += num / den\n    # return the sum\n    return sum",
    "sin_cos(x, n):\n    # initialize the sum\n    sum = 0.0\n    # loop over the first n terms in the series\n    for i in range(n):\n        # calculate the ith term in the series\n        term = ((-1)**i)*(x**(2*i+1))/math.factorial(2*i+1)\n        # add the term to the sum\n        sum += term\n    # return the sum\n    return sum"
  ]
}

You can also point your browser to the PilotWatch proxy to see a list of the captures and to visualize any of the captures. Just enter the following URL into your browser on the machine that is running PilotWatch.

http://localhost:3000

Command Line Args

PilotWatch offers the following command line args.

pilotwatch - copilot logging proxy

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show programs version number and exit
  -l LOG, --log LOG     LOG level: INFO | ERROR
  -p PORT, --port PORT  listen on specified port
  -d DATA, --data DATA  data directory

Download PilotWatch Code and Run Locally

For convenience I'd recommend using the npx command to run PilotWatch as described above. But if you'd like to modify PilotWatch or contribute to it you can clone the repo from github and run the proxy from your own sandbox.

git clone https://github.com/johnrobinsn/pilotwatch.git
cd pilotwatch/
npm i
npm start
You might also like...

GitHub completion for ddc.vim via gh

ddc-github GitHub completion for ddc.vim via gh These sources collect something related to GitHub (e.g. issues, pull requests) via gh, which is GitHub

Oct 18, 2022

Live demo using Angular, github.dev, codespaces, copilot, azure static web apps, and devcontainers

Live demo using Angular, github.dev, codespaces, copilot, azure static web apps, and devcontainers

One More Change! @ NgConf 2022 This is a quick project template for demoing github.dev, Codespaces, Copilot, Azure Static Web Apps, and Visual Studio

Dec 15, 2022

Live demo using Angular, github.dev, codespaces, copilot, azure static web apps, and devcontainers

Live demo using Angular, github.dev, codespaces, copilot, azure static web apps, and devcontainers

Cloud Computing with Codespaces First seen in the presentation One More Change! @ NgConf 2022 This is a quick project template for demoing github.dev,

Sep 13, 2022

A nonsensical React application made (almost) entirely by GitHub Copilot

GitHub Copilot Demo This is a demo project for the GitHub Copilot project. The previous sentence was written by it! This is a (fairly ugly) timer app

May 1, 2022

WPPConnect/WA-JS API SERVER is a small api server to provide url preview for @wppconnect/wa-js library

WPPConnect/WA-JS API SERVER WPPConnect/WA-JS API SERVER is a small api server to provide url preview for @wppconnect/wa-js library Our online channels

Aug 11, 2022

A fast and optimized middleware server with an absurdly small amount of code (300 lines) built on top of Deno's native HTTP APIs

A fast and optimized middleware server with an absurdly small amount of code (300 lines) built on top of Deno's native HTTP APIs with no dependencies. It also has a collection of useful middlewares: log file, serve static, CORS, session, rate limit, token, body parsers, redirect, proxy and handle upload. In "README" there are examples of all the resources. Faster's ideology is: all you need is an optimized middleware manager, all other functionality is middleware.

Dec 28, 2022

✏️ A small jQuery extension to turn a static HTML table into an editable one. For quickly populating a small table with JSON data, letting the user modify it with validation, and then getting JSON data back out.

jquery-editable-table A small jQuery extension to turn an HTML table editable for fast data entry and validation Demo 👉 https://jsfiddle.net/torrobin

Jul 31, 2022

A small javascript DOM manipulation library based on Jquery's syntax. Acts as a small utility library with the most common functions.

Quantdom JS Quantdom is a very small (about 600 bytes when ran through terser & gzipped) dom danipulation library that uuses a Jquery like syntax and

Aug 16, 2022

Unified JavaScript logging system. KISS, light and library free.

Logger.js Logger.js is a JavaScript ES6 module that offers a unified console output across Firefox and Chromium based browsers. It handles standard er

Oct 1, 2020
Owner
John Robinson
John Robinson
A alternative to Github Copilot for vscode until you get the access to github copilot

Clara-Copilot ?? Code Howdy ?? I know you guys are ?? waiting for Github Copilot Here is a alternative one for now ?? ⭐ Star is all i want nothing muc

BadBoy17G 245 Jan 8, 2023
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A Hackable Markdown Note Application for Programmers. Version control, AI completion, mind map, documents encryption, code snippet running, integrated terminal, chart embedding, HTML applets, plug-in, and macro replacement.

Yank Note A hackable markdown note application for programmers Download | Try it Online >>> Not ecommended English | 中文说明 [toc]{level: [2]} Highlights

洋子 4.3k Dec 31, 2022
🔐 Protect your Smart Contract Proxy from storage collisions upon upgrading, by running this action in a CI on each of your Pull Requests!

?? ??️ Foundry Storage Upgrade Seatbelt Protect your Smart Contract Proxy from storage collisions upon upgrading, by running this action in a CI on ea

Romain Milon 11 Dec 24, 2022
🏄‍♂️ Proxy POST/PUT/PATCH requests through a GET request

??‍♂️ to-GET Proxy POST/PUT/PATCH requests through a GET request Usage Base URL: https://toget.mihir.ch Endpoint: /:method Supported methods (case ins

Mihir Chaturvedi 4 Oct 2, 2022
proxy 🦄 yxorp is your Web Proxy as a Service (SAAS) Multi-tenant, Multi-Threaded, with Cache & Article Spinner

proxy ?? yxorp is your Web Proxy as a Service (SAAS) Multi-tenant, Multi-Threaded, with Cache & Article Spinner. Batteries are included, Content Spinning and Caching Engine, all housed within a stunning web GUI. A unique high-performance, plug-and-play, multi-threaded website mirror and article spinner

4D/ҵ.com Dashboards 13 Dec 30, 2022
Proxy but misspelled -- closed proxy for the internet

pyrox Proxy that runs on Cloudflare Workers. Setup Install wrangler2. npm install wrangler. Generate a public Ed25519 key, exported under SPKI mode wi

bots.gg 10 Sep 9, 2022
NFT stacking frontend completion using web3 on solana for client Nelson project.

NFT stacking frontend completion using web3 on solana for client Nelson project.

Kapollo 12 Dec 16, 2022