Skip to content

Conversation

@FinnBorge
Copy link

@FinnBorge FinnBorge commented May 2, 2025

As proposed in #3928

This changes the existing confirm_ask prompt from:
Add file to the chat? (Y)es/(N)o/(D)on't ask again [Yes]:
To
Add file to the chat? (Y)es/(N)o/(R)ead-only/(D)on't ask again [Yes]:

It also lays the groundwork for the extension of the confirm_ask method to accept conditional/other responses in various contexts through the use of the string response type. This does produce a touch of code sprawl as there's a need to test for whether the return_string parameter is set in certain situations. Very open to feedback about how best to implement this.

The key points of the implementation are:

  1. Added show_readonly parameter to the confirm_ask method in aider/io.py to control when the "Read-only" option appears
  2. Added return_string parameter to control the return type
  3. Maintained default boolean return values for existing code (through use of the above)
  4. Updated check_for_file_mentions to use the new string return values

The implementation ensures that:

  • Existing code continues to work without changes
  • New file addition prompts can include a "Read-only" option
  • The code can handle both boolean and string return values

Also note that this PR includes an unrelated edit that was flagged by the commit hook. This import is not used and caused the commit hook to fail.
-451,8 @@ def test_tool_output_color_handling(self): from rich.text import Text

Please do not hesitate to provide critical feedback!

Warm regards,
Finn

@CLAassistant
Copy link

CLAassistant commented May 2, 2025

CLA assistant check
All committers have signed the CLA.

@ocontant
Copy link

ocontant commented May 2, 2025

I like the feature, it add clarity make the tool more intuitive.

Copy link

@zephschafer zephschafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@jmarkmorris
Copy link

I was late to the party, but I thought of this feature too.

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.

6 participants