You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: cancel can't reach an agent's staged writes or schema reads #894
Cancel (the panel's Stop, CancelScope::All, and the new CancelScope::Agent from #868) only reaches statements the executor tracks as in flight. Two kinds of agent work aren't tracked:
Staged writes.CoreStagedWrite::begin (src-tauri/crates/mas-core/src/query/staged.rs, around line 113) runs .execute(&mut connection) directly. A long DELETE staged for approval keeps running until it hits its timeout, even after Stop.
Schema reads. The schema inspector never goes through the executor, so a slow information_schema read for an agent can't be cancelled.
run, run_ddl and explain are covered.
Reproduce
Against the test server, have an agent stage a write that takes a long time, for example DELETE … WHERE SLEEP(1) = 0 over enough rows, then press Stop. SHOW PROCESSLIST still shows the statement.
Fix
Register the staged write's thread id with the executor's in-flight table under the agent's route, just as execute_routed does, and remove it when the stage finishes. Do the same for inspector queries issued on an agent route. Extend connection_lanes.rs's an_agent_cancel_stops_only_that_agents_statements with a staged write. Update the limit noted in docs/design/AI_INTEGRATION.md §6.
Activity
fix: let cancel reach staged writes, schema reads