fix(core): reset pendingFeedbackMessage in ConversationHistory.reset()#2055
Merged
fix(core): reset pendingFeedbackMessage in ConversationHistory.reset()#2055
Conversation
The reset() method was not clearing pendingFeedbackMessage, causing stale "The previous action has been executed" context to leak into the first planning turn of subsequent MCP tool calls. This made the planning model incorrectly conclude the task was already completed without performing any action.
Deploying midscene with
|
| Latest commit: |
7f03d25
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a4b5fdae.midscene.pages.dev |
| Branch Preview URL: | https://fix-reset-pending-feedback-m.midscene.pages.dev |
ottomao
approved these changes
Mar 3, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ConversationHistory.reset()did not clearpendingFeedbackMessage, causing stale context from previous MCP tool calls to leak into new planning sessions.<complete>without performing any action.Tap/locatecalls failing on the first attempt but succeeding on retry.Root Cause
Each
execute()(triggered by MCP tool calls likeTap { locate: { prompt: "..." } }) callsthis.conversationHistory.reset()to start a fresh planning session. However,reset()only clearedmessages,memories,subGoals, andhistoricalLogs— it did not clearpendingFeedbackMessage.After a previous
execute()completes,pendingFeedbackMessageis left with a value like"Current time: ...". On the nextexecute(), this stale value triggers the planning prompt to include"... The previous action has been executed, here is the latest screenshot.", which misleads the model into thinking the current instruction was already fulfilled.Test plan
conversation-history.test.tsto verifyreset()clearspendingFeedbackMessage