Skip to content

Load nested workspace instructions lazily#91

Draft
Ahmed-Hindy wants to merge 1 commit into
Waishnav:mainfrom
Ahmed-Hindy:agent/lazy-workspace-context
Draft

Load nested workspace instructions lazily#91
Ahmed-Hindy wants to merge 1 commit into
Waishnav:mainfrom
Ahmed-Hindy:agent/lazy-workspace-context

Conversation

@Ahmed-Hindy

Copy link
Copy Markdown
Contributor

Summary

  • Load nested AGENTS.md and CLAUDE.md files only when a later path-aware tool enters their directory.
  • Cache delivered instruction files and keep realpath containment checks for nested context files.
  • Eliminate the recursive workspace walk from open_workspace, which could block MCP requests long enough to time out.

Root cause

open_workspace recursively walked every descendant of the selected workspace to build availableAgentsFiles. Opening a parent folder that contains many repositories made this synchronous scan dominate the request and caused remote MCP clients to lose the connection.

Closes #90

Validation

  • npm test
  • npm run typecheck
  • npm run build
  • Focused src/workspaces.test.ts
  • Built runtime benchmark opening a large parent folder: 9 ms, with no eagerly discovered nested instructions

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3841e591-e110-4ca4-9d38-0816cb57f903

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Ahmed-Hindy

Copy link
Copy Markdown
Contributor Author

fixes #90

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.

open_workspace recursively scans the full workspace and can exceed MCP client timeouts

1 participant