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)
This commit is contained in:
@@ -7,6 +7,10 @@
|
||||
- [x] Remove explicit repo mount from pi-agent manifest; synthesize mount in compile_compose
|
||||
- [x] Add _get_repository_mount_name() helper to derive workspace name from remote URL
|
||||
- [x] Switch workspace storage layout to /data/working-copies/{workspace_id}/{repo_name}/
|
||||
- [x] Update unit tests
|
||||
- [x] Run quality gates (pytest unit, ruff, mypy)
|
||||
- [x] Update unit tests for workspace/home-directory migration
|
||||
- [x] Run quality gates for workspace/home-directory migration
|
||||
- [x] Remove compose-level `user: 0:0` override so entrypoint can drop privileges
|
||||
- [x] Pass manifest-declared container user to terminal sessions via `docker exec --user`
|
||||
- [x] Update unit tests for container user/terminal changes
|
||||
- [ ] Run quality gates for container user/terminal changes
|
||||
- [ ] Commit and push
|
||||
|
||||
Reference in New Issue
Block a user