Skip to content

User feedback lost during tool validation in some toolsΒ #5058

@KJ7LNW

Description

@KJ7LNW

When users provide additional information during tool validation (accept/reject phase) for some tools, this information is completely lost and never enters the discussion history. This creates a frustrating experience where users must repeat information, breaking the natural flow of conversation.

Impact

This inconsistent behavior:

  • Disrupts conversation flow when users provide important context
  • Forces users to repeat information they have already provided
  • Creates a disjointed user experience where feedback seems to be ignored
  • Reduces trust in the system ability to maintain conversation context

Affected Components

An AI evaluated that the issue may affect:

  • src/core/tools/accessMcpResourceTool.ts
  • src/core/tools/codebaseSearchTool.ts
  • src/core/tools/fetchInstructionsTool.ts
  • src/core/tools/listCodeDefinitionNamesTool.ts
  • src/core/tools/listFilesTool.ts
  • src/core/tools/searchFilesTool.ts
  • src/core/tools/useMcpToolTool.ts

Technical Details

Each tool implementation follows a four-phase lifecycle:

  1. Streaming phase (block.partial==true)
  2. Model API completion phase (block.partial==false)
  3. User validation phase (accept/reject)
  4. Tool application phase

The issue occurs in phase 3 (user validation) where user feedback is collected but not properly integrated into the conversation history. Some tools handle this correctly while others do not, creating inconsistent behavior.

Suggested Refactor Approach

Tools should be refactored to standardize the four-phase implementation lifecycle:

genericToolDispatch(
  streaming() => {  ... streaming impl },
  api_complete() => {  ... completion impl },
  user_validation() => { accept/reject from user and integrate feedback},
  apply() => { search_and_replace() the file ...}
)

This approach would ensure consistent handling of user feedback across all tools.

Reproduction Steps

  1. Attempt to use the search_and_replace tool that requires user validation
  2. When prompted for approval, add additional context or information along with your accept/reject response
  3. Observe that your additional information is not reflected in the subsequent conversation history

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue - Needs ScopingValid, but needs effort estimate or design input before work can start.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions