mirror of
https://github.com/baserow/baserow.git
synced 2026-12-06 01:08:32 +00:00
* fix(mcp): let MCP clients undo and redo their changes MCP tool calls ran without a client session, so their actions were stored with no session and no undo could reach them. * fix(mcp): undo a whole tool call past the action group limit Sets the undo session for every tool in one place and restores it after the call. Reports lock conflicts instead of an internal error. * fix(mcp): stop undo and redo at a part of a call that failed Carrying on past a failed part left one tool call half undone. * chore(mcp): say why the undo session import stays local Qodo asked for a reason; a module-level import fails before Django is set up. * fix(mcp): keep other calls of an endpoint out while undo or redo runs Undo and redo take a call back in parts, and a call of the same endpoint that landed between two parts made them stop with the call half undone. * fix(mcp): release the endpoint lock on any database error An InterfaceError on unlock escaped and could leave the lock held, and the regression test now waits on the lock instead of a fixed timeout. * fix(mcp): give up on a taken endpoint lock and stop undo in a split call A blocked advisory lock wait froze the shared sync thread of the worker, so calls now try for a few seconds and ask the client to try again. A second undo after a failed part went on into the older parts of the same call. * docs(mcp): say how far the undo API reaches into MCP changes * fix(mcp): wait for the endpoint lock off the MCP thread and redo a partly undone call at once The retry sleep held the worker's shared MCP thread, so other calls waited too. Undo stayed refused after redo could no longer restore the call, and one redo only reset the failed part. * docs(mcp): describe the endpoint lock errors and partly undone calls * fix(mcp): take, use and release the endpoint lock in one step and redo only the failed batch A cancelled tool call could leave the endpoint lock taken until the worker restarted. Redo of a partly undone call could mark really undone parts as redone without redoing them. * fix(mcp): set the undo session on the thread that runs the tool call A cancelled call keeps running on the MCP thread after the async side stops waiting, so its later actions lost the session and group. * test(mcp): cancel the call after its first field instead of after a fixed wait A slow runner could cancel before the body started and fail the test. * fix(mcp): drop the endpoint changes lock A session advisory lock can leak under PgBouncer transaction pooling and then block the endpoint's later calls. Without it, a write during undo only splits the undo, and the next undos finish it.