-
Notifications
You must be signed in to change notification settings - Fork 0
lore
A narrative history of this codebase: what happened here and when. Dates are derived from git commit timestamps, tag creation dates, and file-creation history. Where the intent behind a change is not visible in the commits, the text hedges ("appears to have been").
Prime Agent is a self-improving RLM (Recursive Language Model) coding and
research agent. The repository is a hard fork of PrimeIntellect-ai/prime-agent
(originally badlogic's pi-mono by Mario Zechner) plus a standalone Qredence
web UI under web/ that is not merged upstream. As of HEAD 94c724c1e
(2026-08-15) there are 4556 commits on main, with the wire protocol at
version 8 and schema revision 15.
The deepest layer of the history is inherited from badlogic's pi-mono by
Mario Zechner. The bulk of commit authorship in the tree, roughly 3063 of 4556
commits, carries Zechner's name, and the @earendil-works package scope marks
this upstream lineage. Early commits visible in this repo's log (dated August
2025) already show the distinctive concerns of that project:
- 2025-08-10: reasoning-token support for OpenAI reasoning models, with "comprehensive reasoning token support across providers" following the same day.
- 2025-08-11: the surgical differential-rendering TUI work (double buffering, a terminal abstraction, container change detection, scrollback preservation).
- 2025-08-11: ESC-interrupt handling in the agent, and the
/tokenscommand for cumulative token-usage tracking. - 2025-08-17: the
aipackage lands as a unified AI package supporting OpenAI, Anthropic, and Gemini.
These months form the foundation the fork later productized.
The monorepo as it exists today is scaffolded in the first commits, dated 2025-08-09:
- 2025-08-09
a74c5da11: "Initial monorepo setup with npm workspaces and dual TypeScript configuration", the first commit. - Same day: fixes for npm publishing warnings, global CLI execution, and
process.cwd()errors from deleted directories. - 2025-08-09: versions
v0.5.3andv0.5.4introduced the lockstep versioning scheme ("Fix lockstep versioning and update all packages") that all packages still share today. Every package moves together; there are no independent package versions.
The early feature wave concentrated on the terminal experience and the model layer:
- 2025-08-11: differential rendering for minimal redraws, initial-render on
start(), instructional headers, and the welcome message in the chat demo. - 2025-08-11: biome formatting applied across the TUI; a husky pre-commit hook for formatting and type checking was added the same day.
- 2025-08-17: the unified
aipackage with OpenAI, Anthropic, and Gemini providers. - 2025-08-24: OpenAI Completions and Responses API providers added.
- 2025-10-17
ffc9be886: thecoding-agentpackage appears, "Agent package + coding agent WIP, refactored web-ui prompts." This became the backend that the Qredence UI would later consume.
Around May 2026 the recursive self-improvement machinery that gives the agent its "RLM" identity was added:
- 2026-05-08: an IPython tool that runs Python in a persistent kernel; the
prime-agent-runtimedirectory begins with the "rlm recursion bridge" the same day. - 2026-05-12: background RLM subagents.
- 2026-05-15: the RLM background API is removed again, trimming that early experiment.
- 2026-05-18: the R2 installer release flow lands, and the
install.shpublic installer appears, the start of the product's distribution story.
The daemon architecture, which separates the agent runtime from the interactive/terminal and web clients, was built out through June 2026 and consolidated in August:
- 2026-06-03: the daemon session manager is added.
- 2026-06-04: interactive mode is decoupled from the agent runtime; this is
when the
AgentConnectionseam concept appears. - 2026-06-05: the daemon attach-snapshot reconnect flow and the swarm-reconnect protocol preparation land.
- 2026-06-09: the daemon agents view and startup/streaming performance work.
- 2026-06-10: subagents surfaced from daemon state with session restore on restart.
- 2026-08-11: the protocol jumps to v8 (schema revision 15) to carry
seedMessagesonnew_session, part of theInteractiveModeLocalSessionHostremoval (see Major rewrites).
The standalone Qredence web UI is the defining recent change. It arrived in a concentrated burst in mid-August 2026 and turned the fork into a two-surface product:
- 2026-08-13: the web UI is isolated under a pnpm workspace (
web/), withweb/app(TanStack Start),web/design,web/protocol(chat-protocol.ts), andweb/server(theprime-bridge.ts/event-mapper.tsadapter). The isolation commit is the first web commit. - 2026-08-13: the packages-vs-web split is documented.
- 2026-08-13 through 2026-08-15: the OAuth sign-in flow, fork picker, kernel chip, favicons, slash catalog, and stream helpers are wired on the client, and OAuth types are added to the chat protocol.
- 2026-08-15:
prime-agent web, the packaged Qredence frontend and backend, and the repo-hosted public installer land (1afd96bda, PR #18). - 2026-08-15
57e3d5445(HEAD): OpenUI chat artifacts are wired in, closing out the recorded history.
Alongside the feature push, the web stack was hardened and the release tooling reworked:
- 2026-08-11: React Doctor is integrated;
doctor.config.jsoncrecords scoped waivers and false-positive notes (OpenUI library multi-component, co-located chart components, a false-positive preview-loading case), all dated 2026-08-11. - 2026-08-13: the chat is hardened against XSS, stale sessions, and accessibility gaps; an OpenUI error boundary is added.
- The
plans/directory carries 12improve-reacthardening plans (numbered 001-012), all marked DONE, with React Doctor 0.9.5 at a baseline score of 100 against audit commit89c8fb912. They cover chart color sanitization, settled-session reload gating, composer accessibility, streaming live-region throttling, settings focus restore, markdown hoisting, turn memo stabilization, SSE status reconnect, error surfacing, a markdown-link allowlist, the OpenUI error boundary, and stopping stream subscription when settings close. - 2026-08-14/15: the "Release Prime Agent" CI workflow
(
.github/workflows/build-binaries.yml, 412 lines) andscripts/build-binaries.share removed on theimplementation/remove-release-cibranch (e67ccb2f0, merged859871ada), presumably because the public installer and bundled web runtime made the standalone release workflow obsolete.
- Differential-rendering TUI, the surgical, minimal-redraw terminal approach introduced 2025-08-11 has survived every refactor since and remains the interface model.
- The
AgentConnectionseam concept, although formally named in June 2026, the idea of a narrow, portable seam between the agent runtime and its clients predates the daemon and was the design target of the June 2026 decoupling and the August 2026InteractiveModeLocalSessionHostremoval. - IPython as a built-in tool, the persistent-kernel Python tool added 2026-05-08 is still the recommended way to run shell and Python work in the agent.
- JSONL session transcripts, session recording dates to 2026-01, with a transcript-analysis script following that same month.
- Slash commands, the command surface goes back to August 2025 (
/tokens) and remains central to the product today.
- InteractiveModeLocalSessionHost, introduced 2026-06-04 as a convenience
backdoor exposing raw
AgentSession,SessionManager, andExtensionRunnerto in-process terminal code. It was deleted 2026-08-11 perdocs/adr/0001-kill-interactivemode-localsessionhost.md, which widenedAgentConnectionto close the gap. Every feature built through the host had silently become daemon-incompatible. - The interactive
!/!!bash shortcuts, removed in thecoding-agentv0.0.10 release (2026-06-08) with the note "use IPython for shell commands." They were subsequently restored (2026-06-12) by running bash through the agent connection to regain streaming output, history, and Ctrl+C abort; so they are removed and then re-adopted, not a clean deprecation. - The "Release Prime Agent" CI workflow, removed 2026-08-14/15 on the
implementation/remove-release-cibranch (see Eras, section 7). - The
momandpodspackages, removed in a single commit 2026-04-30, part of trimming earlier working-memory/multi-agent experiments. - The interactive-mode easter eggs (
/arminsayshi,/dementedelves, and the daxnuts auto-trigger for the opencode Kimi K2.5 model), removed 2026-08-15 as part of the public-release housekeeping, along with the orphanedexy.pngmascot image (packages/coding-agent/docs/images/exy.png) and the internal planning docs (docs/superpowers/and.react-doctor/).
- The web workspace addition (2026-08-13), adding
web/as a separate pnpm workspace with its own protocol, adapter, and app layer, deliberately kept out of the npmpackages/tree. - The
InteractiveModeLocalSessionHostdeletion (2026-08-11), a backwards-compatible seam widening onAgentConnection(extensions sub-interface, read-onlySessionView,afterReplacehook) that killed a convenience backdoor rather than documenting it. - Protocol v7 to v8 with
seedMessages(2026-08-11),seedMessagesonnew_sessionbecame wire-supported at protocol v8 / schema revision 15, negotiated as a daemon capability so v7 clients do not send the field. - The differential-rendering rewrite of the TUI (2025-08-11), replacing a full-redraw model with surgical, scrollback-preserving updates.
- Decoupling interactive mode from the agent runtime (2026-06-04), the first step toward making the terminal a portable client of a daemon, later completed by the August seam removal.
- Dev-only to bundled
prime-agent webruntime (2026-08-15), moving the web surface from development-only code to a packaged frontend/backend launched by the installedprime-agentbinary.
- Packages:
tuiandagentexist from the initial monorepo commit (2025-08-09);aiis added 2025-08-17;coding-agent2025-10-17. -
prime-agent-runtime/appears 2026-05-08;scripts/andinstall.shfollow through May 2026;web/lands 2026-08-13. - Contributors: Mario Zechner dominates overall (~3063 commits), reflecting
inherited
pi-mono/upstream history. Recent work is Qredence's, Zachary BENSALEM authored all of the last ~50 commits (72 total in the tree), with the web work largely contributed through PRs in August 2026. About 127 commits are bot-attributed (github-actions[bot], plus "codex:" commits in the web wave). Other upstream contributors include Armin Ronacher, Helmut Januschka, Sebastian Muller, Kevin Thomas, Seth Karten, and Aliou Diallo. - Tags: the release timeline runs
v0.0.1-demo.1through.7(2026-05-14),v0.0.1(2026-05-18), throughv0.7.1(2026-08-07), with abetatag also on 2026-08-07. All packages share the lockstep0.7.1version.