Run per-turn teardown: save session and return usage + cost.
Source:R/turn_pipeline.R
dot-turn_teardown.RdRun per-turn teardown: save session and return usage + cost.
Arguments
- client
A
CodeagentClientor bareellmer::Chat.- cwd
Character or NULL.
- session_id
Character or NULL.
Value
Named list with elements:
n_tokens: integer token count (real or estimated)model_limit: integer context window limitwarning_state: list fromcalculate_token_warning_state()or NULLcost_last: numeric cost of the last turn in USD, or NA_real_