Commit 3cd2aa8
[MISC] Propagate line-item executor usage_records up the prompt chain (#1970)
LINE_ITEM prompts dispatch to the cloud line_item_extractor executor
via `_run_line_item_extraction`, but the legacy executor's
`_execute_single_prompt` returned `[]` instead of the executor's
flushed usage records. The records existed in
`line_item_result.metadata["usage_records"]` and were dropped on the
floor, so the structure_pipeline / answer_prompt outer
ExecutionResult never carried them to executor/tasks.py — and the
token_usage table stayed empty for line-item prompts.
Drain `line_item_result.metadata.usage_records`,
return them from `_run_line_item_extraction`, and forward through
the LINE_ITEM branch of `_execute_single_prompt` so they ride along
with the per-prompt usage accumulator like every other prompt type.
Paired with the cloud-side fix in unstract-cloud#1498 which adds the
flush at the line_item / agentic_table / etc. executor side.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 993f676 commit 3cd2aa8
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1720 | 1720 | | |
1721 | 1721 | | |
1722 | 1722 | | |
1723 | | - | |
| 1723 | + | |
1724 | 1724 | | |
1725 | 1725 | | |
1726 | 1726 | | |
| |||
1739 | 1739 | | |
1740 | 1740 | | |
1741 | 1741 | | |
1742 | | - | |
1743 | 1742 | | |
1744 | 1743 | | |
1745 | 1744 | | |
| |||
2070 | 2069 | | |
2071 | 2070 | | |
2072 | 2071 | | |
2073 | | - | |
| 2072 | + | |
2074 | 2073 | | |
2075 | 2074 | | |
2076 | 2075 | | |
| |||
2118 | 2117 | | |
2119 | 2118 | | |
2120 | 2119 | | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
2121 | 2124 | | |
2122 | 2125 | | |
2123 | 2126 | | |
| |||
2143 | 2146 | | |
2144 | 2147 | | |
2145 | 2148 | | |
| 2149 | + | |
2146 | 2150 | | |
2147 | 2151 | | |
2148 | 2152 | | |
| |||
0 commit comments