Skip to content

WIP: Port OpenCode harness to pi (pi-open-agents + permission-system) - #107

Draft
MKuckert wants to merge 2 commits into
mainfrom
feature/pi-harness-port
Draft

WIP: Port OpenCode harness to pi (pi-open-agents + permission-system)#107
MKuckert wants to merge 2 commits into
mainfrom
feature/pi-harness-port

Conversation

@MKuckert

@MKuckert MKuckert commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

Port of the OpenCode agent harness to the pi harness, using local-only extensions (no global installs). Full mapping + gap analysis in docs/opencode-to-pi-port.md.

Changes

  • Agent model remap: all 10 agents on local omlx/qwen3.8-27B-oQ4e (OpenRouter exhausted; the oQ5e variant does not exist in the local registry). reasoningEffort renamed to thinking; high unsupported on this model, reviewers/planner/testing use xhigh
  • Local pi extensions (.pi/extensions/, npm-installed, referenced from project .pi/settings.json):
    • pi-open-agents@0.1.20 — drop-in OpenCode-compatible agent loader (discovers .opencode/agents/*.md, zero format changes)
    • @gotgenes/pi-permission-system@29.1.0 — permission gating (project config in .pi/extensions/pi-permission-system/config.json)
  • Subagent nesting: subagent: allow + allowedAgents: Explorer, Librarian on CodeReviewer/PlanReviewer; maxDepth: 0 on leaves (Explorer, Librarian, Committer) enforcing the old subagent_depth: 2; explicit tools: list for Committer
  • Skills: grill-me, create-projectmap copied to .pi/skills/
  • Commands: all 5 OpenCode commands converted to pi prompt templates in .pi/prompts/

Verified end-to-end

  • Agent discovery, search_agents, set_agent switching
  • Subagent delegation main → Explorer (structured result returned)
  • Permission enforcement in child processes (tool whitelist strips denied tools)
  • Nested delegation: CodeReviewer → Explorer succeeds (depth 2); CodeReviewer → Committer rejected with Unknown agent: Committer. Available agents: Explorer, Librarian.
  • Skills visible in the main session

Pending (hence draft)

  • harness-sync push to sync agent edits back into the agent-harness submodule (canonical source)

Known gaps (documented in docs/opencode-to-pi-port.md)

  • Web stack: local MCP gateway not running in this environment; Librarian children currently have no usable tools
  • Per-agent runtime permission enforcement: pi-permission-system cannot identify the active agent in pi-open-agents child processes (no <active_agent> tag); child isolation comes from the coarser tool whitelist
  • Pattern-scoped permissions not enforced: Committer's git-only bash, path-scoped edit rules — whitelist is binary per tool
  • Commands: agent: frontmatter converted to set_agent/delegation instructions in the template body

pi agent added 2 commits September 2, 2026 15:03
- Remap agent models to local omlx qwen3.8 (openrouter exhausted); reasoningEffort -> thinking
- Add local pi extensions (.pi/extensions): pi-open-agents@0.1.20, @gotgenes/pi-permission-system@29.1.0, no global installs
- Fix subagent nesting: subagent allow + allowedAgents on reviewers, maxDepth 0 on leaves, explicit tools for Committer
- Port skills to .pi/skills (grill-me, create-projectmap)
- Convert commands to pi prompt templates (.pi/prompts)

Partial: nested delegation retest, gap doc, harness-sync push pending
- oQ5e does not exist in the local omlx registry (CodeReviewer children
  returned no output); all 10 agents now on qwen3.8-27B-oQ4e
- thinking: high unsupported on this model -> xhigh for reviewers/planner/testing
- Verified: CodeReviewer -> Explorer works (depth 2), -> Committer rejected
  via allowedAgents; skills visible in main session
- Add docs/opencode-to-pi-port.md (mapping, verified items, gaps)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant