Skip to content

fix(mcp-bridge): re-find list between structural mutations#460

Merged
xiaolai merged 1 commit intomainfrom
fix/458-list-batch-stale-positions
Mar 18, 2026
Merged

fix(mcp-bridge): re-find list between structural mutations#460
xiaolai merged 1 commit intomainfrom
fix/458-list-batch-stale-positions

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Mar 18, 2026

Summary

  • handleListBatchModify captured the list node/position once before the operation loop, causing stale references after add_item or delete_item changed the document structure
  • Now re-finds the list from editor.state.doc before each operation, matching the pattern already used by handleTableBatchModify

Closes #458

Test plan

  • pnpm check:all passes (lint, tests, build)
  • Manual: use MCP bridge to batch-modify a list with multiple structural ops (e.g., delete item 1 then update item 3) — verify correct items are targeted

🤖 Generated with Claude Code

…istBatchModify

The list node and position were captured once before the operation loop,
becoming stale after add_item or delete_item changed the document structure.
Now re-finds the list from editor.state.doc before each operation, matching
the pattern already used by handleTableBatchModify.

Closes #458

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude claude bot enabled auto-merge (squash) March 18, 2026 09:39
@xiaolai xiaolai merged commit 6872070 into main Mar 18, 2026
3 checks passed
@xiaolai xiaolai deleted the fix/458-list-batch-stale-positions branch March 20, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[audit] mcp-bridge: handleListBatchModify uses stale positions after structural mutations

1 participant