Repository navigation
Description
Implement PiAgent.analyze so every analysis path works with Pi: AI code reviews, PR/task summaries, commit subjects, plan generation, repository indexing, and the read-only repository-inspection scout.
Acceptance:
- Analysis runs mount the workspace read-only and use Pi's tool controls to match each mode's existing policy (mirror
agentToolPolicyfor the other agents), e.g.--tools readand nobash/edit/writewhere other agents are read-only. Tool-less analysis uses--no-tools. - Repository inspection (scout) mode: only the ProPR repository-scout MCP tools (
propr_repository_*). Use--no-builtin-tools, a ProPR-generatedmcp.jsonin the disposable agent dir,--no-extensions,--no-skills,--no-prompt-templatesand--no-approve. Host or repomcp.json, extensions and skills must not load. AddbuildPiRepositoryScoutConfignext to the OpenCode and Vibe ones inrepositoryScoutMcpServer.ts. - Analysis output parsing reuses the JSON parser (final text, usage, cost) and honours
evaluate…Analysis-style success rules. src/jobs/reviewContextScout.ts, the indexing pipeline and the planner select Pi like the other agent types.- ProPR's extension library (MCP servers configured per run) is injected through the generated
mcp.jsonfor task runs, matching how other agents receive it. - Tests: Docker args per analysis mode (tool flags, read-only mount, scout MCP-only tools, no host mcp/extension loading); analysis result parsing; a scout config test asserting that bash/edit/write are unavailable.
Implementation
Follow the OpenCode scout precedent (buildOpenCodeRepositoryScoutConfig plus the deny-first config) and VibeAgent.analyze. Check Pi's docs/mcp.md for the mcp.json format (mcpServers with command/args or url).
Notes
Pi 1.6.1 flags: --tools/-t (allowlist, keeps MCP tools unless an entry starts with mcp__), --exclude-tools/-xt, --no-tools, --no-builtin-tools, --no-mcp, --no-extensions, --no-skills, --no-prompt-templates, --no-context-files, --no-approve. Built-in tools are read, bash, edit and write.
Addition: extension library (MCP servers and skills) for Pi
Verified live with Pi 1.6.1 on 2026-11-27, using a stub stdio MCP server, a bearer-auth HTTP MCP server and a SKILL.md skill. pi mcp list showed both servers connected, and the run used the skill and both tools. The shared gating is being made data-driven in #3841. If #3841 has landed in main, enable pi in its capability map; otherwise add pi to EXTENSION_RUNTIMES / AGENT_TYPES_SUPPORTING_PROPR_MCP and its hard-coded copies.
Acceptance:
PiAgent.executeTaskwraps execution inexecuteWithExtensions, passingextensionAgentLaunchas Claude and Codex do. TheproprMCP server for agent definitions and automations uses the same path.- Write
<PI_CODING_AGENT_DIR>/mcp.jsonin the disposable agent dir (never the host dir), and never write a token value into it:{"mcpServers":{ "<local>":{"command":"/usr/local/bin/node","args":["/opt/propr/extension-stdio-bridge.mjs","<bridgeConfig>"]}, "<url>":{"url":"<gateway>/api/extensions/mcp/<name>","headers":{"Authorization":"Bearer ${PROPR_EXTENSION_MCP_0_TOKEN}"}}}}${VAR}expansion is verified, and stdio servers inherit the env (verified), so bridge secrets only need-e. - Skills: pass
--skill /opt/propr/extensions/<id>per staged bundle (verified). WithexclusiveMcp, add--no-skillsplus the explicit--skillflags, and keep--no-approveso project.pi/mcp.jsonand skills never load. - Pi exposes MCP tools through its
codemodetool and names themmcp__<server>__<tool>. Render both as readable tool events in persisted logs and the live view. - Always provide the prompt on stdin or close stdin (
</dev/null):pi -pwith an open, never-closed stdin hangs with no output (verified). - Tests:
mcp.jsonrendering with no token value; the exclusive flags;--skillper bundle; a stub stdio server smoke test through the bridge.
Activity
propr-dev commentedon Nov 27, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-53833/claude-opus-5-5-pi-analysis-runs-for-revi-20261127-1852-3bj3831-epic-pi-coding-jmlissue-3833-20261127-1852-claude-opus-5-5-3bj🔍 Track Task Execution