Skip to content

[2.1] Fixes #39713: Cap large entity text and fit get_entity_details batches to the response limit (#39814) - #39851

Merged
fmcardoso merged 1 commit into
2.1from
backport/2.1/pr-39814
Dec 4, 2026
Merged

fmcardoso merged 1 commit into
2.1from
backport/2.1/pr-39814

Conversation

@fmcardoso

Copy link
Copy Markdown
Member

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_details returned 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.java imports. 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 record

Type of change

  • Bug fix

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,McpResponseTrimTest

Tests run: 135, Failures: 0, Errors: 0, Skipped: 0

Backend 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=false

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

Other checks. Spotless passed with no changes. The decision-record and Java impact-map checks passed.

mvn spotless:apply -pl openmetadata-mcp,openmetadata-integration-tests
python3 scripts/harness/check_decision_records.py
python3 .github/scripts/plan_local_java_tests.py --base origin/2.1 --check-branch

Checklist

  • Linked the issue and the original PR.
  • Checked the 2.1 conflict resolution and ran the focused regression tests.
  • UI, Playwright, ingestion, and schema migration checks are N/A for this backend backport.

… 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)
@gitar-bot

gitar-bot Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Caps 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.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@fmcardoso
fmcardoso marked this pull request as ready for review December 4, 2026 14:07
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@fmcardoso
fmcardoso merged commit e5fe6e0 into 2.1 Dec 4, 2026
81 of 83 checks passed
@fmcardoso
fmcardoso deleted the backport/2.1/pr-39814 branch December 4, 2026 15:12
@fmcardoso fmcardoso added the skip-pr-checks Bypass PR metadata validation check label Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant