Repository navigation
fix: cancel reaches staged writes; shared test DBs - #900
Merged
Merged
Conversation
A staged write runs on its own connection and the schema inspector reads through sqlx directly, so neither was in the executor's in-flight table and the agent panel's Stop could not reach them. Both now register their connection's thread under the agent's route while the statement runs, through an InFlightTracker handle on the executor's table. Closes #894. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
The compose file's fixed container names made db-up fail from a second git worktree, whose default compose project differs. Pin the project name so every checkout owns the same containers, and start them with --no-recreate so a worktree's different seed mount paths do not replace them. Closes #895. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
This was referenced Oct 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two follow-ups, one commit each. Both were written by an
implementer-rustsubagent.#894: cancel reaches an agent's staged writes and schema reads
Before this change, cancel only reached statements the executor tracked as in flight. Staged writes and schema-inspector reads ran on their own connections, so the panel's Stop missed them.
query::in_flight::InFlightTracker, taken fromQueryExecutor::tracker().track(conn, connection_id, route)registers the connection's server thread and returns a ticket.StagedWrite::begin_in(…, Option<CancelReach>)holds the ticket only while the user's statement runs, not while the transaction waits for approval.beginstill exists.SchemaInspector::tracked_by(tracker): all 16 reads share a privateReadConnection. A tracked inspector registers each read under its route; the UI's untracked inspector skips the extra round trip.Route::Agent(session), andstage_writeusesbegin_in. Both the panel's Stop (CancelScope::Agent) andCancelScope::Allnow reach these statements.docs/design/AI_INTEGRATION.md§6: the stated limit is replaced with what is now covered. A staged write that has already run and is waiting for approval is deliberately left alone.#895: test containers from any worktree
docker-compose.test.ymlgets a top-levelname: sqlpilot. That matches the project label on existing containers, so they are adopted with no reset.just db-upusesup -d --no-recreate. Without it, each worktree's own seed bind-mount paths would make compose recreate the containers.CONTRIBUTING.mdand theintegration-testsskill now say the containers are shared across checkouts.Closes #894. Closes #895.
Test plan
connection_lanestests:an_agent_cancel_reaches_its_staged_write: two agents each run a stagedDELETE … WHERE SLEEP(20)=0. Cancelling agent a stops it within 5 s with nothing changed; agent b keeps running untilCancelScope::All. The test fails whenbegin_in's registration is disabled.an_agent_cancel_reaches_reads_outside_the_executor: covers the tracker path that the inspector uses.mas-coreintegration suite with--ignoredpasses on MySQL 8 and on MariaDB 11.connection_lanesis 13/13 on both.cargo fmtandcargo clippy --workspace --all-targets --all-features -- -D warningsare clean.cargo test -p mas-core(246 lib tests) andcargo test -p sqlpilot --lib(82) pass.upworks from both checkouts, whether the containers are running or stopped, with unchanged container IDs, and both containers reach healthy.db-downfollowed bydb-upseeds correctly.Generated by Claude Code