# Agent Couldn T Parse The Jinja Error T 1ae2fde0e39955f9

> Teaches an agent to read nested dbt macro tracebacks inside-out: the innermost frame is the failing macro, reproduced fastest with dbt run-operation. Use when a Jinja traceback has confusing nested macro frames. Not for single-frame errors.

- Skill: `vectle/agent-couldn-t-parse-the-jinja-error-t-1ae2fde0e39955f9` (Agent Skill)
- Install (CLI): `npx get-skill add vectle/agent-couldn-t-parse-the-jinja-error-t-1ae2fde0e39955f9`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vectle/agent-couldn-t-parse-the-jinja-error-t-1ae2fde0e39955f9/raw
- Safety review: pending (external: skill-scanner PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: Vectle (https://skillmd.com/u/vectle)
- Updated: 2026-11-19
- Page: https://skillmd.com/skills/vectle/agent-couldn-t-parse-the-jinja-error-t-1ae2fde0e39955f9

---


## TL;DR

Nested macro tracebacks read inside-out: the innermost frame is where it actually broke, the outer frames are just the call chain. The agent should rerun with `--debug` for full frames, find the innermost macro frame, reproduce it with `dbt run-operation`, and fix that macro.

## Error

```text
agent couldn't parse the jinja error traceback: nested macro frames
```

## Steps

1. Rerun the failing command with `--debug` to get the complete traceback with all frames. Expected: the full call chain, not a truncated summary.
2. Read from the bottom up: the last (innermost) macro frame is the failure point. Expected: one file and line to focus on.
3. Open that macro at that line. Expected: the offending expression is visible.
4. Reproduce minimally: `dbt run-operation [MACRO] --args '{...}'` with args matching the real call. Expected: the same failure in isolation.
5. Fix the macro, verify with the repro, then recompile. Expected: the whole chain renders.

## When to use

- A dbt error traceback shows multiple nested macro frames.
- The agent cannot tell which macro actually failed.

## When not to use

- The traceback has a single frame (the failure point is obvious).
- The error is in model SQL rather than a macro.

## Tool compatibility

- dbt Core 1.0 and later, all adapters.

## Variant phrasings

### Traceback shows the same macro 20 times

That is recursion, not nesting; look for the repeating frame and add a base case.

### Error at the top frame misleads the fix

Top frames are callers; fixing them treats the symptom.

## Why it happens

Macros call macros, and dbt reports the whole stack. Agents read top-down (the natural way) and fix callers, but the defect lives at the bottom of the stack where the actual bad expression ran.

## Edge cases

- Adapter macros (dispatch) add frames from package code; the innermost project frame is usually the actionable one.
- Truncated tracebacks (without `--debug`) hide the innermost frames; always rerun with `--debug`.
- If the innermost frame is in Jinja internals, the real cause is the argument passed one frame up.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_bOQPBBI7qlOvBEKDBwwC2A


---

Source: [Vectle](https://vectle.com/skills/skl_IQvi5u-lRTxzvbVRWYdoVA). Version: `skv_AbRiR7_GMZ4bcfXV2MGejA`. Original contributor attribution is preserved in the frontmatter. Content remains subject to [Vectle’s terms](https://vectle.com/terms) and its contributors’ rights; this mirror does not grant a new content license.

