feat: add Pi agentic engine (experimental)#29789
Conversation
- Add Pi engine implementation with JSONL streaming log support - Add engine.extensions field for pi install <ext> support - Add validation: Pi requires gh-proxy + cli-proxy - Add parse_pi_log.cjs JS log parser and step summary renderer - Register Pi engine in registry and update tests Agent-Logs-Url: https://github.com/github/gh-aw/sessions/7c1c5a7b-0fe3-451f-a2ae-7dc529e01118 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot update dev.md to use pi agentic engine and summarize README.md into a comment |
There was a problem hiding this comment.
Pull request overview
Adds the new experimental Pi (pi) agentic engine across the workflow compiler, including configuration parsing, validation, and default networking/domain support.
Changes:
- Registers the
piengine in engine catalogs/registry and updates golden fixtures/workflow lockfiles to include.pi+PI.md. - Adds compiler-time validation enforcing
tools.github.mode: gh-proxyandtools.cli-proxy: truefor Pi workflows. - Introduces Pi-specific default domain allow-listing and an
engine.extensionsfrontmatter field parsed intoEngineConfig.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/engine_validation.go | Adds Pi-specific compile-time validation for required tool/proxy settings. |
| pkg/workflow/compiler_string_api.go | Invokes the new Pi validation during string-based workflow parsing. |
| pkg/workflow/engine.go | Adds EngineConfig.Extensions and parses engine.extensions from frontmatter. |
| pkg/workflow/domains.go | Introduces PiDefaultDomains and wires Pi into allowed-domain computation. |
| pkg/constants/* | Adds Pi constants (engine id, port, env vars, default version) and updates tests. |
| pkg/workflow/data/engines/pi.md | Adds engine metadata definition for Pi. |
| pkg/workflow/golden / .github/workflows/*.lock.yml | Updates fixtures/lockfiles to include Pi agent folder/file entries. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 231/231 changed files
- Comments generated: 3
| // PiDefaultDomains are the default domains required for the Pi CLI to operate. | ||
| // Pi routes its API calls through the AWF LLM gateway (host.docker.internal) when | ||
| // the firewall is enabled. The pi.dev domain covers the Pi API endpoint. | ||
| var PiDefaultDomains = []string{ |
| // DefaultPiVersion is the default version of the Pi CLI | ||
| const DefaultPiVersion Version = "latest" | ||
|
|
| // Extract optional 'extensions' field (array of strings; used by the Pi engine) | ||
| if extVal, hasExt := engineObj["extensions"]; hasExt { | ||
| if extArray, ok := extVal.([]any); ok { | ||
| config.Extensions = make([]string, 0, len(extArray)) | ||
| for _, ext := range extArray { | ||
| if extStr, ok := ext.(string); ok && extStr != "" { | ||
| config.Extensions = append(config.Extensions, extStr) | ||
| } | ||
| } | ||
| engineLog.Printf("Extracted engine.extensions: %v", config.Extensions) | ||
| } | ||
| } |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/64302d83-017c-47e9-b216-4ff807a2d10c Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 66841f0. Updated Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
🧪 Test Quality Sentinel ReportTest Quality Score: 71/100
Test Classification DetailsView all 44 test classifications
Flagged Tests — Suggestionsi️
|
| Component | Score | Calculation |
|---|---|---|
| Behavioral Coverage (40 pts) | 39 | 43/44 design tests × 40 |
| Error/Edge Case Coverage (30 pts) | 12 | 18/44 tests with error paths × 30 |
| Low Duplication (20 pts) | 20 | 0 duplicate clusters |
| Proportional Growth (10 pts) | 0 | pi_validation_test.go exceeds 2:1 ratio |
| Total | 71 |
Verdict
✅ Check passed. 2% of new tests are implementation tests (threshold: 30%). The overall test quality is good — all new Go test files have proper
//go:buildtags, no mock libraries are used in Go, and all testify assertions include descriptive messages. The main opportunity is expanding error/edge case coverage inpi_engine_test.go(currently 14% edge-case rate for engine property tests).
📖 Understanding Test Classifications
Design Tests (High Value) verify what the system does:
- Assert on observable outputs, return values, or state changes
- Cover error paths and boundary conditions
- Would catch a behavioral regression if deleted
- Remain valid even after internal refactoring
Implementation Tests (Low Value) verify how the system does it:
- Assert on internal function calls (mocking internals)
- Only test the happy path with typical inputs
- Break during legitimate refactoring even when behavior is correct
- Give false assurance: they pass even when the system is wrong
Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators.
References: §25257232827
🧪 Test quality analysis by Test Quality Sentinel · ● 1.1M · ◷
There was a problem hiding this comment.
✅ Test Quality Sentinel: 71/100. Test quality is acceptable — 2% of new tests are implementation tests (threshold: 30%). All new Go test files have proper build tags, no mock libraries are used in Go, and assertion messages are present throughout. See the detailed analysis comment for suggestions on expanding error/edge case coverage.
|
…pin, extensions []string, version checks) Agent-Logs-Url: https://github.com/github/gh-aw/sessions/d2bc0004-089f-4636-8908-caf4082301ab Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed all review comments in 1037d79:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Adds Pi (
pi) as an experimental agentic engine. Pi is driven via stdin, emits a streaming JSONL log, and requires bothtools.github.mode: gh-proxyandtools.cli-proxy: true— enforced at compile time.Engine core (
pkg/workflow/pi_engine.go,pi_logs.go)cat prompt.txt | pi run --json-log /tmp/gh-aw/pi-streaming.jsonlPI_API_BASE_URL → host.docker.internal:10004(PiLLMGatewayPort)ParseLogMetricsparses JSONL events:init,assistant,tool_use,tool_result,resultExtensions field (
pkg/workflow/engine.go)New
engine.extensionsfrontmatter field — each entry runspi install <ext>before the agent starts. The field accepts both[]any(YAML-decoded) and[]string(programmatic) forms; unexpected types are logged and skipped:Compiler validation (
pkg/workflow/engine_validation.go)validatePiEngineRequirementserrors at compile time if eithertools.github.mode: gh-proxyortools.cli-proxy: trueis absent — Pi's API integration requires both.Log parsing (
actions/setup/js/parse_pi_log.cjs)JS step-summary renderer transforms Pi JSONL into the canonical conversation format (merges streaming delta chunks, maps
tool_use/tool_resultpairs to ✅/❌).Constants / domains
PiLLMGatewayPort = 10004,DefaultPiVersion = "0.0.1"(pinned),EnvVarModelAgentPi,PiCLIModelEnvVarPiDefaultDomainsregistered inengineDefaultDomainswithapi.pi.aias the Pi API endpoint; Pi case added tocomputeAllowedDomainsForSanitizationVersion checks
getInstallationVersionandgetDefaultAgentModelincompiler_yaml_lookups.goTestAgentVersionInAwInfoandTestGetInstallationVersionDev workflow (
dev.md)Updated
.github/workflows/dev.mdto useengine: pi(with the requiredtools.github.mode: gh-proxyandtools.cli-proxy: true). README summary added as an HTML comment.