Skip to content

fix(setup): optimize project discovery and file triage to prevent hangs#152

Open
fernandomenuk wants to merge 2 commits intogemini-cli-extensions:mainfrom
fernandomenuk:fix/setup-hang-large-projects
Open

fix(setup): optimize project discovery and file triage to prevent hangs#152
fernandomenuk wants to merge 2 commits intogemini-cli-extensions:mainfrom
fernandomenuk:fix/setup-hang-large-projects

Conversation

@fernandomenuk
Copy link

Pull Request: Optimize Project Discovery and File Triage to Prevent Hangs

1. Overview

This PR addresses issue #150, where the /conductor:setup command could hang in large repositories (especially those without a .gitignore) due to aggressive, recursive file system scans during the project discovery phase.

2. Problem Statement

The previous implementation of the project discovery protocol did not have strict depth limits for file system scans. In large, monolithic, or deeply nested repositories, this could cause the agent to attempt to list or analyze thousands of files, leading to timeouts and a perceived "hang" in the command.

3. Proposed Solution & Detailed Changes

File Path Change Category Description of Change
commands/conductor/setup.toml Performance / Logic Depth-Limited Discovery: Implemented a maxdepth 2 limit for the initial project maturity detection (Brownfield/Greenfield indicators).
commands/conductor/setup.toml Performance / Portability Efficient File Triage: Updated the file triage protocol to use more efficient find commands with pruning and added PowerShell-optimized Get-ChildItem -Depth for Windows users.
commands/conductor/setup.toml Robustness Instructional Guardrails: Added explicit warnings to the agent's protocol to avoid unbounded recursive listings in large projects.

4. Technical Rationale

  • Performance: Limiting the depth of initial scans dramatically reduces the I/O load and processing time for large repositories without sacrificing the accuracy of the maturity detection.
  • Cross-Platform Support: By providing specific PowerShell commands for Windows environments, we ensure that performance optimizations are effective across all supported operating systems.
  • Stability: These changes provide the agent with clearer guardrails, reducing the risk of non-deterministic behavior in complex project structures.

5. Verification Performed

  • Logic Audit: Reviewed the updated .toml prompt to ensure the new constraints are clear and correctly implemented.
  • Command Verification: Confirmed that the proposed shell commands follow best practices for performance and cross-platform compatibility.

6. Checklist

- Update implement.toml to support both bulleted and heading track formats
- Fix duplicate 'Aliases' section in C++ style guide
- Add conductor/index.md to generated artifacts list in README
- Implement depth-limited maturity detection (maxdepth 2)
- Use efficient pruned find commands for file triage
- Add PowerShell-optimized Get-ChildItem with depth limits for Windows
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.

2 participants