Skip to content

Record no bridge step for a call that changed nothing, and replace the default cordon - #1378

Merged
saworbit merged 1 commit into
mainfrom
batch/mcp-fixes
Oct 21, 2026
Merged

saworbit merged 1 commit into
mainfrom
batch/mcp-fixes

Conversation

@saworbit

Copy link
Copy Markdown
Owner

Two agent bridge fixes in the dispatcher and its tools.

#1365: a call that changed nothing still recorded a step. _run_mutation and hf_batch always committed, so Move to Floor on a brush already on the floor left MCP: move to floor, moved the revision, and hf_undo then undid nothing.

  • New HFUndoHelper.commit_completed_if_changed() compares the level after the call with the capture from before, the same compare the dock's commit_if_changed() makes ([Undo] Record no step for a command that changes nothing #1303). Equal means no step and no history entry. commit_completed() shares _register_completed() with it and is unchanged.
  • The dispatcher's _commit() returns whether it recorded a step, and also compares the cordons for the cordon-only tools. On no change the answer carries no_change: true and changed: [], the revision stays, and the agent's undo chain still ends at its last real step, which hf_undo takes back next.
  • This holds for every mutation, not three commands, so the agent has one rule. Floor paint, entities and cordons are all in the compared state.
  • The command sweep now accepts a success as one step that undoes and redoes, or no_change with no step and the same level. The spec's known limitation 11, the Agent Bridge page, the MCP README and the catalogue descriptions say so.

#1367: a first cordon on a new level left the default one on. Without an index, hf_set_cordon with a place now reuses index 0 when the level holds only the untouched default: one cordon, at LevelRoot.DEFAULT_CORDON_AABB, unnamed, its own switch on. The answer says replaced_default. A moved, named or switched-off cordon is kept and a new one added. The dock's Set from Selection already writes index 0.

Tests: no-op command, no-op batch and no-op cordon set record no step; two commit_completed_if_changed unit tests; fresh-level cordon replaces the default and undo brings it back; an edited default is kept. Bake and batch tests rewritten to the new contract. Vibe: a no-op reset_rotation in commands, the fresh level in cordons. Local: test_mcp (20 scripts, 358), test_undo (57), test_cordon (22), test_scoped_undo_step (72), pytest 110, ruff, CI lint, script warnings, all green.

Fixes #1365
Fixes #1367

@saworbit
saworbit enabled auto-merge (squash) October 21, 2026 00:15
@github-actions github-actions Bot added area: architecture Subsystem structure, decomposition, code quality area: docs README, guides, spec, roadmap, changelog area: ci Workflows, contributor tooling, dependency pins tests The GUT suite and its fixtures labels Oct 21, 2026
@saworbit
saworbit merged commit e49e5f7 into main Oct 21, 2026
11 checks passed
@saworbit
saworbit deleted the batch/mcp-fixes branch October 21, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: architecture Subsystem structure, decomposition, code quality area: ci Workflows, contributor tooling, dependency pins area: docs README, guides, spec, roadmap, changelog tests The GUT suite and its fixtures

Projects

None yet

1 participant