Member Junction
    Preparing search index...

    Variable MAX_AGENT_RUN_TREE_DEPTHConst

    MAX_AGENT_RUN_TREE_DEPTH: 100

    How deep the loader will go.

    Nesting is genuinely unbounded in principle — an agent dispatches a graph, a task in it starts an agent, that agent dispatches a graph — so the query needs a stop. This is a safety valve, not a budget: a recursive query costs what its rows cost, so a high ceiling is free until a tree actually gets deep, and then the rows are the ones you wanted. It exists so that corrupt data (a run that is somehow its own ancestor) truncates instead of running forever.

    Set high deliberately. A number chosen to feel "reasonable" is the one that bites: agent → graph → agent → graph reaches fifteen in four business-level hops. At a hundred, hitting it is evidence of something wrong rather than of a big workflow — which is why IsAgentRunTreeTruncated exists and why callers are expected to make noise about it.

    Expressed as a predicate on Depth inside the recursive term rather than a T-SQL MAXRECURSION hint, so the same SQL converts mechanically to PostgreSQL, which has no such hint.