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
Commit 15822b2
Browse filesBrowse the repository at this point in the historyBrowse files
fix(tables): teach the v2 enrichment which operators a select column accepts
Greptile and cubic both flagged this independently, and they were right.
A select column accepts only a subset of the filter operators — eq/ne/in/nin
when single, contains/ncontains when multi — and `buildFilterConditions`
THROWS on anything else rather than returning no rows. The new v2 enrichment
advertised the full operator list for every column and, worse, asserted
"there are no array columns - for substring matching use ilike with *x*".
A multi-select cell holds a list, so that sentence is false and it steers
the model straight into a rejected query on exactly the columns it describes.
The enricher could not tell single from multi because `readTableSchemaAsExecutor`
dropped `multiple` when projecting the summary. Carry it through — for select
columns only, where it means something — and annotate each select column in
the description with the operators it actually takes.
The block's bestPractices carried the same false claim, so the model reached
it a second way even when enrichment was absent. Corrected there too.
Also regenerate the tool metadata bundle, which is what CI was failing on:
the ncontains commit changed the v2 tool description without regenerating
the derived artifact.
- like/ilike use * as the wildcard (e.g. {"field":"name","op":"ilike","value":"*jo*"}).
243
243
- Omit Limit to get the entire matching result in one response — the query fails with a clear error if it exceeds 5MB (narrow with a filter or set a Limit).
244
244
- With a Limit, pages can end at the Limit or the 5MB byte budget, whichever comes first — pass nextCursor back as the cursor and loop until it is null; never infer completion from page size.
245
-
- Columns are scalar (string/number/boolean/date) or opaque json — there are no array columns; for substring use ilike with *x*.
245
+
- For substring matching on a text column use ilike with *x*. A select column accepts only a subset of the operators — eq/ne/in/nin when single, contains/ncontains when multi (a multi-select cell holds a list) — and the query is rejected outright on anything else.
246
246
- Use Columns to Return to keep only the fields a downstream step needs (e.g. ["col_email","name"]) — the 5MB budget counts only the returned columns, so narrowing columns is another way to fit a large table; leave it empty for every column.`,
5. like/ilike use * as the wildcard, e.g. {"field":"name","op":"ilike","value":"*jo*"}
104
-
6. There are no array columns - for substring matching use ilike with *x*
105
-
7. For ranking queries (highest, lowest, Nth, top N) set order and a small limit, e.g. limit 1 for the highest, 2 for the second highest
106
-
8. Omit limit to return every matching row; the query fails if the result exceeds 5MB, so narrow with a filter instead of guessing a limit
107
-
9. With a limit, a page can end early at the byte budget - a non-null nextCursor means more rows remain, so pass it back as cursor and loop until it is null. Never infer completion from page size
108
-
10. Omit the filter only when the user genuinely wants every row
121
+
6. Any column listed below with a restricted operator set accepts ONLY those operators - the query is rejected outright otherwise. A multi-select cell holds a list, so match it with contains, never ilike
122
+
7. For substring matching on a text column use ilike with *x*
123
+
8. For ranking queries (highest, lowest, Nth, top N) set order and a small limit, e.g. limit 1 for the highest, 2 for the second highest
124
+
9. Omit limit to return every matching row; the query fails if the result exceeds 5MB, so narrow with a filter instead of guessing a limit
125
+
10. With a limit, a page can end early at the byte budget - a non-null nextCursor means more rows remain, so pass it back as cursor and loop until it is null. Never infer completion from page size
126
+
11. Omit the filter only when the user genuinely wants every row
0 commit comments