Skip to content

[Bugfix] Await ask during read file#2069

Closed
PretzelVector wants to merge 1 commit intoRooCodeInc:mainfrom
PretzelVector:read_tool_fix
Closed

[Bugfix] Await ask during read file#2069
PretzelVector wants to merge 1 commit intoRooCodeInc:mainfrom
PretzelVector:read_tool_fix

Conversation

@PretzelVector
Copy link
Contributor

@PretzelVector PretzelVector commented Mar 28, 2025

Context

Fixes intermittent "Current ask promise was ignored" during file read with new read tool introduced in #2059


Important

Adds error handling for cline.ask in readFileTool to prevent ignored promise errors during file reads.

  • Behavior:
    • Adds error handling for cline.ask in readFileTool to prevent 'Current ask promise was ignored' errors.
    • If cline.ask fails, logs error using pushToolResult with a formatted tool error message.
  • Files:
    • Modifies readFileTool.ts to include a try-catch block around cline.ask.

This description was created by Ellipsis for 2e227e9. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Mar 28, 2025

⚠️ No Changeset found

Latest commit: 2e227e9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 28, 2025
@PretzelVector PretzelVector changed the title Await ask during read file [Bugfix] Await ask during read file Mar 28, 2025
@dosubot dosubot bot added the bug Something isn't working label Mar 28, 2025
@mrubens
Copy link
Collaborator

mrubens commented Mar 28, 2025

Hmm I'm not sure it was introduced here - I think the code is the same as it used to be. Can you send a screenshot of your error? I think it's actually related to the async checkpoints showing up in the middle of another call (and I was planning on trying to fix that today).

@PretzelVector
Copy link
Contributor Author

After this patch, read function works properly on local setup. Made this change based on the error message I saw. If actually this is a race condition, the real fix might need to be somewhere else - this patch might just help by making the read return a bit slower.

image

@mrubens
Copy link
Collaborator

mrubens commented Mar 28, 2025

Thanks for the screenshot! Will take a closer look soon

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

None yet

Development

Successfully merging this pull request may close these issues.

2 participants