Revert removal of the last message from memory_messages during planning by Zoe14 · Pull Request #1454 · huggingface/smolagents (original) (raw)

Conversation

@Zoe14

@Zoe14 Zoe14 commented

Jun 18, 2025

edited by albertvillanova

Loading

A previous change I did to save token usage is wrong as cyzus pointed out. I reverted the change, and updated the test to reflect the scenario I didn't think of.
The last message in the memory_messages is not necessarily the task.
Maybe we can filter the memory_message if we don't want to send the same task twice or we can change the pre_update_plan prompt to not include the task.

Fix bug introduced in:

@Zoe14

@Zoe14 Zoe14 changed the titleenhance test for update plan Enhance test for update plan

Jun 18, 2025

@Zoe14 Zoe14 marked this pull request as ready for review

June 18, 2025 15:31

@aymeric-roucher

In this case, let's go for the simple fix you propose and just undo the removal the latest message, no need for other modifications IMO!

@Zoe14

@Zoe14

@Zoe14

I updated the branch. This PR basically just undo the change and improved the unit test. Feel free to close this PR if the fix is included somewhere else.

albertvillanova

Choose a reason for hiding this comment

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

Needs to run make style to fix code quality issues.

@albertvillanova albertvillanova changed the titleEnhance test for update plan Revert removal of the last message from memory_messages during planning

Jun 24, 2025

albertvillanova

Choose a reason for hiding this comment

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

Thanks. Just fixed the style and refactored the corresponding test to make it clearer.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})