Skip to content

Backport #38489 to 2.1 - #38729

Merged
pmbrull merged 2 commits into
open-metadata:2.1from
iamkiayun:backport/38489-2.1
Nov 26, 2026
Merged

pmbrull merged 2 commits into
open-metadata:2.1from
iamkiayun:backport/38489-2.1

Conversation

@iamkiayun

@iamkiayun iamkiayun commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #38450

The automated backport conflicted. This adapts the merged article-read fix to 2.1. get_entity_details returns readable page text, removes embedded HTML images, and preserves SQL in metric expressions. If no readable passages remain, the tool uses its existing whole-page fallback.

All 151 focused unit tests and 9 distinct PostgreSQL/OpenSearch integration tests passed locally.

Backport of open-metadata#38489 (c6b5343). Adapt passage lookup to the vector service on this release.
@iamkiayun
iamkiayun requested a review from a team as a code owner November 25, 2026 17:00
@iamkiayun
iamkiayun requested review from sonika-shah and removed request for a team November 25, 2026 17:00
@github-actions

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.

@Vishnuujain Vishnuujain assigned Vishnuujain and unassigned TeddyCr Nov 25, 2026
@gitar-bot

gitar-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findings

Changing MCP article and metric content extraction strips embedded images and decodes text, which could alter content returned to AI consumers.

Backports the article-read fix to 2.1 so get_entity_details returns budgeted readable passages, strips embedded HTML images, and preserves SQL in metric expressions. The previously open finding about inline base64 images in linked article bundles is now resolved.

✅ 1 closed
✅ Bug: Linked articles in the asset-context bundle still keep inline base64 images

📄 openmetadata-service/src/main/java/org/openmetadata/service/aicontext/AIContextBuilder.java:1127 📄 openmetadata-service/src/main/java/org/openmetadata/service/aicontext/AIContextBuilder.java:1021 📄 openmetadata-service/src/main/java/org/openmetadata/service/aicontext/AIContextBuilder.java:1073 📄 openmetadata-service/src/main/java/org/openmetadata/service/aicontext/AIContextBuilder.java:1089
This PR sends fullContentOf, pillContent and metricContent through PromptText.forContentRead. The articles linked from get_asset_context don't go through it. toArticleKnowledgeItem still builds their content with unescapeRichText(page.getDescription()), which only decodes entities. If an attached Page contains a <img src="data:image/png;base64,...">, applyKnowledgeBudget measures and excerpts the raw base64 and markup. A diagram near the top then fills the whole 800-char excerpt and eats the 8000-char shared budget, and the item gets contentTruncated=true. The agent is pushed to call get_entity_details, and only that call returns the clean text. So the bundle and the full read disagree on the same article. To fix it, use PromptText.forContentRead here as well, so the bundle excerpt is cut from the same cleaned text that the full read returns.

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

@pmbrull pmbrull assigned pmbrull and unassigned Vishnuujain Nov 26, 2026
@pmbrull
pmbrull merged commit 7bd4730 into open-metadata:2.1 Nov 26, 2026
54 of 55 checks passed
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.

4 participants