Night‑Rider Docs

Knight Rider Copilot Documentation

Comprehensive guide for compiling, optimizing, and running the Knight Rider Copilot extension inside local VS Code and resource-constrained environments like GitHub Codespaces.


1. System Stability & Memory Optimization (Swap File)

Agent loops and language model processing can trigger Out-Of-Memory (OOM) crashes in standard 4 GB containers. Allocate an 8 GB Linux swap space to guarantee system stability:

# 1. Allocate an 8 GB swap file
sudo fallocate -l 8G /swapfile

# 2. Set strict root permissions
sudo chmod 600 /swapfile

# 3. Format as Linux swap
sudo mkswap /swapfile

# 4. Activate the swap partition
sudo swapon /swapfile

# 5. Persist swap across reboots in /etc/fstab
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

# 6. Verify total available memory
free -h

2. Process & Heap Memory Constraints

Cap the maximum heap memory of Node.js runtimes to prevent rogue loops from monopolizing container memory:

echo 'export NODE_OPTIONS="--max-old-space-size=1536"' >> ~/.bashrc
echo 'export WATCHPACK_POLLING=false' >> ~/.bashrc
source ~/.bashrc

3. Repository Setup & Directory Navigation

Clone the project repository and move directly to the extension package subdirectory where package.json is located:

# Clone the main repository
git clone https://github.com/wcm24b126-hue/week3and4_in_fullstack_development.git

# Enter the extension root folder
cd week3and4_in_fullstack_development/nightrider-copilot

4. Build & Package VSIX

Install project dependencies and compile the extension into a local .vsix installer archive:

# Install dependencies
npm install

# Package the extension locally
npx -y @vscode/vsce package --no-dependencies --allow-missing-repository

5. Installation & Verification

Install the packaged binary into VS Code directly through the terminal:

# Install into local or remote VS Code
code --install-extension *.vsix

Reload the editor window with Ctrl + Shift + P → Developer: Reload Window.

6. Copilot Runtime Configuration

  • Provider: Groq API
  • Recommended Model: GPT-OSS 120B / Llama 3
  • Execution Gates: Ensure manual confirmation prompts ([Allow / Decline]) are reviewed before running terminal operations.
Next.jsVercel