$ show carlrobertoh/ProxyAI
ProxyAI (formerly CodeGPT) is a JetBrains IDE plugin that provides AI-powered code assistance including chat, inline editing, code completions, agent-based task execution, commit message generation, and next-edit suggestions. The plugin integrates with multiple LLM providers (OpenAI, Anthropic, Google, Mistral, Ollama, llama.cpp, custom OpenAI-compatible, and its own ProxyAI cloud) and supports local inference via a bundled llama.cpp submodule. It implements an agent framework with a tool system (read, write, edit, bash, web search, diagnostics, debugger control), MCP (Model Context Protocol) client for external tool servers, and ACP (Agent Client Protocol) for external agent integration. The architecture follows IntelliJ Platform conventions: services, actions, tool windows, settings via PersistentStateComponent, and editor listeners. The codebase is a mix of Kotlin (dominant) and Java, with Gradle build system and extensive use of coroutines for async operations.
The LLM identified 5 files worth highlighting for reuse:
A state machine that parses streaming SSE chat output from LLM responses into structured segments (Text, Code, SearchReplace, Thinking, Mermaid). It handles random chunk boundaries, incomplete code blocks, and mixed content types. This component is self-contained and can be reused in any project that needs to parse streaming LLM responses with code and structural elements.
Implements exponential backoff with jitter for retrying failed LLM API calls (HTTP 429/503, timeouts, connection errors). Configurable max retries, initial delay, and jitter factor. This is a reusable retry utility that can be extracted for any HTTP client or external service integration.
Synchronizes edits across multiple editors for the same file, ensuring that changes made in one diff view are reflected in others. Manages the lifecycle of diff editors and prevents conflicting modifications. This pattern is reusable for any multi-editor diff interface.
Manages context tags (file, selection, editor, MCP, persona, git, history) that are attached to chat prompts. Provides a listener pattern for tag changes and integrates with the UI to display tag chips. The TagDetails hierarchy is extensible and can be reused in any system that needs structured context injection into prompts.
Extracts class, method, field, and constructor structure from IntelliJ PSI elements (supports Java and Kotlin). Uses depth-first traversal with customizable depth limits. This component is reusable for any IDE plugin that needs code structure analysis for context or documentation generation.