fix(tables): pass enriched query schema to agents - #6305
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Canonical resolution before enrichment: Trusted execution context for table schema fetch: Fail-fast at execution boundaries: Enrichment failures are wrapped in Table tool definitions and types were updated so Reviewed by Cursor Bugbot for commit e35303d. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR fixes table-tool schema enrichment so agents receive schemas based on the resolved table and authenticated metadata. It also makes enrichment failures abort tool construction rather than silently omitting configured tools.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported silent tool omission is addressed at both tool-building boundaries, and all current production table-enrichment callers provide the required trusted execution context.
|
| Filename | Overview |
|---|---|
| apps/sim/tools/schema-enrichers.ts | Fetches and validates table metadata through the authenticated detail route before enriching table-tool schemas. |
| apps/sim/tools/params.ts | Passes trusted execution context to enrichers and wraps enrichment failures in a dedicated error. |
| apps/sim/providers/utils.ts | Resolves mounted resource parameters before generating the LLM-visible tool schema. |
| apps/sim/executor/handlers/agent/agent-handler.ts | Supplies execution identity during enrichment and propagates enrichment failures before invoking the provider. |
| apps/sim/executor/handlers/pi/sim-tools.ts | Supplies the same trusted enrichment context and fail-fast handling for Pi tool specifications. |
Sequence Diagram
sequenceDiagram
participant Handler as Agent or Pi Handler
participant Transform as transformBlockTool
participant Schema as createLLMToolSchema
participant Table as Authenticated Table API
participant Provider as Agent Provider
Handler->>Transform: Tool config and trusted execution context
Transform->>Transform: Resolve canonical table ID
Transform->>Schema: Resolved params and context
Schema->>Table: Fetch table details with user and workspace identity
Table-->>Schema: Table name and columns
Schema-->>Transform: Enriched description and parameters
Transform-->>Handler: Provider tool configuration
Handler->>Provider: Send enriched tool schema
Note over Schema,Handler: Enrichment errors are wrapped and rethrown
Reviews (3): Last reviewed commit: "fix(tables): pass enriched query schema ..." | Re-trigger Greptile
1f3f074 to
de00178
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit de00178. Configure here.
de00178 to
7137481
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7137481. Configure here.
7137481 to
e35303d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e35303d. Configure here.

Summary
Type of Change
Testing
Checklist