Repository navigation
Description
Ship Pi 1.6.1 in the unified agent image and give it an entrypoint that runs it the way ProPR runs every agent: as root-started containers that drop to node, with disposable runtime state and the host credential store mounted as a source.
Acceptance:
Dockerfile.agenthas api-clistage installing@earendil-works/pi-coding-agent@${PI_CLI_VERSION}(default1.6.1), copied into the final image withpion PATH. The build verifiespi --versionand thatpi --helplists--mode,--print,--model,--thinking,--tools,--no-builtin-tools,--session-dir,--no-approve. Node in the image (22.23.x) satisfies Pi's>=22.19.0.scripts/build-images.shhasPI_CLI_VERSION, matching the Dockerfile ARG; both bundle-content hash lists include the new files;AGENT_DEFAULT_VERSIONSgetspi: '1.6.1'; CLI version management resolves Pi versions from npm (@earendil-works/pi-coding-agent).- New
scripts/pi-entrypoint.sh, dispatched fromscripts/agent-entrypoint.sh. It creates a disposable agent dir (e.g./tmp/propr-pi-home/agent, exported asPI_CODING_AGENT_DIR) and copiesauth.json,settings.json,models.jsonandAGENTS.md/SYSTEM.md/APPEND_SYSTEM.mdfrom the mounted host dir (source env, e.g.PROPR_PI_SOURCE_DIR). It never copies hostsessions/,extensions/ormcp.json; ProPR generatesmcp.jsonitself. It setsPI_SKIP_VERSION_CHECK=1andPI_TELEMETRY=0, and puts sessions under the runtime home. - Everything the entrypoint runs before the task (version probe, any
pi auth/picall) runs asnode(su-exec node env HOME=/home/node …), never as root. - After the run, OAuth refreshes are written back to the host
auth.json: per provider entry, and only if the host entry still equals what was seeded (compare-and-swap), so a host login or logout during the run wins. API-key entries are never rewritten. The write is atomic, via a temp file created owner-only (os.open(..., O_CREAT|O_EXCL, 0o600)), keeping the original file mode. Nothing is written when no OAuth entry changed. Implement it as a small Python helper likescripts/opencode-credentials.py(seed/sync) with unit tests. - Agent env vars (e.g.
OPENROUTER_API_KEY,ANTHROPIC_API_KEY,OPENAI_API_KEY,GEMINI_API_KEY) are forwarded as for other agents. - The egress allowlist covers what Pi needs for the configured providers; Pi's own update and telemetry endpoints stay off.
- Smoke tests (
scripts/smoke-test-images.sh):pi --versionthrough the entrypoint; the entrypoint started as root (--user 0:0) with a mounted source dir leaves nothing under the runtime dir thatnodedoesn't own.
Implementation
Model the entrypoint on scripts/opencode-entrypoint.sh and scripts/vibe-entrypoint.sh, the credential helper on scripts/opencode-credentials.py (seed snapshot of the imported auth.json, sync with per-entry compare-and-swap), and the root-ownership smoke check on the OpenCode one in scripts/smoke-test-images.sh. Update third-party notices generation for the new npm package. Keep the CLI-version change flow (packages/core/src/agents/version/*) consistent with the other npm-installed agents.
Notes
Verified with Pi 1.6.1:
pi -p --mode jsonemits strict JSONL on stdout; diagnostics go to stderr.- The prompt can come from stdin or as an
@/path/to/fileargument. PI_CODING_AGENT_DIRrelocates~/.pi/agent, and Pi createsauth.jsonandmodels-store.jsonthere on first run.pi authsubcommands:login <provider> [--api-key] [--no-browser],logout,check [--provider] [--json] [--no-refresh],print-api-key,print-bearer-token.- Lesson from the OpenCode 2 upgrade: a version probe run as root created a root-owned log file that broke every run. Probe as node, and smoke-test as root.
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-53831/claude-opus-5-5-pi-install-the-cli-in-the-20261127-1443-62s3831-epic-pi-coding-jmlissue-3831-20261127-1443-claude-opus-5-5-62s🔍 Track Task Execution