Conversation
- Settings -> Configuration Files: "Open SYSTEM.md" / "Open APPEND_SYSTEM.md" buttons create the file in the agent directory when missing (SYSTEM.md with a confirmation) and open it in an editor tab - Show a warning in Settings when pi-agent.systemPrompt / pi-agent.appendSystemPrompts override the SYSTEM.md files - Apply pi-agent.agentDir by bridging it to PI_CODING_AGENT_DIR at activation; setting description notes the required window reload - Test lane: add a real-host openConfigFile spec, prefer the real Electron binary over the distro code wrapper in runTest (silent-exit flake), and keep the vscode facade mockable against VS Code 1.137's frozen workspace.fs namespace 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
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.
What this does
User-facing feature: Settings → Configuration Files now has "Open SYSTEM.md" and "Open APPEND_SYSTEM.md" buttons, mirroring the existing settings/auth/models buttons. Clicking creates the file in PI's agent directory (default
~/.pi/agent, configurable viapi-agent.agentDir) when missing and opens it in a VS Code editor tab. SYSTEM.md replaces PI's built-in system prompt for new sessions, so first creation asks for confirmation; APPEND_SYSTEM.md appends to PI's prompt and is created silently. Existing files are never clobbered.Override warning: when
pi-agent.systemPrompt/pi-agent.appendSystemPromptsare set in VS Code settings, PI's SDK ignores the SYSTEM.md/APPEND_SYSTEM.md files entirely. The Settings panel now fetches the active override state from the host and shows a warning naming the overriding setting, so the buttons are never silently inert.pi-agent.agentDirenv bridge: the setting was documented (README, package.json) but read by nothing — the SDK honors only thePI_CODING_AGENT_DIRenv var. Activation now bridges the setting into that env var before the provider is built, so agent dir resolution (sessions, auth, models, prompt files) honors it. Changes take effect after a window reload; the setting description now says so.Test-lane repairs:
src/test/suite/realhost-openconfigfile.test.ts): drivesopenConfigFileinside the actual VS Code extension host — real dialogs (auto-answered), real editor tabs, real filesystem, temp agent dir — covering create, confirm, cancel, EEXIST-preserve, and invalid-key rejection.runTest.tsnow prefers the real Electron binary over the distrocodewrapper:/usr/bin/code→…/bin/codere-forks the GUI via cli.js, the test runner loses process ownership, and the run exits 0 without ever starting mocha (observed silent-exit flake).suite/index.ts) stays mockable against VS Code 1.137's frozenworkspace.fsnamespace: frozen plain objects are now treated as real namespaces (never copied by reference), andresetVscodeMocksstubsfs.readFilelike the plain-Node facade already does.Also: unit tests for the new message/handler paths (deduplicated scaffolding via a shared stub helper) and a CHANGELOG entry.
Verification
pnpm run build— 0 errorspnpm run lint— cleannode scripts/run-node-tests.mjs) — 571 pass / 1 fail; the 1 is the pre-existing light-mode flake, which fails identically on the untouched baselineMOCHA_GREP="MessageHandler"— 116 pass, exit 0scripts/run-node-tests.mjsexists) and unrelated to this change