Files
Developer 9f720930ea fix: run tool terminal sessions as container user instead of root
- Remove compose-level user: 0:0 override from manifest_compiler.py so the
  entrypoint can start as root, fix mount ownership, and drop privileges to
  the container user internally.
- Add get_manifest_container_user() helper to resolve the manifest-declared
  container user (with uid:gid fallback).
- Pass container user through TerminalSession, TerminalManager, and the
  terminal WebSocket handler so docker exec is invoked with --user <user>.
- Update and add unit tests for the manifest compiler and terminal session.
- Record the additional root-user fix in the fix-pi-container-mount-permissions
  OpenSpec change/tasks.

Quality gates: pytest tests/unit/ (226 passed), pytest tests/services/test_terminal_manager_multi.py (7 passed), ruff check on changed files (clean), mypy on changed files (clean)
2026-06-17 20:51:46 +00:00

1.1 KiB

Tasks: fix pi container repo mount and npm update permissions

  • Investigate root cause (manifest target, missing variables, npm prefix)
  • Create Alembic data migration to update pi-agent manifest
  • Update manifest_compiler.py: {{WORKSPACE_NAME}} substitution, env var, entrypoint runtime var, npm prefix
  • Update instance_service.py to pass REPO_NAME/WORKSPACE_NAME
  • Remove explicit repo mount from pi-agent manifest; synthesize mount in compile_compose
  • Add _get_repository_mount_name() helper to derive workspace name from remote URL
  • Switch workspace storage layout to /data/working-copies/{workspace_id}/{repo_name}/
  • Update unit tests for workspace/home-directory migration
  • Run quality gates for workspace/home-directory migration
  • Remove compose-level user: 0:0 override so entrypoint can drop privileges
  • Pass manifest-declared container user to terminal sessions via docker exec --user
  • Update unit tests for container user/terminal changes
  • Run quality gates for container user/terminal changes
  • Commit and push