Skip to content

Improve diagnostics for risky environment directory glob patterns #427

@karthiknadig

Description

@karthiknadig

Problem

When a client configures PET with broad or recursive environmentDirectories glob patterns, configure can spend time expanding filesystem globs before returning. If this crosses the client timeout, the client may kill PET and users only see a generic message such as PET exiting with SIGTERM.

This is hard to diagnose because the actionable setting is not obvious from the failure.

Related context:

Suggested improvements

  • Warn immediately when configure receives recursive environment-directory patterns such as **/.venv.
  • Include the exact pattern and elapsed time in slow glob warnings, not just aggregate configure glob time.
  • Update docs/JSONRPC.md to discourage recursive workspace-wide environmentDirectories and recommend bounded patterns such as .venv and */.venv.
  • Consider a glob expansion time budget so PET can return an actionable error before the client kills the process.

Notes

The Python Environments extension default now uses bounded patterns (.venv and */.venv), so this is mainly a PET guardrail for explicit, stale, or third-party client inputs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions