Skip to content

fix(core): reset pendingFeedbackMessage in ConversationHistory.reset()#2055

Merged
ottomao merged 1 commit intomainfrom
fix/reset-pending-feedback-message
Mar 3, 2026
Merged

fix(core): reset pendingFeedbackMessage in ConversationHistory.reset()#2055
ottomao merged 1 commit intomainfrom
fix/reset-pending-feedback-message

Conversation

@quanru
Copy link
Copy Markdown
Collaborator

@quanru quanru commented Mar 2, 2026

Summary

  • Fix a bug where ConversationHistory.reset() did not clear pendingFeedbackMessage, causing stale context from previous MCP tool calls to leak into new planning sessions.
  • This made the planning model incorrectly interpret the first turn as a continuation (seeing "The previous action has been executed"), leading it to return <complete> without performing any action.
  • The issue manifested as MCP Tap/locate calls failing on the first attempt but succeeding on retry.

Root Cause

Each execute() (triggered by MCP tool calls like Tap { locate: { prompt: "..." } }) calls this.conversationHistory.reset() to start a fresh planning session. However, reset() only cleared messages, memories, subGoals, and historicalLogs — it did not clear pendingFeedbackMessage.

After a previous execute() completes, pendingFeedbackMessage is left with a value like "Current time: ...". On the next execute(), 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

  • Updated existing conversation-history.test.ts to verify reset() clears pendingFeedbackMessage
  • All 626 unit tests pass

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.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying midscene with  Cloudflare Pages  Cloudflare Pages

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

View logs

@ottomao ottomao merged commit 86a37aa into main Mar 3, 2026
10 checks passed
@ottomao ottomao deleted the fix/reset-pending-feedback-message branch March 3, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants