Repository navigation
Honor PI_CODING_AGENT_DIR for Pi MCP and skills - #6839
Merged
Merged
Conversation
thv llm setup already wrote models.json under $PI_CODING_AGENT_DIR, but the Pi MCP config (mcp.json) and global skills still resolved to ~/.pi/agent. A user with the variable set ended up with gateway config in their custom dir and MCP servers and skills in the default. Move the override into a declarative ConfigDirEnvVar field on the client entry and resolve it in one place, so MCP config, client detection, global skills, and LLM settings all agree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6839 +/- ##
==========================================
- Coverage 79.71% 79.68% -0.04%
==========================================
Files 817 817
Lines 83411 83421 +10
==========================================
- Hits 66492 66473 -19
- Misses 16914 16943 +29
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JAORMX
approved these changes
Oct 15, 2026
1 task
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
thv llm setupwrite Pi'smodels.jsonunder$PI_CODING_AGENT_DIR, but Pi's MCP config (mcp.json), global skills directory, and install detection still hardcoded~/.pi/agent. A user with the variable set got gateway config in their custom directory while MCP servers and skills landed in the default one (review comment).ConfigDirEnvVarfield toclientAppConfigand set it toPI_CODING_AGENT_DIRon the Pi entry, replacing the Pi-specificClientTypecheck inbuildLLMSettingsPath.configDirOverride, keeping the existing~and relative-path handling) and route every Pi path through it: MCP config (register, create,GetConfigPathvia a newbuildMCPConfigPath),IsClientInstalled, global skills (<dir>/skills/<name>), and LLM settings.Type of change
Test plan
task test)task lint-fix)Ran the
pkg/clientandpkg/skillsunit tests directly (go test -race), not the fulltask testsuite. AddedTestPiAgentDirOverrideAppliesToMCPAndSkills, which failed before the fix (mcp.jsonresolved under~/.pi/agent) and passes after.Does this introduce a user-facing change?
Yes, for Pi users who set
PI_CODING_AGENT_DIR:thv client register piwrote~/.pi/agent/mcp.json,thv skill install(user scope) wrote to~/.pi/agent/skills/, and Pi counted as installed only if~/.pi/agentexisted, even thoughthv llm setupused$PI_CODING_AGENT_DIR/models.json.$PI_CODING_AGENT_DIR. Users without the variable see no change.Special notes for reviewers
~/.pi/agentfor users with the variable set are not migrated; they will need to re-register.mcp.jsonand skills fromPI_CODING_AGENT_DIR, per the review comment; not independently verified against Pi.🤖 Generated with Claude Code