fix(core): Summarize SQLite upserts so Durable Object cf_ spans stay filtered - #22649
Merged
Conversation
…y filtered `getSqlQuerySummary` only matched plain `INSERT INTO`, so SQLite upsert forms (`INSERT OR REPLACE INTO`, `INSERT OR IGNORE INTO`, `REPLACE INTO`) fell through to the first-word fallback and summarized as bare `INSERT` with no table target. The Cloudflare Durable Object filter (`targetsCloudflareInternalTable`) checks the summary for `cf_`-prefixed tables, so agents-framework queries like `INSERT OR REPLACE INTO cf_agents_mcp_servers ...` leaked through as zero-signal `db.query` spans named just `INSERT`. Extend the summarizer to the full SQLite conflict-clause grammar (`INSERT|UPDATE OR ROLLBACK|ABORT|FAIL|IGNORE|REPLACE`, plus the `REPLACE INTO` shorthand). The clause is stripped like INTO/FROM so upserts share the plain-operation summary (`INSERT cf_agents_state`), keeping span names low-cardinality. Co-Authored-By: Claude <noreply@anthropic.com>
JPeer264
requested review from
andreiborza and
isaacs
and removed request for
a team
July 27, 2026 07:10
Contributor
size-limit report 📦
|
andreiborza
approved these changes
Jul 27, 2026
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.
getSqlQuerySummaryonly matched plainINSERT INTO, so SQLite upsert forms (INSERT OR REPLACE INTO,INSERT OR IGNORE INTO,REPLACE INTO) fell through to the first-word fallback and summarized as bareINSERTwith no table target. The Cloudflare Durable Object filter (targetsCloudflareInternalTable) checks the summary forcf_-prefixed tables, so agents-framework queries likeINSERT OR REPLACE INTO cf_agents_mcp_servers ...leaked through as zero-signaldb.queryspans named justINSERT.Extend the summarizer to the full SQLite conflict-clause grammar (
INSERT|UPDATE OR ROLLBACK|ABORT|FAIL|IGNORE|REPLACE, plus theREPLACE INTOshorthand). The clause is stripped like INTO/FROM so upserts share the plain-operation summary (INSERT cf_agents_state), keeping span names low-cardinality.