Skip to content

Conversation

@forestyoo
Copy link
Contributor

@forestyoo forestyoo commented Jun 10, 2025

Related GitHub Issue

Closes: #4498

Description

GPT-4.1 cannot read files outside the current workspace directory. (Claude Sonnet can)

Solution: In the src/core/prompts/sections/rules.ts file, a rule was added: 'If you have the path (no matter if it's in the current workspace directory or not), you can use tools to access this path, such as read_file or list_files.'

Test Procedure

Current workspace is: /Users/forestyoo/Documents/Code/Roo-Code

  1. Switch to GPT4.1.
  2. Send Roo the message read file /Users/forestyoo/Desktop/file.md.
  3. The model's response is: Sorry, I can't access files outside your workspace directory. Please move file.md into your project folder if you want me to read it.

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Documentation Updates

Additional Notes

Get in Touch

Discord: forestyoo


Important

Adds a rule in rules.ts to allow tools to access paths outside the workspace if the path is known, resolving GPT-4.1's file access issue.

  • Behavior:
    • Adds rule in rules.ts allowing tools to access paths outside the workspace if the path is known.
  • Testing:
    • Tested by attempting to read a file outside the workspace, confirming the rule change allows access.

This description was created by Ellipsis for 2e47d00. You can customize this summary. It will automatically update as commits are pushed.

@forestyoo forestyoo requested review from cte, jr and mrubens as code owners June 10, 2025 14:58
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Jun 10, 2025
@forestyoo forestyoo closed this Jun 10, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jun 10, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

GPT-4.1 cannot read files outside the current workspace directory (Claude Sonnet can)

1 participant