Skip to content

Commit 5463a40

Browse files
committed
fix(webapp): treat agent-written TRQL as caller-authored
The agent's charts post TRQL an LLM wrote to the metric endpoint. A query it gets wrong is not a bug in our code, so those rejections should not alert either. The endpoint also serves built-in dashboard tiles, whose TRQL we do write, so the flag is set by the caller rather than the route: only the agent's charts opt in. Built-in tiles and the queue metric cards stay at error level.
1 parent 80fd75d commit 5463a40

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

apps/webapp/app/components/dashboard-agent/AgentChart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export function AgentChart({ block }: { block: ChartBlock }) {
6767
period: block.period ?? null,
6868
from: null,
6969
to: null,
70+
userAuthoredQuery: true,
7071
}),
7172
signal: controller.signal,
7273
})

apps/webapp/app/routes/resources.metric.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const MetricWidgetQuery = z.object({
5252
tags: z.array(z.string()).optional(),
5353
// Opt into server-side gap fill (carry-forward for gauges, zero-fill for counters).
5454
fillGaps: z.boolean().optional(),
55+
userAuthoredQuery: z.boolean().optional(),
5556
});
5657

5758
export const action = async ({ request }: ActionFunctionArgs) => {
@@ -88,6 +89,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
8889
providers,
8990
tags: _tags,
9091
fillGaps,
92+
userAuthoredQuery,
9193
} = submission.data;
9294

9395
// Check they should be able to access it
@@ -126,6 +128,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
126128
operations,
127129
providers,
128130
fillGaps,
131+
userAuthoredQuery,
129132
// Set higher concurrency if many widgets are on screen at once
130133
customOrgConcurrencyLimit: env.METRIC_WIDGET_DEFAULT_ORG_CONCURRENCY_LIMIT,
131134
});

0 commit comments

Comments
 (0)