- Added a Python `analyze.py` CLI with `tools`, `edits`, and `followups` session-stats subcommands.
- Added `sync.py` ingestion with `~/.omp/stats.db`, migration SQL, and incremental JSONL resume logic.
- Replaced `stats:run` in `package.json` with `stats:sync` and new `stats:edits`, `stats:tools`, and `stats:followups` scripts.
- Removed the Rust session-stats crate files (`Cargo.toml`, `main.rs`, `common.rs`, `cmd_*.rs`) and their old command logic.
- Removed `.gitignore` ignores for `scripts/session-stats/Cargo.lock` and `scripts/session-stats/edit-analysis.csv`.
- Updated eval tool guidance to show Python `asyncio.run(...)` usage.
Some extensions/plugins still import the legacy @mariozechner/pi-* package names (pi-agent-core, pi-ai, pi-coding-agent, pi-tui) instead of @oh-my-pi/pi-*. Register a single Bun.plugin on first plugin/extension load that rewrites those specifiers to the current @oh-my-pi/pi-* equivalents, including the @mariozechner/pi-coding-agent/extensibility/{extensions,hooks} sub-exports. No filesystem mutation, no symlinks, no proxy files.
Fixes#973
Add an explicit openai-models-list discovery type for custom providers while keeping lm-studio as a compatible alias. Custom providers can now point baseUrl at an OpenAI-compatible /v1 endpoint, provide an api key, and auto-populate models via GET {baseUrl}/models.
Discovered models merge cleanly with user-defined models from models.yml/models.json, so YAML entries still win for display name and token limits. The provider picker now explains when discovery succeeds but returns zero models, and when the configured /models endpoint responds with 404.
Fixes#970
Interactive /mcp test only consulted getMCPConfigPath("user"|"project")
configs and missed servers defined in standalone .mcp.json. /mcp reauth
already resolved through #findConfiguredServer, which includes that
fallback path. Route /mcp test through the same resolver so both
commands enumerate the same set of servers.
Fixes#956
The custom status line rendered cache_read with the input icon and
cache_write with the output icon — backwards relative to Anthropic's
cache_creation_input_tokens (write) / cache_read_input_tokens (read)
semantics. Swap the icon pairings in status-line/segments.ts and the
labels in status-line-segment-editor.ts to match.
Fixes#953
runSplitCommit reset the index and then re-staged each split via
git.stage.hunks, but stage.hunks builds its file map from the current
diff. After the reset, newly created files were untracked again and
absent from that map, throwing "No diff found for <path>" mid-split.
Preserve the original staged diff so new files remain locatable
through every split iteration.
Fixes#966
- BuildWorkspaceTree now attempts to list files via `git ls-files` and builds a child index for tree rendering, avoiding native recursion when git output is available.
- `buildDirectoryTree` gained an optional `childIndex` path map, `tryListGitFiles` now applies a 3s timeout and falls back to existing native scan on failure or timeout.
- Added a workspace-tree test that verifies git-backed listing skips gitignored entries while including tracked workspace files.
- Added a static-import rewriter that converts common import clauses into dynamic `await import(...)` expressions before VM wrapping.
- Provided `require` and `createRequire` globals in the JS VM context using a cwd-based resolver.
- Added executor tests confirming rewritten imports run correctly and that `require`/`createRequire` are exposed with expected behavior.
- Added optional `/loop` `count|duration` command arguments and wired `command.args` into loop handling.
- Implemented `loop-limit` parsing and runtime types/helpers for iteration and duration budget limits with validation.
- Updated interactive mode to enforce loop limits per iteration, check duration expiry, and clear budget state on disable.
- Added loop-limit parse/runtime tests and fixed `/loop` arg errors plus macOS `MallocStackLogging` environment leakage.
- Rendered diff content before the truncation notice instead of after.
- Updated hidden lines label to show count with "+" prefix.
- Added fallback label when no lines are hidden.
- Exported hashline section interfaces and helpers, including a new section-diff API for external callers.
- Refactored `computeHashlineDiff` to split input sections, propagate split errors, and delegate each section via helper.
- Added context-highlight caching and batched highlighting for unchanged lines, with `replaceTabs` fallback on unknown files.
- Fixed hashline streaming preview so completed sections stay visible when a new `@PATH` header appears mid-stream.
- Added hashline streaming tests for section persistence, malformed trailing `+ 7`, and dual sections.
- Added `.ipynb` detection and editable-cell conversion utilities, including merge/serialize helpers in `edit/notebook`.
- Rerouted hashline, patch, and replace edit flows, plus read/write paths, through notebook-aware helpers before persistence.
- Removed the dedicated `notebook` tool, its schema flags, renderer, and built-in registration/settings checks.
- Updated notebook read behavior, docs, and tests so `.ipynb` reads return editable `# %%` cells and edits reserialize to JSON.
- Added optional `loadMode` and `summary` fields to `AgentTool` and related type declarations.
- Added `loadMode` and `summary` metadata to built-in tool classes for discoverable/essential behavior.
- Replaced `BUILTIN_TOOL_METADATA` with per-tool fields in discovery code paths.
- Updated `search_tool_bm25` and discovery indexing to use each tool's `summary` text.
- Updated discovery tests to validate tool `loadMode` and summary completeness.
Restore BUILTIN_TOOLS to Record<string, ToolFactory> so external SDK callers can
still invoke BUILTIN_TOOLS.read(session) directly, and move per-tool discovery
metadata (loadMode, summary) into a dedicated BUILTIN_TOOL_METADATA map. All
internal callers (computeEssentialBuiltinNames, getBuiltinDiscoverableEntries,
createTools, sdk.ts initial-tool filter, agent-session built-in collection) now
read metadata through the new map.
Restore the legacy MCP discovery API on AgentSession: getDiscoverableMCPTools()
returns DiscoverableMCPTool[] with description, and getDiscoverableMCPSearchIndex()
returns the legacy DiscoverableMCPSearchIndex whose documents expose
tool.description while remaining usable by searchDiscoverableTools (summary is
populated from description so the BM25 corpus still scores correctly). Generic
discovery via getDiscoverableTools / getDiscoverableToolSearchIndex is unchanged.
Centralize discovery cache invalidation in #invalidateDiscoveryCaches and call it
from #applyActiveToolsByName, refreshMCPTools, and refreshRpcHostTools so the
generic search index can no longer return tools that have already been activated
or registry entries that have been replaced.
Restrict #collectDiscoverableBuiltinTools to entries whose
BUILTIN_TOOL_METADATA[name].loadMode === "discoverable", which keeps hidden
tools (resolve, yield, exit_plan_mode, report_finding, report_tool_issue) and
unknown extension/custom registry entries out of the discovery corpus.
Tests: add coverage for callable BUILTIN_TOOLS factories, legacy MCP description
shape on getDiscoverableMCPTools / getDiscoverableMCPSearchIndex, stale-index
invalidation on setActiveToolsByName, and hidden-tool exclusion from
getDiscoverableTools({ source: "builtin" }).
The internal class is now SearchToolsTool but the wire name stays
"search_tool_bm25" so persisted MCP selections in user session files
continue to resolve correctly.
The BM25 corpus is now drawn from the generic DiscoverableTool list
(built-ins, MCP, extension, custom) rather than only MCP tools.
createIf fires when either tools.discoveryMode !== "off" or the
legacy mcp.discoveryMode is true.
AgentSession gains generic discovery methods (isToolDiscoveryEnabled,
getDiscoverableTools, getDiscoverableToolSearchIndex,
getSelectedDiscoveredToolNames, activateDiscoveredTools). The existing
MCP-named methods are kept as thin shims that filter by
source === "mcp" so existing callers continue to work.
Updated the tool's prompt copy to advertise discovery across all
sources rather than MCP only. Tests extended for the new shape.
Added two settings:
- tools.discoveryMode ("off" | "mcp-only" | "all", default "off")
- tools.essentialOverride (string[], default empty)
Converted BUILTIN_TOOLS from Record<string, ToolFactory> to
Record<string, BuiltinEntry> with a per-tool loadMode ("essential"
or "discoverable") and an optional summary used as the BM25 corpus
entry when discovery hides the tool.
Marked read, bash, edit as essential. Marked the remaining 24 built-in
tools as discoverable with hand-written summaries. search_tool_bm25
stays essential (always loaded when discovery is on; gated separately
by isToolAllowed).
Added DEFAULT_ESSENTIAL_TOOL_NAMES, computeEssentialBuiltinNames
(reads tools.essentialOverride with a default fallback), and
getBuiltinDiscoverableEntries (used by the search tool to build the
BM25 corpus).
mcp.discoveryMode is preserved as a back-compat alias for "mcp-only".
Moved the BM25 discovery index out of mcp/discoverable-tool-metadata.ts
into tool-discovery/tool-index.ts and generalized it to work over any
AgentTool source (built-in, MCP, extension, custom) instead of only MCP.
Added DiscoverableTool with explicit source and summary fields. Kept
the MCP-typed helpers (collectDiscoverableMCPTools, searchDiscoverable
MCPTools, etc.) as thin re-exports from the original path so existing
callers continue to work unchanged.
Tests cover the generic index, source filtering, summary fallback, and
back-compat with the legacy MCP-only API.
- Extended boundary duplicate absorption to single structural closing lines (`}`, `)`, `]`) for replacement groups.
- Added delimiter-balance validation so a boundary line drops only when the kept payload matches expected counts.
- Enabled default single-line structural boundary absorption for pure inserts while keeping multi-line absorbs gated by `autoDropPureInsertDuplicates`.
- Added a new `read.summarize.prose` setting to control markdown and plain-text read summaries.
- Updated the read tool to skip summarization for prose files unless that setting is enabled.
- Added coverage for default and enabled markdown read-summary behavior.
- Exported DEFAULT_MATCH_LIMIT from the search tool module.
- Updated the search tool tests to import DEFAULT_MATCH_LIMIT from the module.
- Updated default-limit assertions and messages to use DEFAULT_MATCH_LIMIT instead of hardcoded values.
- Added `pr_create` to the GitHub tool schema and execution dispatch.
- Implemented `executePrCreate()` with title/fill validation, arg assembly, and temp-file body handling.
- Added optional PR result enrichment by parsing created PR URLs and formatting `gh pr view` summary fields.
- Updated `github.md` docs, changelog notes, and tests for `pr_create` mappings and validation.