Repository navigation
[2.0] Fixes #39713: Cap large entity text and fit get_entity_details batches to the response limit (#39814) - #39861
Merged
Merged
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) 2.0 adaptation: 2.0 has no configurable MCP response limit, so the caps and batch fitting use the fixed McpResponseTrim.MAX_RESPONSE_CHARS (100k). The configured-limit and metric-variant tests are dropped (neither feature exists on 2.0); the exact-limit, content and long-reference tests are rewritten against the fixed limit.
Code Review ✅ Approved 🟡 Medium riskCapping entity text and omitting oversized batch entries could leave callers without full metadata unless they retry or use REST. Caps oversized SQL and code text in 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 |
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.
Describe your changes
Backport of #39814 to 2.0.
Fixes #39713
A customer's Looker data models hold whole LookML files, so
get_entity_detailsreturned nothing (truncated, no data) once a batch or a single model went over the MCP response limit. Now long SQL or code is cut and flagged (e.g.sqlTruncated), and an oversized batch returns the entities that fit in full while marking the rest as omitted so the caller can request them separately.2.0 adaptation
2.0 has no configurable MCP response limit (
maxResponseChars), so the change uses the fixedMcpResponseTrim.MAX_RESPONSE_CHARS(100k). The text caps come out at the same 30k per field / 60k per entity as on main and 2.1.GetEntityTool.java: identical to Fixes 39713: cap large entity text and fit get_entity_details batches to the response limit #39814 except the twomaxResponseChars()calls read the fixed limit, and one comment says so.tools.json: the new text is merged into 2.0's description, without the metric-variants sentence (that feature is not on 2.0).GetEntityToolTest.java: two tests are not carried over because the feature they test is not on 2.0 (a configured limit, metric variants). Three tests that set a configured limit are rewritten against the fixed 100k limit: exactly at the limit vs one character over, the content section measured before keeping an entity, and long error references. The other new tests are unchanged.McpIntegrationIT.java: the LookML test is unchanged; one import added.docs/decisions/2026-12-04-get-entity-details-batches-fit-the-response-limit.md.Type of change
Tests
Run on this branch (2.0):
mvn -pl openmetadata-mcp test -Dtest=GetEntityToolTest,DefaultToolContextTest,ResponseBudgetTest,McpResponseTrimTestTests run: 114, Failures: 0, Errors: 0, Skipped: 0mvn -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: 0Spotless applied; no UI, schema or migration changes.
🤖 Generated with Claude Code