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
Agent panel Cancel doesn't stop the agent's running SQL #868
The agent panel's Cancel (cancel_agent_turn in src-tauri/src/commands/agents.rs) calls AgentSessions::cancel, which asks the harness to stop the turn. It does not send KILL QUERY for a statement the agent already has running on the server.
Until PR #866, the editor's Cancel stopped every statement on the connection, the agent's included, so a runaway agent query could be stopped that way. Since #866 the editor's Cancel only stops the run the user is looking at: a tab's own session, or the shared pool for a session-less run. That is correct for the editor. It means nothing reachable from the UI now stops SQL running on the Agent lane. That SQL is still bounded by the executor's query timeout, and its pool closes when the agent session ends.
Fix
When an agent turn is cancelled, also cancel its in-flight statements. Call QueryExecutor::cancel for each connection the agent session has used, scoped to that agent's Route::Agent lane (add a CancelScope::Agent(id)). Add a live test in src-tauri/crates/mas-core/tests/connection_lanes.rs next to cancel_still_stops_what_the_agent_is_running.
Activity
fix: stop an agent's running SQL on cancel