Skip to content

fix(pi): honor the host configuration directory for global settings - #232

Closed
Wolfie (wolfiesch) wants to merge 1 commit into
braintrustdata:mainfrom
wolfiesch:fix/pi-host-config-directory
Closed

Wolfie (wolfiesch) wants to merge 1 commit into
braintrustdata:mainfrom
wolfiesch:fix/pi-host-config-directory

Conversation

@wolfiesch

Copy link
Copy Markdown
Contributor

The Pi extension reads project settings from the running host's config directory (piConfig.configDir), but global settings always come from ~/.pi/agent/braintrust.json. A Pi-compatible host with its own config directory, or one that relocates its agent directory with PI_CODING_AGENT_DIR (for example, named profiles), has no global settings file of its own.

loadConfig now layers:

  1. ~/.pi/agent/braintrust.json, which bt trace enable pi writes, so existing setups keep working
  2. braintrust.json in the host's agent directory (PI_CODING_AGENT_DIR, or ~/<configDir>/agent) when that path differs from ~/.pi/agent
  3. the project file, unchanged

Upstream Pi without PI_CODING_AGENT_DIR reads exactly the files it read before. The README documents the order.

Validation (src/plugins/pi/content):

  • vp check
  • vitest run; new cases in config.test.ts cover PI_CODING_AGENT_DIR, a host config directory overriding ~/.pi/agent, and a host still honoring the file bt trace enable pi writes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-27T08:58:27.962351Z
We couldn’t complete this review. Comment @codex review to try again.
2eb6058 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@wolfiesch

Copy link
Copy Markdown
Contributor Author

CI passed on my fork at this PR's head (2eb6058): https://github.com/wolfiesch/braintrust-coding-agent-plugins/actions/runs/40477567227

@wolfiesch

Copy link
Copy Markdown
Contributor Author

Closing this. bt trace enable pi writes ~/.pi/agent/braintrust.json, and the extension already reads that file under any Pi-compatible host, so a second global layer isn't needed. Adding one would also require bt trace enable, disable, and doctor to manage the host file; otherwise disable could leave tracing on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant