Skip to content

Add pi coding agent devcontainer feature#1

Merged
RodriBus merged 3 commits into
mainfrom
feature/pi-coding-agent
May 18, 2026
Merged

Add pi coding agent devcontainer feature#1
RodriBus merged 3 commits into
mainfrom
feature/pi-coding-agent

Conversation

@RodriBus
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new pi-coding-agent Dev Container Feature that installs Pi via npm and provides a post-start hook to import/configure Pi agent state (settings/auth/etc.), optionally manage persistent session storage, and optionally sync extension packages when imported settings change.

Changes:

  • Introduces the pi-coding-agent feature (install scripts, runtime post-start hook, settings helper).
  • Adds scenario-based feature tests covering version pinning, non-root imports, copy-if-newer behavior, session persistence (bind/volume), and settings-driven package sync.
  • Updates repository CI/release workflows and docs to support publishing and running feature tests with a Node-capable base image.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/pi-coding-agent/test.sh Autogenerated smoke test for basic install/runtime hook presence.
test/pi-coding-agent/settings_package_sync.sh Scenario test for settings import triggering pi update --extensions only on change.
test/pi-coding-agent/settings_helper.sh Scenario test for the Node settings helper module behavior.
test/pi-coding-agent/session_volume.sh Scenario test for volume-backed session persistence configuration.
test/pi-coding-agent/session_bind/session-bind-data/.keep Placeholder content for bind-mount scenario data directory.
test/pi-coding-agent/session_bind.sh Scenario test for bind-mounted session persistence overriding sessionDir.
test/pi-coding-agent/scenarios.json Defines all test scenarios for the feature.
test/pi-coding-agent/pinned_version.sh Scenario test ensuring a pinned Pi version is installed.
test/pi-coding-agent/non_root_imports.sh Scenario test covering non-root config imports + permission normalization.
test/pi-coding-agent/latest_with_node.sh Scenario test validating “latest” install behavior.
test/pi-coding-agent/duplicate.sh Duplicate-install/idempotency test coverage.
test/pi-coding-agent/copy_if_newer.sh Scenario test validating copy-if-newer behavior for files/dirs.
src/pi-coding-agent/runtime/settings-helper.mjs Node helper to safely update settings.json for session storage.
src/pi-coding-agent/runtime/post-start.sh Post-start hook to import config, configure sessionDir, and optionally sync extensions.
src/pi-coding-agent/README.md Feature documentation (usage/options).
src/pi-coding-agent/NOTES.md Additional guidance (import root layout, session persistence, testing notes).
src/pi-coding-agent/install.sh OS/runtime prerequisites and entrypoint to main installer.
src/pi-coding-agent/install-main.sh Installs Pi via npm, installs extensions, installs runtime hook, persists options.
src/pi-coding-agent/devcontainer-feature.json Feature metadata/options, mounts, postStartCommand wiring.
README.md Repository-level documentation updated for the new feature and test commands.
.github/workflows/test.yaml CI runs feature tests with a Node-capable base image.
.github/workflows/release.yaml Publishing workflow using devcontainers/action + PR for generated docs.
.devcontainer/devcontainer.json Authoring devcontainer updated for this repo’s workflow/tooling.
.devcontainer/devcontainer-lock.json Locks authoring devcontainer feature dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/pi-coding-agent/runtime/post-start.sh Outdated
Comment thread src/pi-coding-agent/runtime/post-start.sh Outdated
Comment thread test/pi-coding-agent/latest_with_node.sh Outdated
Comment thread test/pi-coding-agent/scenarios.json
Comment thread src/pi-coding-agent/NOTES.md Outdated
RodriBus and others added 2 commits May 18, 2026 20:43
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.

Comment on lines +24 to +39
| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| version | Version of @earendil-works/pi-coding-agent to install. | string | latest |
| configImportRoot | In-container staging root from which selected Pi configuration files are copied at startup. | string | /mnt/pi-coding-agent-import |
| mapAllConfigurations | Import all supported Pi configuration files and directories from configImportRoot. When enabled, individual map* options are ignored and a warning is logged if any are also set. | boolean | false |
| mapAuth | Copy auth.json from the import root into ~/.pi/agent/auth.json if the source exists and is newer. | boolean | false |
| mapSettings | Copy settings.json from the import root into ~/.pi/agent/settings.json if the source exists and is newer. | boolean | false |
| mapKeybindings | Copy keybindings.json from the import root into ~/.pi/agent/keybindings.json if the source exists and is newer. | boolean | false |
| mapSkills | Copy the skills directory from the import root into ~/.pi/agent/skills using copy-if-newer behavior. | boolean | false |
| mapPrompts | Copy the prompts directory from the import root into ~/.pi/agent/prompts using copy-if-newer behavior. | boolean | false |
| mapThemes | Copy the themes directory from the import root into ~/.pi/agent/themes using copy-if-newer behavior. | boolean | false |
| mapExtensions | Copy the extensions directory from the import root into ~/.pi/agent/extensions using copy-if-newer behavior. | boolean | false |
| mapModels | Copy models.json from the import root into ~/.pi/agent/models.json if the source exists and is newer. | boolean | false |
| sessionPersistenceMode | Use a user-managed bind mount or a feature-managed named volume as Pi session storage. Volume mode mounts a per-devcontainer named volume automatically. | string | none |
| sessionStoragePath | Mounted in-container path to use as live Pi session storage when sessionPersistenceMode is bind. Ignored when sessionPersistenceMode is volume. | string | /mnt/pi-coding-agent-sessions |

Comment on lines +73 to +85
mkdir -p "$(dirname "${target_path}")"

if [[ -e "${target_path}" && ! "${target_path}" -ot "${source_path}" ]]; then
log "Skipped ${label}; destination is up to date."
return 0
fi

cp -f "${source_path}" "${target_path}"
touch -r "${source_path}" "${target_path}"

if [[ "$(basename "${target_path}")" == "auth.json" ]]; then
chmod 600 "${target_path}" || true
fi
warn "Requested ${label} import but '${source_path}' is not a directory."
return 0
fi

Comment on lines +7 to +15
expected_version="$(npm view @earendil-works/pi-coding-agent version 2>/dev/null | tr -d '\r\n')"

if [[ -z "${expected_version}" ]]; then
echo "Failed to determine the latest Pi version from npm metadata" >&2
exit 1
fi

check "pi command available" pi --version
check "latest Pi version installed" bash -c 'test "$(pi --version 2>&1 | tr -d "\r\n")" = "$1"' _ "${expected_version}"
Comment on lines +97 to +103
"mounts": [
{
"source": "${localWorkspaceFolder}/.devcontainer/session-bind-data",
"target": "/mnt/pi-coding-agent-sessions",
"type": "bind"
}
],
@RodriBus RodriBus merged commit 5c1abc2 into main May 18, 2026
2 checks passed
@RodriBus RodriBus deleted the feature/pi-coding-agent branch May 18, 2026 20:40
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.

2 participants