Skip to content

Pi: analysis runs for reviews, summaries, commit subjects, planner, indexing and the repository scout #3833

Done

Description

@integry

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 agentToolPolicy for the other agents), e.g. --tools read and no bash/edit/write where 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-generated mcp.json in the disposable agent dir, --no-extensions, --no-skills, --no-prompt-templates and --no-approve. Host or repo mcp.json, extensions and skills must not load. Add buildPiRepositoryScoutConfig next to the OpenCode and Vibe ones in repositoryScoutMcpServer.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.json for 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.executeTask wraps execution in executeWithExtensions, passing extensionAgentLaunch as Claude and Codex do. The propr MCP server for agent definitions and automations uses the same path.
  • Write <PI_CODING_AGENT_DIR>/mcp.json in 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). With exclusiveMcp, add --no-skills plus the explicit --skill flags, and keep --no-approve so project .pi/mcp.json and skills never load.
  • Pi exposes MCP tools through its codemode tool and names them mcp__<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 -p with an open, never-closed stdin hangs with no output (verified).
  • Tests: mcp.json rendering with no token value; the exclusive flags; --skill per bundle; a stub stdio server smoke test through the bridge.

Activity

  1. propr-dev commented on Nov 27, 2026

    @propr-dev
    Contributor

    🤖 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:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3833/claude-opus-5-5-pi-analysis-runs-for-revi-20261127-1852-3bj
    • Base Branch: 3831-epic-pi-coding-jml
    • Worktree: issue-3833-20261127-1852-claude-opus-5-5-3bj

    🔍 Track Task Execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions