Files
hermes-agent/hermes_cli
teknium1 1a08c487be fix: scope one-shot aux usage to the branch and keep it on failed turns
Review follow-up for #113119.

auxiliary_usage_by_task walked parent_session_id past an explicit /branch
copy, so a resumed branch one-shot's per-run delta absorbed aux spend that
another process billed to the source session in the meantime. The walk now
stops at the nearest explicit-branch node (inclusive), mirroring the cutoff
hermes_state_messages applies for resume; compression children of the branch
still count because they never carry _branched_from.

_attach_auxiliary_usage read the tip id from the result dict, which a failed
turn (billing/entitlement failure return) does not carry, so the ledger's
auxiliary block came back empty exactly when the docs promise it is written.
The caller now passes agent.session_id (or the start id) as a fallback.
2026-09-16 17:03:25 -07:00
..
…
…
…
…
…
…
…
…
…
…
…
…