Skip to content

fix(tables): resolve active selector before schema enrichment - #6345

Merged
TheodoreSpeaks merged 1 commit into
stagingfrom
debug/table-query
Aug 6, 2026
Merged

fix(tables): resolve active selector before schema enrichment#6345
TheodoreSpeaks merged 1 commit into
stagingfrom
debug/table-query

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • Resolve the active canonical selector before enriching Agent tool schemas
  • Preserve direct canonical IDs when no selector value is active
  • Cover conflicting table ID and selector values with regression tests

Type of Change

  • Bug fix

Testing

  • Provider utility suite: 159 tests passed
  • Lint, block registry audit, and all pre-ship audits passed

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 6, 2026 10:15pm

Request Review

@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes how table and knowledge-base canonical IDs are resolved for Agent tool schemas and execution; wrong resolution would target the wrong resource, but behavior is aligned with existing paramsTransform and covered by new regression tests.

Overview
Fixes Agent table tools where a stale tableId in params could win over the current basic selector (tableSelector), so LLM schema enrichment, unique tool ids, and descriptions pointed at the wrong table.

resolveCanonicalResourceParams no longer skips resolution when tableId (or other canonical keys) is already set. It always picks the value from the active basic/advanced selector via resolveActiveCanonicalValue, matching execution-time paramsTransform. If the active selector is empty, the existing canonical id is kept for direct-id and advanced-mode callers.

Tests add conflicting tableId vs tableSelector cases and assert enrichment and paramsTransform use the active table.

Reviewed by Cursor Bugbot for commit a335383. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR aligns schema enrichment and unique tool IDs with the active basic or advanced resource selector while preserving direct canonical IDs when the active selector is empty.

  • Removes the early canonical-ID short circuit so an active selector can replace a stale canonical value.
  • Adds regression coverage for conflicting table IDs, advanced-mode canonical IDs, and execution-time parameter transformation.

Confidence Score: 5/5

The PR appears safe to merge with no blocking or non-blocking issues identified.

The changed resolver follows the execution-time canonical selection logic, preserves canonical values for empty active selectors, and remains consistent across table, workflow, knowledge-base, and multi-instance tool paths.

Important Files Changed

Filename Overview
apps/sim/providers/utils.ts Updates canonical resource resolution to use the same active-selector precedence as execution-time parameter transformation; no actionable defect was identified.
apps/sim/providers/utils.test.ts Adds focused regression coverage for stale canonical values, active selectors, and advanced-mode preservation.

Reviews (1): Last reviewed commit: "fix(tables): resolve active selector bef..." | Re-trigger Greptile

@TheodoreSpeaks
TheodoreSpeaks merged commit f76d46b into staging Aug 6, 2026
5 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the debug/table-query branch August 6, 2026 22:25
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