From f04e77788e42d0006456e8f2c152a8c5dc932d00 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Fri, 17 Apr 2026 10:13:32 +0200 Subject: [PATCH] fix: thread environment into correlation-chain query in ExchangeHeader The env-scoping migration (P3A) changed useCorrelationChain to require an environment arg and gate on `enabled: !!correlationId && !!environment`, but ExchangeHeader was still calling it with one arg. Result: the query never fired, so the header always rendered "no correlated exchanges found" even when 4+ exchanges shared a correlationId. Fix: read the selected env from the Zustand environment store and pass it through. Co-Authored-By: Claude Opus 4.7 (1M context) --- ui/src/pages/Exchanges/ExchangeHeader.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/src/pages/Exchanges/ExchangeHeader.tsx b/ui/src/pages/Exchanges/ExchangeHeader.tsx index ba313389..930415b0 100644 --- a/ui/src/pages/Exchanges/ExchangeHeader.tsx +++ b/ui/src/pages/Exchanges/ExchangeHeader.tsx @@ -6,6 +6,7 @@ import { useCorrelationChain } from '../../api/queries/correlation'; import { useAgents } from '../../api/queries/agents'; import { useCatalog } from '../../api/queries/catalog'; import { useCanControl } from '../../auth/auth-store'; +import { useEnvironmentStore } from '../../api/environment-store'; import type { ExecutionDetail } from '../../components/ExecutionDiagram/types'; import { attributeBadgeColor } from '../../utils/attribute-color'; import { formatDuration, statusLabel } from '../../utils/format-utils'; @@ -32,7 +33,8 @@ function statusVariant(s: string): StatusVariant { export function ExchangeHeader({ detail, onCorrelatedSelect, onClearSelection }: ExchangeHeaderProps) { const navigate = useNavigate(); const { timeRange } = useGlobalFilters(); - const { data: chainResult } = useCorrelationChain(detail.correlationId ?? null); + const environment = useEnvironmentStore((s) => s.environment); + const { data: chainResult } = useCorrelationChain(detail.correlationId ?? null, environment); const chain = chainResult?.data; const showChain = chain && chain.length > 1; const attrs = Object.entries(detail.attributes ?? {});