Skip to content

Load Common AI plugin tabs when the browser reaches Airflow on another origin - #75522

Merged
kaxil merged 1 commit into
apache:mainfrom
astronomer:fix-commonai-plugin-bundle-url
Oct 23, 2026
Merged

kaxil merged 1 commit into
apache:mainfrom
astronomer:fix-commonai-plugin-bundle-url

Conversation

@kaxil

@kaxil kaxil commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

The AI Model and HITL Review tabs render empty when the browser reaches Airflow on a different origin than [api] base_url names, for example through a local development proxy while base_url is http://localhost:8080. get_bundle_url copied the scheme and host of base_url into each plugin's bundle_url, so the browser imported the bundle from that other origin and the import failed: a CORS error when something answers there, connection refused when nothing does.

get_bundle_url now returns only the path, as the Edge3 plugin already does. The core UI likewise builds its own URLs from the request path, not from base_url.

The absolute URL is no longer needed for Vite dev mode. It was added so the bundle loaded from core's Vite dev server, where import() resolved relative to the dev server's origin. Since #66618 (Airflow 3.3.0) the host resolves bundle_url against document.baseURI (ReactPlugin.tsx), so a path loads there too. Vite dev mode only runs from main, and a built UI on any version resolves a path against the page's origin, which the Edge3 plugin relies on.

Before and after, with base_url = http://localhost:8080 and the UI opened on another port:

Before: the bundle import goes to localhost:8080 and the tab shows a 404 page

After: the bundle loads from the page's origin and the AI Model panel renders


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

…r origin

get_bundle_url copied the scheme and host of [api] base_url into the plugin
bundle URL. When the browser reached Airflow on a different origin, such as
through a local proxy, the AI Model and HITL Review tabs imported their bundle
cross-origin and rendered empty. Return only the path, which the host UI
resolves against the page it was loaded from.
@kaxil

kaxil commented Oct 23, 2026 •

Copy link
Copy Markdown
Member Author

cc @hussein-awala Need to get this to in Common AI provider 1.1.0rc2

@kaxil
kaxil merged commit 5d1c1d4 into apache:main Oct 23, 2026
73 of 74 checks passed
@kaxil
kaxil deleted the fix-commonai-plugin-bundle-url branch October 23, 2026 22:53
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.

2 participants