fix(agent-sessions): count a stamped tool call by the gateway's verdict on the detail page - #1141
Closed
JeremyFunk wants to merge 1 commit into
Closed
JeremyFunk wants to merge 1 commit into
JeremyFunk wants to merge 1 commit into
Maple Review Bot / Maple / review
completed
Sep 29, 2026 in 3m 28s
Confidence 3/5 · 1 issue to address
🟡 Confidence 3/5 · needs attention
F3 stays open: pre-stamp rows still merge on the page and count per span on the list, and no test covers that divergence.
quality 90/100 · 1 warning · tests partial · risk medium
Makes the detail page read a gateway-stamped tool span by maple_ai.tool_call and its failure by maple_ai.error, the same verdicts the list SQL sums, leaving pre-stamp spans on the old rule. The stamped paths now agree side to side, but the page and the list still disagree for spans ingested before the stamps (F3).
countedToolCallscounts every gateway-stamped tool span, merging nothingspanFailedreads a stamped span'smaple_ai.erroralone, before the status check- The summary SQL drops the
StatusCodefallback for stamped spans, as the page does
Still open from earlier reviews
- 🟠 Warning · F3 · Session page and list disagree on tool calls for spans ingested before the stamps ·
packages/agent-sessions/src/session-summary.ts:906
Fixed since the last review
- ✅
F2 · Per-turntoolCallssums to more than the session's totals row
What was checked
- Stamped spans are
toolonly whenmaple_ai.tool_call = '1(session-turns.ts:70), so the new shortcut cannot count a paused copy - The gateway stamps
maple_ai.erroron every stamped span that failed by status or attribute except a paused copy (apps/ingest/src/ai_session/facts.rs:317), so dropping the status fallback for stamp… ai_trace_indexonly holds gateway-stamped spans (vendor.idis written with the stamps,ai_session.rs:176), so the list'sIsToolCallmatches the page for rows materialized after migration 0035
7c4c21f · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple to ask about one.
Loading