Skip to content

(MOT-4230) feat(database): suggest close-match table names on 'no such table' - #592

Open
andersonleal wants to merge 1 commit into
mainfrom
feat/database-missing-table-hints
Open

(MOT-4230) feat(database): suggest close-match table names on 'no such table'#592
andersonleal wants to merge 1 commit into
mainfrom
feat/database-missing-table-hints

Conversation

@andersonleal

Copy link
Copy Markdown
Collaborator

Why

rctest7 postmortem (the infinite-loop run): the reactor agent silently dropped the run prefix from its table names mid-task (rctest_rctest7_k3m8_totalsrctest7_k3m8_totals). The bare no such table error gave it nothing to snap back to, so it "recovered" with CREATE TABLE IF NOT EXISTS and the run's aggregates landed in parallel tables — the downstream gate checker then polled an empty totals table forever (see the companion harness PR for the loop-side guard).

What

Prepare-time no such table: X errors now append up to three close-match existing names plus an explicit nudge:

no such table: run1_totals — did you mean rctest_run1_totals? Use the exact existing name; do not create a replacement table.
  • Matching: containment (the dropped/added-prefix shape) or edit distance ≤ max(2, len/3); nearest first, deterministic ties; never noise when nothing is close.
  • Applied at all five sqlite prepare sites (query, execute, tx steps, tx query, prepareStatement); tx steps keep their failed_index.
  • Fail-open: any suggestion-lookup problem returns the bare error.

Tests

  • missing_table_suggestions_rank_prefix_and_typo_neighbors — the exact rctest7 shape + typo + no-noise cases
  • no_such_table_error_names_the_close_match — end-to-end through query() on a live pool
  • full database suite green (232 tests)

Fixes MOT-4230

rctest7 postmortem: a reactor agent silently dropped the run prefix from
its table names mid-task; the bare 'no such table' error gave it nothing
to snap back to, so it invented replacement tables (CREATE TABLE IF NOT
EXISTS) and the run's aggregates landed off to the side — the downstream
gate checker then polled an empty totals table forever.

Prepare-time failures now enrich 'no such table: X' with up to three
close-match existing names (containment or small edit distance), plus an
explicit 'use the exact existing name; do not create a replacement table'
nudge. Fail-open: any suggestion-lookup problem returns the bare error.
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jul 24, 2026 3:10pm
workers-tech-spec Ready Ready Preview, Comment Jul 24, 2026 3:10pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 48 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@andersonleal, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 16 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9df353e6-2084-46c2-9a2d-78051580d2c4

📥 Commits

Reviewing files that changed from the base of the PR and between 6452708 and e45ae6f.

📒 Files selected for processing (1)
  • database/src/driver/sqlite.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/database-missing-table-hints

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant