Summary: The reported session cost does not include the cost of subagents the session spawned. For any workflow that fans out subagents (e.g. a multi-subagent review command), the displayed cost is far below what was actually billed.
Repro:
- Run a session that dispatches several subagents (Task/subagent calls).
- Note the cost shown in the TUI sidebar/footer (also
opencode stats and /export).
- Sum the per-message cost of the root session and every subagent (walk
parent_id in the SQLite history via opencode db).
- The true total is much higher than the reported figure.
Actual: Only the root session cost is reported; subagent cost is excluded.
Expected: Session cost aggregates the root session plus all subagents, recursively.
Impact: Cost attribution/comparison is wrong for any subagent-heavy workflow.
Context: Appears to be the same limitation as #11027 (auto-closed for inactivity, not fixed) and RFC #12377 (closed); related to #31032. Opening a fresh issue per the stale-bot suggestion on #11027.
Workaround: Sum per-message cost from the SQLite history with a recursive walk over parent_id.
Environment: opencode 1.18.x, macOS.
Summary: The reported session cost does not include the cost of subagents the session spawned. For any workflow that fans out subagents (e.g. a multi-subagent review command), the displayed cost is far below what was actually billed.
Repro:
opencode statsand/export).parent_idin the SQLite history viaopencode db).Actual: Only the root session cost is reported; subagent cost is excluded.
Expected: Session cost aggregates the root session plus all subagents, recursively.
Impact: Cost attribution/comparison is wrong for any subagent-heavy workflow.
Context: Appears to be the same limitation as #11027 (auto-closed for inactivity, not fixed) and RFC #12377 (closed); related to #31032. Opening a fresh issue per the stale-bot suggestion on #11027.
Workaround: Sum per-message cost from the SQLite history with a recursive walk over
parent_id.Environment: opencode 1.18.x, macOS.