• Will Chen's avatar
    Inject web crawl user messages correctly (#2129) · eea719f0
    Will Chen 提交于
    <!-- CURSOR_SUMMARY -->
    > [!NOTE]
    > **Fix stable user-message injection across steps**
    > 
    > - Extracts `prepareStepMessages` logic into `prepare_step_utils` with
    `transformContentPart`, `processPendingMessages`, and
    `injectMessagesAtPositions` to track injected messages with
    `insertAtIndex` and FIFO `sequence`, then re-inject them each step at
    the same positions
    > - Updates `local_agent_handler` to use `prepareStepMessages`,
    maintaining `pendingUserMessages` and accumulated `allInjectedMessages`
    > 
    > **Web crawl behavior update**
    > 
    > - `web_crawl` now requires a screenshot and injects only screenshot +
    markdown (HTML removed); clone instructions emphasize screenshot as
    primary visual reference
    > 
    > **Tests**
    > 
    > - Adds comprehensive unit tests for the new utilities and an
    integration-style multi-step simulation validating stable ordering and
    reinjection
    > 
    > <sup>Written by [Cursor
    Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
    3b02b73cf25b497a2d09ab6239ec9e3598ae823e. This will update automatically
    on new commits. Configure
    [here](https://cursor.com/dashboard?tab=bugbot).</sup>
    <!-- /CURSOR_SUMMARY -->
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Fixes incorrect injection of web-crawl user messages across agent steps.
    Messages are now re-injected at stable positions each step so screenshot
    and markdown context persist across tool rounds.
    
    - **Bug Fixes**
    - Track injected user messages with an insertion index and re-inject
    them every step (sorted in reverse) to keep order and prevent loss.
    - Web crawl now requires a screenshot and injects only screenshot +
    markdown (HTML removed). Updated clone instructions to emphasize the
    screenshot.
    
    <sup>Written for commit 3b02b73cf25b497a2d09ab6239ec9e3598ae823e.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    eea719f0
名称
最后提交
最后更新
..
__snapshots__ 正在载入提交数据...
README.md 正在载入提交数据...
ai_messages_cleanup.test.ts 正在载入提交数据...
ai_messages_utils.test.ts 正在载入提交数据...
app_env_vars_utils.test.ts 正在载入提交数据...
chat_stream_handlers.test.ts 正在载入提交数据...
cleanFullResponse.test.ts 正在载入提交数据...
formatMessagesForSummary.test.ts 正在载入提交数据...
local_agent_handler.test.ts 正在载入提交数据...
mcp_tool_utils.test.ts 正在载入提交数据...
mention_apps.test.ts 正在载入提交数据...
parseOllamaHost.test.ts 正在载入提交数据...
path_utils.test.ts 正在载入提交数据...
prepare_step_utils.test.ts 正在载入提交数据...
problem_prompt.test.ts 正在载入提交数据...
readSettings.test.ts 正在载入提交数据...
replacePromptReference.test.ts 正在载入提交数据...
style-utils.test.ts 正在载入提交数据...
supabase_utils.test.ts 正在载入提交数据...
versioned_codebase_context.test.ts 正在载入提交数据...