qoder-proxy copilot-instructions.md

Project instructions for Qoder OpenAI Proxy, a service that lets tools built for OpenAI-compatible APIs use Qoder models. It covers the project structure, how to build and run it, and how requests become streamed responses.

In plain words
What is it for?
Use it when changing the proxy’s request routes, authentication, Qoder command handling, streamed responses, dashboard, Docker setup, or development commands.
Why use it?
It gives developers the information needed to work on, test, and operate the proxy without first reconstructing its design from the code.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/foxy1402/qoder-proxy/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/foxy1402/qoder-proxy

Made for: GitHub Copilot.

Per session 1,899 This file is loaded in full into every session.
When invoked 1,899 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01899 $0.01899
Opus 5 $0.00949 $0.00949
Sonnet 5 $0.00380 $0.00380
Haiku 4.5 $0.00190 $0.00190

Measured 2d ago against content hash 6d53398fa11d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

qoder-proxy copilot-instructions.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- **Windows compatibility**: All child_process spawns check process.platform === 'win32' and use cmd.exe wrapper.
.github/copilot-instructions.md · 205 lines

How it starts

The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Copilot Instructions - Qoder OpenAI Proxy

Project Overview

This is an OpenAI-compatible API proxy for Qoder CLI (qodercli). It translates OpenAI-format API requests into qodercli commands, enabling any OpenAI-compatible tool (Cursor, LangChain, Open WebUI) to use Qoder models.

Key responsibilities:

  • Accept /v1/chat/completions and /v1/completions requests in OpenAI format
  • Spawn qodercli child processes with appropriate model/prompt arguments
  • Stream responses back to clients via Server-Sent Events (SSE)
  • Provide a web dashboard for testing and monitoring at /dashboard/

Build, Test, and Run

Start server (development): npm run dev # Runs with --watch for auto-reload on file changes

Start server (production): npm start # Runs src/server.js directly

Docker: docker build -t qoder-proxy . docker run -p 3000:3000 -e QODER_PERSONAL_ACCESS_TOKEN="..." -e PROXY_API_KEY="..." qoder-proxy

No tests or linters are configured.

Architecture

Core Flow

Client → Express → Auth → Routes → spawn.js → qodercli (child process) → Parse stream-json output → SSE/JSON response

  1. Routes (src/routes/) receive OpenAI-format requests
  2. format.js translates OpenAI model names → Qoder tiers and converts messages[] → single prompt string
  3. spawn.js spawns qodercli -p -f stream-json --model as a child process
  4. Stream parsing reads line-delimited JSON from stdout, extracts text, and sends SSE chunks
  5. Logging (logStore.js) captures all requests/responses in RAM (circular buffer, max 500 entries)

Key Components

Component Purpose
src/server.js Express app setup, route mounting, startup health checks
src/config.js Central config from env vars (PORT, API keys, timeouts)
src/helpers/spawn.js Spawns qodercli, handles stdout/stderr, implements timeout logic
src/helpers/format.js Model mapping (OpenAI aliases → Qoder tiers), message→prompt conversion, response builders
src/store/logStore.js In-memory circular log buffer for requests + system events
src/middleware/auth.js Bearer token validation for /v1/* endpoints
src/middleware/dashboardAuth.js Cookie-based HMAC auth for /dashboard/*
src/routes/chat.js /v1/chat/completions endpoint (supports streaming + non-streaming)
src/routes/completions.js /v1/completions (legacy text completion)
src/routes/dashboard.js Dashboard UI + API endpoints for logs/playground

Read the full file on GitHub · 205 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 205 lines · 1,899 tokens per session scan A 6d53398fa11d

Subscribe to this mod's changes

qoder-proxy copilot-instructions.md is an instructions file published in the GitHub repository foxy1402/qoder-proxy (56 stars, last pushed 3mo ago), licensed MIT. It adds 1,899 tokens to every session, about $0.0095 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories