senpi
An opinionated fork of pi-mono that packs intent gates, dynamic prompts, compaction, and a permission system into a lightweight coding-agent CLI.
The permission system provides rules, JSONL storage, and TUI confirmation prompts with non-interactive fallback, and the README explicitly warns about the wildcard-allow shortcut — good. Deducted: SECURITY.md states there is no sandbox and that prompt injection is unprotectable; sensitive-data handling is only a trust-boundary narrative with no concrete secret-management evidence; rollback evidence exists only in the release pipeline (draft cleanup, source_ref recovery), not for user sessions/files.
Test files thoroughly cover empty-response recovery, stream-start timeout, and thinking timing; error messages name the controlling setting (retry.provider.streamStartTimeoutMs) — strong self-consistency and failure messaging. Deducted: dependency availability rests on lockfiles and pinned-deps check scripts only; static review cannot verify installs or passing CI.
The README names its audience (Dori runtime, OMO migrants) and explicitly lists features with no senpi counterpart (Discipline Agents, Team Mode, etc.) — clear capability boundaries. Deducted: environment fit is asserted (Node>=24, bun) with cross-platform evidence only on the CI side; trigger precision (intent gate behavior) is described but not substantiated by provided source.
Excellent information architecture: package tables, ordered builtin-extension registry, per-directory changes.md trackers, a changelog-gate workflow enforcing PR entries, complete versioning scripts, and a LICENSE preserving both upstream and fork copyright. Deducted: maintenance responsibility sits on a single experimental fork ('don't bet a production pipeline on it'); pi/senpi naming is mixed (release assets still named pi-*), and examples are mostly install commands rather than usage examples.
Positioning is clear ('a lighter OMO on pi'); bounded webfetch, bash timeouts, and the compaction pipeline carry real value. Deducted: output usability and cost/benefit depend on upstream pi-mono quality not present in this evidence set, and the experimental framing weakens the production cost argument.
The README claims verification against git diff and all changes.md files, but only a subset of files is provided, so many claims (extension behaviors, OMO mapping) cannot be rechecked; tests and SECURITY.md do not contradict each other, and fact/inference separation is acceptable. Deducted: many referenced external repos (pi-lsp-client etc.) are absent from the evidence, making cross-source corroboration essentially impossible.
- SECURITY.md explicitly states the coding agent runs within the user's account with no sandbox — isolate with a container or VM yourself.
- The README's wildcard allow setting disables all interactive tool prompts; use only in fully trusted workspaces.
- The project self-describes as an experimental fork and explicitly discourages production pipelines.
- Prompt injection is declared unprotectable and out of security scope; exercise extra caution with untrusted repository content.
- npm packages use the @earendil-works scope while the repo/brand is senpi; verify package names and provenance before installing.
What does this agent do, and when should you use it?
senpi is a TypeScript monorepo fork of badlogic/pi-mono, maintained by code-yeongyu and positioned as a 'sane pi' — it also serves as the coding-agent runtime behind Dori, Sisyphus Labs' AI assistant. It follows pi's extension-first philosophy: the core stays minimal while 18 builtin extensions land in the binary, including permission-system, compaction, dynamic-prompt, prompt-preset, todowrite, gpt-apply-patch, bash-timeout, websearch/webfetch, goal, and rules. The repo bundles @earendil-works/pi-ai (multi-provider LLM API), pi-agent-core (agent runtime), pi-tui (differential-rendering terminal UI), and the senpi CLI itself. It borrows signature ideas from OMO (intent gate, todo continuation, per-model presets) but ships as a single CLI binary instead of an opencode plugin, deliberately lighter than OMO. The project is explicitly experimental, with core modifications documented in changes.md files to keep upstream rebases reviewable.
senpi runs as an interactive CLI/TUI coding agent: it reads project rule files (AGENTS.md, CLAUDE.md, nested AGENTS.md), builds a dynamic system prompt (identity → forced intent gate → task discipline → verification tiers → per-model preset), and drives tool calls through the unified multi-provider LLM API (OpenAI, Anthropic, Google, etc.). Tool surface includes bash (with timeout policy), file editing (swapped to Codex-style apply_patch on GPT models), todowrite/todoread, websearch, webfetch, and goal tracking. The session layer runs adaptive compaction (speculative + emergency, restoration tracker, tool-result truncation) and tool-pair-guard sanitization of orphan tool_result blocks. Standalone extensions such as pi-lsp-client, pi-ast-grep, and pi-comment-checker install via senpi install git:github.com/code-yeongyu/pi-ast-grep-style commands. The permission system stores rules in JSONL, prompts in the TUI, and supports a wildcard allow rule in ~/.senpi/agent/settings. for full auto-approval.
- Developers migrating from OMO who want the intent gate, todo continuation loop, and per-model prompt presets but prefer a lightweight single-binary CLI over an opencode plugin.
- Engineers switching between OpenAI, Anthropic, and Google models, using pi-ai's unified API plus prompt-preset tuning per model family.
- Teams needing allow/deny rules and auditable JSONL permission records via the permission-system builtin.
- Users running long coding sessions who need compaction and tool-pair-guard to keep context stable.
- Developers wanting deep code intelligence — LSP diagnostics, AST search/replace, comment-quality checks — by installing pi-lsp-client, pi-ast-grep, or pi-comment-checker.
- Trusting users who want OMO-style full automation by writing {"permission":{"*":"allow"}} into settings..
What are this agent's strengths and limitations?
- Extension-first architecture: 18 builtin extensions work out of the box, and any unwanted one is a single
disabledBuiltinExtensionsflag away from off; core stays minimal and rebase-friendly against upstream. - Multi-provider coverage: pi-ai unifies OpenAI, Anthropic, and Google APIs; prompt-preset provides per-model presets for GPT-5.x, Claude Opus 4.x, and Kimi K2.6; gpt-apply-patch swaps in a Codex-style patch tool for GPT-family models.
- Serious context-reliability engineering: the compaction pipeline (adaptive thresholds, restoration tracker, emergency compaction), tool-pair-guard, and bash-timeout address real long-session failure modes.
- Documented supply-chain hardening: exact-pinned direct dependencies, save-exact and min-release-age in .npmrc, scheduled npm audit and signature checks in CI.
- The README self-labels the project 'Experimental' and warns against betting a production pipeline on it; design decisions reflect the needs of one specific assistant, Dori.
- Several OMO capabilities have no counterpart: Discipline Agents, Team Mode, the skill system, Hashline, Ralph Loop, and /init-deep are all absent — heavy OMO users face a feature gap.
- No built-in container boundary: by default the agent runs with the launching user's filesystem, process, network, and credential permissions; isolation requires adopting documented OpenShell, Gondolin micro-VM, or Docker patterns yourself.
- As a fork it must be periodically rebased on upstream pi-mono with changes.md bookkeeping; documentation is developer-oriented and the end-user one-line install command is not stated.
How do you install or deploy this agent?
The npm package is @code-yeongyu/senpi; the installed executable is senpi. For development: npm install --ignore-scripts (or bun install --ignore-scripts), then bun run build, bun run test, and bun run publish. Runtime needs a shell and network access to LLM provider APIs (API keys required). Configuration lives in ~/.senpi/agent/ (global) and .senpi/ (per project). The README does not state a one-line end-user install command for the published npm package; the exact install command should be confirmed separately.
How do you use this agent?
After installation, run senpi to enter the interactive CLI/TUI session. Configure ~/.senpi/agent/settings. as needed: permissions (e.g., wildcard allow), disabledBuiltinExtensions, favoriteModels, openai.serviceTier. Install extensions: senpi install git:github.com/code-yeongyu/pi-lsp-client, senpi install git:github.com/code-yeongyu/pi-ast-grep, senpi install git:github.com/code-yeongyu/pi-comment-checker. Update with senpi update senpi (queries code-yeongyu/senpi releases). Useful commands: /rules, /reload-rules, /history, /diff, /files, /tui, and /lsp (requires pi-lsp-client).