Repository navigation
refactor(pi): unify config format and add pi-agent execution layer - #26
Conversation
- Unify pi plugin configuration to the standard endpoint format - Add dedicated pi-agent execution layer for task delegation - Resolve worktree isolation and default THINKING behavior - Bump pi plugin version to 0.2.0 This change updates the pi plugin to use the new endpoint configuration format and introduces a dedicated agent file for task execution. It also addresses critical isolation issues with worktrees and stabilizes the default THINKING configuration, while synchronizing versioning across the marketplace and plugin manifests. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
- Introduce pi-agent as the dedicated execution layer for pi operations - Standardize plugin configuration to use endpoint-based models.json - Ensure worktree isolation for agent state via configurable directories - Set default thinking mode to max and update version to 0.2.0 This change introduces the pi-agent execution layer to unify how the plugin interacts with the pi CLI. It refactors configuration to use an endpoint-based system, improves isolation for worktrees by moving agent state into project-local directories, and sets a default configuration for execution tasks while bumping the project version. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
- Unify pi plugin configuration to a named-endpoint format - Add dedicated pi-agent execution layer for all tasks - Fix worktree isolation for non-global state paths - Change default thinking level to 'max' - Bump pi plugin version to 0.2.0 This change unifies the configuration structure for both delegate and review skills by adopting a shared named-endpoint format. All execution is now offloaded to a dedicated pi-agent layer, ensuring consistent backgrounding, validation, and error reporting. Worktree isolation was improved by allowing configurable agent directories to prevent out-of-worktree writes, and default settings were updated to prioritize 'max' thinking. The plugin version is bumped to 0.2.0. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
- Revert marketplace.json to 1-space indentation - Bump pi plugin version to 0.2.0 This change restores consistent 1-space formatting in the marketplace config and updates the pi plugin version to 0.2.0. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
- Use PROVIDER_KEY to isolate agent configuration - Preserve empty PROVIDER values for default use - Reconfigure defaultEndpoint instead of static keys - Conditionalize provider flag injection This prevents the PI agent from leaking the openai provider into the environment, allowing it to fall back to defaults. It also updates the setup skill to resolve the defaultEndpoint dynamically, preventing orphan entries. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
- Remove pi tool from delegate skill for flow enforcement - Include project and user CLAUDE.md in pi-agent context - Document bash requirement for resolve_env in scripts This change updates the delegate skill by removing direct pi tool access to ensure architectural consistency. It integrates CLAUDE.md file collection into the pi-agent delegation logic for better context awareness and adds critical documentation regarding bash shell requirements for environment variable resolution. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
Code Terrier Review: primary reviewer failedThe primary model The primary is the verifier and publish identity for a review — without it, any findings the
Failure detailPush a new commit (or re-run the review) once the underlying cause is resolved. |
- Route doctor command through pi-agent for permissions - Enable MODE=doctor within pi-agent lifecycle - Resolve AGENT_DIR consistently across configurations - Gate git context collection on MODE=delegate - Apply conditional provider flags in test execution This refactor centralizes agent diagnostics by routing the doctor workflow through pi-agent, ensuring consistent configuration resolution. It fixes directory targeting for model definitions by prioritizing custom AGENT_DIR paths. Additionally, the update optimizes context overhead by gating git data collection and improves provider selection logic. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
- Replace logical chains with explicit conditional blocks - Pin doctor probe to directory for environment isolation - Use bash arrays to prevent shell word splitting This update hardens the pi cli by resolving provider logic flaws, enforcing local directory scoping for doctor probes, and implementing shell-safe command execution. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
- Add model ownership verification to ensure consistency between endpoints - Implement CLI --endpoint and --model override resolution - Re-resolve provider and base URL settings after CLI flag processing This change updates the delegate and review skill readers to validate that the selected model belongs to the active endpoint, falling back to the first available model if a mismatch occurs. It also introduces robust handling for CLI overrides, allowing users to explicitly select endpoints or models, which triggers a re-resolution of provider and configuration metadata to maintain consistency. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
- Re-resolve model and endpoint with flag region scoping - Move model ownership checks after CLI re-resolution - Pin setup probes to PI_CODING_AGENT_DIR and default to openai - Honor TASK_TEXT in empty-diff guard for review This refactor isolates flag parsing from task descriptions, ensuring correct scoping for models and endpoints. It also centralizes ownership checks, fixes setup probe paths, and improves empty-diff logic. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
Code Terrier Review: primary reviewer failedThe primary model The primary is the verifier and publish identity for a review — without it, any findings the
Failure detailPush a new commit (or re-run the review) once the underlying cause is resolved. |
|
@code-terrier review |
- Remove unmatched fi block in review settings snippet - Prevent model overrides when --model CLI flag is provided - Allow provider to remain empty during endpoint creation This change fixes a bash syntax error in the review settings, ensures that CLI-provided model arguments take precedence over configuration defaults, and allows the provider field to remain empty upon endpoint creation to support default selection logic. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
- Redirect stdin from /dev/null for pi commands - Resolve API_KEY and BASE_URL within pi-agent - Remove sensitive credentials from caller context - Enforce background execution for all pi tasks This refactor enhances security and reliability. By resolving secrets locally within the agent, we prevent sensitive data from leaking into the model prompt. Redirecting stdin prevents hanging, while background execution ensures consistent process handling. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
|
@code-terrier review |
- Add ENDPOINT input for credential resolution - Remove API_KEY and BASE_URL from doctor handoff - Update documentation for agent-side loading This change updates the pi-agent protocol to pass only the non-secret ENDPOINT. By delegating credential resolution to the agent's local settings, we prevent raw secrets from entering the model context during handoffs. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
|
@code-terrier review |
- Parse cli --api-key in delegate skill for overrides - Pass cli-provided api key to pi-agent execution - Export resolved credentials for doctor probe - Prevent config secrets from leaking into context This change updates the delegate skill to allow api key overrides via cli flags. It secures the execution context by preventing config file secrets from leaking into the model and ensures doctor mode correctly tests connectivity by exporting resolved credentials. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
|
@code-terrier review |
- Prevent CLI --api-key from being overwritten by config - Update resolution logic to prioritize CLI input - Move config reading script to references/settings.md - Reduce token overhead in skill documentation This change ensures the CLI provided API key takes precedence over config file values. The resolution logic was updated to check existing values before reading from files, and documentation was refined to reduce token overhead. Co-Authored-By: DeepSeek V4 Flash <noreply@deepseek.com> Co-Authored-By: Git Agent <noreply@git-agent.dev>
What
Refactor the pi plugin to unify its configuration format and add a dedicated execution layer.
delegate,review, andsetupnow share the same endpoint-first settings format (endpoints/defaultEndpoint/defaultModel), with legacy flat fields kept as a fallback.pi:pi-agentexecution layer: all pi CLI runs go through a dedicated agent that builds the command as an array (zsh-safe), runs it in the background, and verifies the real outcome — delegate checksgit diff --stat, review returns pi's stdout.AGENT_DIR/PI_CODING_AGENT_DIRkeeps pi state inside the project, and models.json merges idempotently (baseUrl + model registration, skip when unchanged) to avoid out-of-worktree writes.max: all config defaults now use the highest thinking level.--edit-config --sharedwarns thatapiKeymust be a$ENV_VARreference (tracked file, no literal secrets).Why
delegateandreviewread different config formats, so a single.claude/pi.local.jsoncould configure one but not the other.$HOME/.piis rejected; the agent-dir redirection fixes that.Validation
validate-plugin.py pi→ PASSED (no issues)Notes
main(default branch). No open issues are linked.🤖 Generated with Claude Code