GPT App

GPT App screenshot

My barebones attempt at a custom AI harness: an Electron desktop app where a model can search, read and patch code in a local workspace, with every change waiting on my approval.

Built with

  • Electron
  • Node.js
  • Ollama
  • SQLite
  • MCP

What it does

  • Chat with any OpenAI-compatible endpoint, or a local or remote Ollama model.
  • Workspace tools for searching, reading and patching code, running commands and basic git.
  • Mutating tools pause for approval; a read-only planning mode turns them off entirely.
  • Context management keeps long sessions inside the model's window: a byte budget, older turns summarized when it fills, and code pulled in on demand from a local semantic index instead of whole files.

How it's built

  • Every model call is held to a byte budget. Old tool output is trimmed first and replaced with a marked stub, so the model knows something was removed rather than seeing it silently disappear.
  • Near 80% of that budget, an optional summarizer condenses older turns while the latest turn stays intact; if the summary fails, times out or comes back empty, the full history is kept.
  • A retrieve_code_context tool searches a per-workspace embeddings index (sqlite-vec, overlapping line chunks). A manifest records the model, dimensions and readiness, and queries refuse to run against a stale or half-built index.
  • Single tool results are capped at about 100 KB, and project notes and skills are added to the system prompt once, on the first message, each under its own size limit.
  • API keys and model calls stay in Electron's main process; the renderer only talks to it through a narrow preload bridge.
  • Covered by a Node test suite and a few Playwright end-to-end checks.