Skip to content

[Bug]: Pi health checks start in $HOME and trigger repeated macOS data-access prompts via pi-fff #37648

Closed

Description

@darkmanno6

Before submitting

  • I searched existing issues and did not find a duplicate of this Pi-specific trigger.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server (Pi provider discovery), with an apps/desktop trigger.

Steps to reproduce

  1. On macOS, use the packaged T3 Code desktop app and an existing Pi installation with @ff-labs/pi-fff enabled in Pi's global packages. Leave the extension's home-directory scanning setting at its default (true).
  2. Enable the Pi provider in T3 Code. Work in a normal repository; there is no need to launch Pi manually from $HOME or create a project rooted at $HOME.
  3. Allow the provider health/discovery refresh to run. The default health refresh interval in the installed build is five minutes; an explicit provider refresh can also run discovery.
  4. Observe repeated macOS prompts saying that T3 Code wants to access data from other apps. Allowing one prompt does not prevent a later probe process from triggering another.

Expected behavior

Background provider discovery should obtain Pi's model/command inventory without initiating a broad index of the user's home directory or prompting for unrelated applications' data. A repository-scoped thread should not require the user to anticipate a separate Pi process launched from $HOME by T3.

Actual behavior

T3's background Pi probe starts in $HOME, loads Pi extensions, and triggers pi-fff's eager session-start index. The index walks into protected Photos, Mail, Safari, Contacts, Calendar, Reminders, Notes, Shortcuts, and other Apple application/system directories. macOS attributes the child Node process's requests to T3 Code and displays the data-access dialog.

Across seven Node PIDs attributed to T3 in the inspected log window, kernel logs contained 97 distinct denied paths. This is a count of paths, not granted application permissions. These records establish access attempts, not successful reads or transmission of file contents.

Impact

Major degradation or frequent failure: recurring system permission dialogs interrupt work even when no Pi search or model prompt was requested.

Version or commit

Observed in the installed packaged desktop T3 Code (Beta) 0.1.9. Relevant code paths were also inspected on upstream main at d427894aa1d170ce0222fe005723f5e91419916b; runtime reproduction on that commit has not been performed.

Environment

  • macOS 26.5.2, Apple Silicon (arm64)
  • Pi 1.5.2 (managed installation)
  • @ff-labs/pi-fff 0.11.0
  • The triggering Node executable was v24.22.2
  • Pi enabled in T3 provider settings

Investigation

The installed build and live backend cwd establish this chain:

  1. The packaged desktop sets backendCwd: input.isPackaged ? homeDirectory : appRoot. The live backend's cwd was confirmed as $HOME with lsof -a -p <backend-pid> -d cwd.
  2. ProviderHost.paths.cwd comes from the server configuration. PiDriver.create passes this host cwd to checkPiProviderStatus, rather than a thread's repository cwd.
  3. Discovery starts a short-lived RPC Pi process (--mode rpc --no-session --offline) with that cwd. The ordinary inventory discovery path still loads user extensions; --offline and --no-session do not suppress extension initialization.
  4. pi-fff runs ensureFinder(activeCwd) in its session_start handler, before a search is requested. Its default enableHomeDirScanning is true, so this indexes $HOME.

Corresponding upstream code references:

Logs or stack traces

Selected observations, with local paths redacted:

# T3 server trace, installed 0.1.9
21:29:43 PiProviderStatus.discoverPiViaRpc started
           duration: 16430 ms; completed successfully

# macOS tccd, same interval
21:29:46 AUTHREQ_ATTRIBUTION: responsible identifier=com.t3tools.t3code,
         accessing identifier=node, pid=83079
21:29:46 AUTHREQ_PROMPTING: service=kTCCServiceSystemPolicyAppData,
         subject=com.t3tools.t3code, pid=83079
21:29:59 kTCCServiceSystemPolicyAppData granted by TCC for node

# macOS kernel, same accessing PID
System Policy: node(83079) deny(1) file-read-data ~/Library/Cookies
System Policy: node(83079) deny(1) file-read-data ~/Library/Reminders
System Policy: node(83079) deny(1) file-read-data ~/Library/Group Containers/group.com.apple.shortcuts
System Policy: node(83079) deny(1) file-read-data ~/Pictures/Photos Library.photoslibrary
System Policy: node(83079) deny(1) file-read-data ~/Library/Photos

Workaround and verification boundary

  • Set FFF_ENABLE_HOME_SCAN=0 in the T3 Pi instance's environment. This keeps normal repository indexing available while refusing an index rooted at $HOME.
  • Alternatively, disabling the Pi integration should prevent subsequent Pi health probes, according to the disabled-provider branch. This has not been tested by changing the active T3 configuration.

An isolated test with the installed Pi and pi-fff, a temporary agent configuration, explicit extension loading, and cwd=$HOME verified the first mitigation at Pi startup: with FFF_ENABLE_HOME_SCAN=0, the extension emitted its home-scan-disabled notice and the RPC get_state request succeeded. No search or model prompt was sent. The live user configuration was not changed, and the unmitigated broad scan was not deliberately rerun.

The desired fix is to avoid eager home-directory indexing during background Pi inventory discovery while preserving extension-provided models and commands where needed.

Related reports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions