← sources

Support copilot keeps repeating dead SQL tool calls

source: reddit (reddit:AI_Agents)published 2026-11-18 14:15ingested 2026-11-19 02:35

retained text

My multi tenant B2B analytics copilot handles about 22k weekly turns, and on one tenant it hits a missing column error then gets stuck in a tool call retry loop with five near identical SQL queries. The repeated model calls burn through 19k tokens on a single turn. model spend is already around $4.6k a month, so trying to figure out how often this happens.

Right now i'm using Braintrust to inspect the failed traces and Loop for failure mode analysis. The child spans show the repeated SQL attempts, and span level token attribution on the LLM calls between them shows where the token budget is going.

Also testing custom trajectory scoring over the tool call sequence to flag repeated failures before the agent burns through the whole turn. Still weighing whether catching these loops earlier justifies maintaining tenant-specific schema mocks for evals.

document fetched 2026-11-19 00:19 · canonical https://reddit.com/r/AI_Agents/comments/1xzg9f9/support_copilot_keeps_repeating_dead_sql_tool