Repository navigation
Fix Common AI's AI Model tab for tasks inside a task loop - #75518
Merged
Merged
Conversation
The AI Model tab read the task's model name and usage XComs by task id and map index only. For a task inside a task loop the XCom route needs the loop pass too, so it answered 400 "Select a region and index for this task instance" and the tab showed no model info. The tab now forwards the selected task instance's region_id and region_index from the host, the same way the HITL review plugin does. Hosts that predate the taskInstance prop keep the map-only reads. The region helpers move to a side-effect-free module both plugins share.
kaxil
requested review from
pierrejeambrun
and removed request for
Lee-W,
ashb and
gopidesupavan
October 23, 2026 19:11
pierrejeambrun
approved these changes
Oct 23, 2026
This was referenced Oct 29, 2026
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.
Follow-up to #74334, which added the AI Model tab, and #74351, which taught the HITL review plugin to address one loop pass.
For an
@task.agentor@task.llmtask inside a task loop, the AI Model tab shows "No AI Model Info" with "Select a region and index for this task instance", even though the task pushed its model name andusageXComs. The tab reads them by task id and map index only. For a loop task the XCom route also needs the loop pass, so it rejects the read with a 400. The tab now sends the selected task instance'sregion_idandregion_indexon both reads.No core change. The host already passes the resolved
taskInstance, which carries the region, to every plugin (ReactPlugin.tsx), and the HITL review plugin has used it since #74351. The region helpers move into a side-effect-freeregion.tsthat both plugin bundles import, so the two tabs share one rule instead of two copies.Older hosts keep the old requests. A host that predates the
taskInstanceprop never passes the key, so the tab reads without a region, as before. On a newer host the tab shows its loading spinner until the task instance resolves, rather than sending a read without the region.A slow read for the previous loop pass no longer wins. The host remounts a plugin when the path changes (
ExternalView.tsx), but the loop pass is a search param, so switching passes keeps the panel mounted while the old read may still be in flight. Its result is now dropped.The new tests render the plugin in happy-dom, added as a dev dependency (the core UI tests use the same library). They check the region on both reads, the reread on a pass switch, and the stale-read case. Each of those fails if the region is dropped at any layer between the plugin props and the request.
{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.