The test 'blocks write tools in plan mode' was failing because the model
would attempt to exit plan mode via exit_plan_mode tool. By cancelling
switch_mode tool calls in the permission handler, we ensure plan mode
stays active throughout the test.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add plan mode enforcement in Session.runTool to block write tools
- Align ACP behavior with CoreToolScheduler plan mode logic
- Add test case to verify write tools are blocked in plan mode
- Fixes#1806