Skip to content

Avoid recursive config watches under proot#3803

Draft
jamesx0416 wants to merge 1 commit into
pingdotgg:mainfrom
jamesx0416:agent/proot-config-watch
Draft

Avoid recursive config watches under proot#3803
jamesx0416 wants to merge 1 commit into
pingdotgg:mainfrom
jamesx0416:agent/proot-config-watch

Conversation

@jamesx0416

@jamesx0416 jamesx0416 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • Use a proot-specific config-directory watcher for keybindings and server settings.
  • Keep the existing Effect FileSystem.watch behavior outside proot.
  • Under proot, use non-recursive node:fs.watch and emit update events for changed config filenames.

Why

Effect recursive directory watching expands into hundreds of fs_event handles under proot for the T3 userdata config directory. On Android/proot this adds avoidable event-loop and native watcher pressure for two config files that only need shallow directory watching.

This keeps live reload behavior for keybindings.json and settings.json while avoiding recursive watcher fanout when PROOT_L2S_DIR is present.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (not applicable; no UI changes)
  • I included a video for animation/interaction changes (not applicable; no UI changes)

Validation: pnpm --filter t3 typecheck

Note

Avoid recursive config watches in proot environments

  • Adds a watchConfigDirectory helper in keybindings.ts and serverSettings.ts that selects a watch implementation based on the PROOT_L2S_DIR environment variable.
  • When PROOT_L2S_DIR is set, uses Node's fs.watch directly (wrapped in Stream.callback) instead of the Effect FileSystem.watch, avoiding recursive watch issues under proot.
  • When PROOT_L2S_DIR is not set, delegates to the existing fs.watch Effect implementation with no behavior change.

Macroscope summarized fc93ae1.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant