Skip to content

fix(web): preserve session worktree executable bits under strict umask - #911

Open
627150795 wants to merge 1 commit into
openpi-dev:mainfrom
627150795:fix/session-worktree-umask-908
Open

627150795 wants to merge 1 commit into
openpi-dev:mainfrom
627150795:fix/session-worktree-umask-908

Conversation

@627150795

@627150795 627150795 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #908. Session worktree snapshots apply a tracked-file Git patch after creating a detached checkout. Under umask 077, Git can apply the executable mode as 0700, dropping group and other execute bits from tracked scripts.

Value

Session worktrees preserve executable tracked files under restrictive POSIX umasks, so scripts remain runnable by the intended users.

Approach

  • Collect 100755 paths from the snapshot's temporary Git index.
  • After checkout and patch application, restore missing execute bits on POSIX while preserving the file's other permission bits.
  • Add regression coverage for explicit umask 022 and umask 077; restore the process umask in finally.
  • Keep Windows behavior unchanged and do not modify the process umask in production.

Validation

Validated against rebased PR head 831318dd280d1d9d4a1611541855d17620046c35.

  • POSIX regression integration: node --test --experimental-strip-types tests/web/session-worktree.test.ts — 27/27 passed on Linux/WSL with Node 22.19.0.
  • PiWebRuntime fork integration: 1/1 passed using the real Pi runtime with the fixture provider.
  • bun run check — passed with Node 22.19.0 and Bun 1.3.14.
  • VITEST_MAX_WORKERS=1 bun run test — passed: Node 2,428 passed / 8 platform skips; Vitest 1,623 passed across 107 files. The worker cap accounts for WSL reporting 24 parallel CPUs despite lower effective throughput; no project test configuration was changed.
  • GitHub Actions run 40803485954 — not green: 13 checks passed, 3 failure entries (one root Web E2E shard and two aggregate checks), and 2 downstream checks were cancelled. The root failure timed out in the unrelated tests/web/openpi-web.e2e.ts unknown-prompt-admission case after the “send as new message” button stayed disabled for 30 seconds. GitHub rerun requires repository admin rights; the local retry could not start because Chromium is absent from the WSL Playwright cache.
  • git diff --check — passed.
  • A disposable POSIX Git-patch reproduction confirmed 100644 → 100755 produces 0700 under umask 077 and 0755 under umask 022 before the fix.
  • A live interactive Pi/Web smoke was not run. The POSIX regression and PiWebRuntime integration tests exercise the affected worktree-fork path; no user Pi installation or configuration was changed.

Impact

  • User-visible behavior: tracked executable files retain all execute bits in POSIX session snapshots created under strict umasks.
  • Model-visible context/tools: None.
  • Runtime/lifecycle: POSIX snapshot file permissions only. The process umask and Windows behavior are unchanged.
  • Persisted config/data: None.
  • Compatibility/risk: Only tracked paths represented by Git mode 100755 receive execute-bit restoration.

@627150795
627150795 force-pushed the fix/session-worktree-umask-908 branch from 8ee01a4 to 831318d Compare October 29, 2026 01:57

This branch has not been deployed

No deployments
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.

Session worktree snapshot loses executable bits under umask 077

1 participant