Repository navigation
feat: tell agents each database's provider, and size results for a model's context - #11
Merged
Merged
Conversation
…del's context - list_databases returns each database's provider alongside its name, so an agent knows which SQL dialect to write instead of finding out from a syntax error. - Query rows are arrays in column order rather than objects, so column names aren't repeated on every row. This applies to /api/query as well. - App:MaxRows now defaults to 100 and App:MaxResultBytes to 100000 (about 25,000 tokens), down from 1000 and 4000000. The new App:MaxTables (default 1000) limits list_tables, which MaxRows used to. - A truncated result carries a note saying which limit stopped it and how to narrow or page the query, with paging in the database's own syntax.
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.
An agent had no way to tell which SQL dialect a database speaks, and one query could return about a million tokens, more than a model's whole context.
list_databasesreturns[{"name":"prod","provider":"Postgres"}, …], and its description tells the agent to write each database's SQL in that provider's dialect. Before, the agent learnedTOPvsLIMITvsFETCH FIRSTfrom a syntax error.columns, so column names aren't repeated on every row./api/queryreturns the same shape.App:MaxRowsgoes from 1000 to 100, andApp:MaxResultBytesfrom 4000000 to 100000 (about 25,000 tokens). The newApp:MaxTables(default 1000) limitslist_tables, whichMaxRowsused to, so the table list isn't cut to 100.notesaying which limit stopped it and how to narrow or page the query, with paging in the database's own syntax:{ "columns": ["n","sq"], "rows": [[1,1], …, [100,10000]], "truncated": true, "note": "Only the first 100 rows are shown (App:MaxRows). Narrow the query with WHERE, summarize it with GROUP BY, or page through it with ORDER BY ... LIMIT 100 OFFSET 100." }Tested locally: the full suite against all four databases (319 tests), and a 500-row query over MCP against Postgres, which now returns 100 rows in 1,172 characters with the note.