Repository navigation
[2.1] Fixes #39713: Cap large entity text and fit get_entity_details batches to the response limit (#39814) - #39851
Conversation
… to the response limit (#39814) * Fixes 39713: cap large entity text and fit get_entity_details batches to the response limit Cap LookML and other unpageable entity text using its JSON-escaped length and the configured response limit. Keep the entries that fit in a batch and mark skipped positions so callers can retry them separately. * Fixes 39713: record the get_entity_details batch and text-budget decision (cherry picked from commit 705750e)
Code Review ✅ Approved 🟡 Medium riskCaps entity SQL/code and returns partial oversized batches, so callers may receive flagged incomplete text or need to retry omitted entities. Backport of the get_entity_details fix to 2.1: long SQL or code fields are trimmed and flagged, and oversized batches return the entities that fit in full while marking omitted positions. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Describe your changes
Backport of #39814 to 2.1.
Fixes #39713
A customer's Looker data models hold whole LookML files. When a batch or a single model exceeded the MCP response limit,
get_entity_detailsreturned no entity data. It now trims and flags long SQL or code. An oversized batch returns the entities that fit in full and marks the omitted positions so callers can request them separately.The cherry-pick conflicted only in the
GetEntityToolTest.javaimports. The resolution keeps 2.1's fixtures and adds the imports used by the new tests. The production change kept 2.1's existing read helper. Decision recordType of change
Tests
Unit tests. The focused MCP suite covers text flags, exact response-size boundaries, and omitted batch positions.
mvn -pl openmetadata-mcp test -Dtest=GetEntityToolTest,DefaultToolContextTest,ResponseBudgetTest,McpResponseTrimTestTests run: 135, Failures: 0, Errors: 0, Skipped: 0Backend integration test. The LookML regression verifies the single-model response and the partial batch over MCP.
mvn -B verify -pl :openmetadata-integration-tests -am -DskipBootJar=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel '-Dit.test=McpIntegrationIT#testGetEntityDetailsFitsLookMlBatchAndCapsLargeModelSql' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=falseTests run: 1, Failures: 0, Errors: 0, Skipped: 0Other checks. Spotless passed with no changes. The decision-record and Java impact-map checks passed.
Checklist