Add Pi coding agent backend support#8
Open
jjar1 wants to merge 3 commits into
Open
Conversation
added 3 commits
May 4, 2026 18:38
Implemented: - _probe_pi(): probes pi --help for required tokens (--print, --session, --session-dir, --no-skills, --model) - _pi_command(): builds pi -p --session-dir --no-skills --no-extensions --no-prompt-templates --no-context-files - _pi_resume_command(): builds pi -p --session <id> with isolation flags - _extract_pi_session_id(): extracts session ID from JSONL header in artifacts dir - Host detection: PI_CODING_AGENT=true detected first in _detect_host_backend() - Model override: TRYCYCLE_PI_MODEL env var, supports pi's model:thinking syntax - Transcript adapter pi_cli.py: canary-based search + turn extraction from Pi JSONL - Registration: pi in build.py ADAPTERS, pi-cli/pi in run_phase.py choices - 8 new PiBackendTests (probe, host detection, run, resume, model override, failure) - Fixed 8 existing tests that leaked PI_CODING_AGENT=true from real env Tests: 92 passed, 4 skipped. Ruff clean. Mypy clean on new code.
- Remove all Claude Code / Codex / Kimi / OpenCode backend references - Remove all native-mode branches and choice points - Simplify phase wrapper to always use run_phase.py run (fallback-runner) - Simplify transcript helper to always use pi-cli with canary - Simplify subagent defaults to always use --backend host, TRYCYCLE_PI_MODEL - Remove non-Pi model env vars (TRYCYCLE_CODEX_*, TRYCYCLE_CLAUDE_*, etc.) - Preserve all critical rules (timeout, no kill, no busy-poll) - Add 9 tests validating acceptance criteria in test_skill_md_pi_only.py - 101 tests pass (92 original + 9 new)
… pattern Tests cover: canary session discovery, multi-turn extraction, thinking/ toolCall filtering, non-message record skipping, missing sessions root, canary timeout, _encode_cwd path encoding, and last-assistant-per-interval semantics. 119 total tests pass (up from 101).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Pi (
picoding agent) as a fifth backend to trycycle, enabling trycycle to run as both host agent and subagent backend.Changes
subagent_runner.py): probe, run, resume, session extraction, host detection viaPI_CODING_AGENTenv varpi_cli.py): canary-based search of Pi session JSONL filesbuild.py(ADAPTERS) andrun_phase.py(CLI choices)Quality
.ralph/specs/pi-backend.md