Repository navigation
Conversation
The editor linter sent `EXPLAIN <sql>` to Postgres via the simple-query protocol on every keystroke. Postgres executes every statement in a simple query, so `SELECT 1; DELETE FROM users;` ran the DELETE with no Run click or confirmation. Lint now skips multi-statement input for all engines (sqlx SQLite has the same multi-statement behaviour) and Postgres validates via prepare(), which parses and plans without executing and rejects multiple commands. This also fixes Postgres error positions, which were offset by the "EXPLAIN " prefix. Ask Veloxy auto-ran generated SQL whenever the model reported `intent: "select"`, regardless of the SQL itself. The backend now derives intent from the SQL, and the frontend gates auto-run on isReadOnlySql() so writes always require confirmation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.



Summary
Fixes two paths that could run data-modifying SQL with no confirmation from the user.
1. Editor lint ran SQL on every keystroke (High)
lint_sqlsentEXPLAIN <sql>to Postgres throughsimple_query. The simple-query protocol runs every statement in the string, so editor content likeSELECT 1; DELETE FROM users;ran theDELETE280 ms after typing, with no Run click and none ofrun_query's write confirmation. sqlx's SQLite driver also runs multi-statement strings.split_sql_statements. This applies to all engines.client.prepare(&sql)instead ofEXPLAIN. Prepare parses and plans without executing, and Postgres rejects multiple commands in a prepared statement, so this holds even if the splitter miscounts.EXPLAINprefix), and statements like DDL can now be linted.2. Ask Veloxy auto-ran SQL based on the model's self-reported intent (High)
The backend passed the model's
intentfield through unchanged, and the frontend auto-ran wheneverintent === "select". A reply such as{"sql": "DELETE FROM orders WHERE id = 7", "intent": "select"}ran immediately.veloxy.rsnow always derives intent withclassify_sql_intent(&sql).useAppState.tsgates auto-run onisReadOnlySql(sql, engine), which also catches data-modifyingWITHCTEs.Reviewer notes
cargo check,cargo test --lib(115 passed),tsc,vitest(115 passed) and eslint are clean.isReadOnlySqltreats everySELECTas read-only, soSELECT ... INTOand volatile function calls could still auto-run from Ask Veloxy.🤖 Generated with Claude Code