Repository navigation
fix(money): count per-agent advisor artifacts in sessions scan - #13
Merged
Merged
Conversation
The scan walked <repo>/<session-dir>/*.jsonl (main sessions, subagent artifacts, main __advisor.jsonl) but stopped one level short of <repo>/<session-dir>/<Agent>/__advisor.jsonl — advisor consults inside subagent trees carry usage.cost.total like any other artifact and were silently dropped. Measured on the live sessions tree: 157 files / ~6.8k entries missed, ~22% under 7DAY, ~28% under DAY. Scan now covers session-dir subtrees one level deeper; omp writes no .jsonl below that (verified: zero files at depth 5), so no recursion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The money line under-counted advisor spend.
scanMoneywalked<repo>/<session-dir>/*.jsonl(main sessions, subagent<Agent>.jsonl, main__advisor.jsonl) but never entered the per-agent subtrees —<repo>/<session-dir>/<Agent>/__advisor.jsonlsits one level deeper and was silently skipped.Advisor artifacts carry the standard
usage.cost.totalshape, so this was real spend missing from DAY/7DAY/30DAY.Measured impact (live sessions tree, 2026-10-12)
157 files / ~6.8k entries affected. Depth 5 verified empty — no recursion needed, one extra level covers the tree completely.
Change
scanSessionDir(): walks the session dir itself plus per-agent subtrees one level deeper.subshare, entry count)./slnotify docs name both__advisor.jsonllevels;subfield comment now reads "subagent + advisor artifact share".Verify