trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

queryWatchFromPatch drops condition.value and windowSec from agent query alert patches

Open shafiktanbir opened this issue 1 month ago • 2 comments

hey! while checking out the query alert creation flow added in c5b123d, I noticed queryWatchFromPatch in apps/webapp/app/components/dashboard-agent/alert-creation/draftPatch.ts (lines 60-68) only forwards operator: patch.condition?.operator into QueryWatchPrefill and drops patch.condition?.value and patch.condition?.windowSec. Because useQueryAlertDraft (apps/webapp/app/components/alerts/useQueryAlertDraft.ts line 52) also initializes valueText to "", draft.valueValid starts out false even when prefill.operator is set (so selected: (done("threshold") || prefill.operator) && draft.valueValid in QueryAlertTranscript.tsx line 240 never pre-selects the threshold step).

is that intentional or should queryWatchFromPatch and useQueryAlertDraft also carry condition.value / windowSec when the agent prefills a query alert? happy to put up a quick PR if you want!

ss ss

shafiktanbir avatar Oct 25 '26 15:10 shafiktanbir

Opened PR #5079 with the fix forwarding condition.value and windowSec in queryWatchFromPatch, updating useQueryAlertDraft, and adding unit test coverage.

MilindChatrabhuji avatar Oct 26 '26 23:10 MilindChatrabhuji

Thank you for finding that, fixed!

kathiekiwi avatar Oct 27 '26 22:10 kathiekiwi