From 60a25919b1245070ee9707e55c406c03a3c2a1d6 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 18 Apr 2026 03:03:45 +0100 Subject: Report session cost to client. --- kaagum/tea.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/kaagum/tea.scm b/kaagum/tea.scm index 9b236e0..96fcc81 100644 --- a/kaagum/tea.scm +++ b/kaagum/tea.scm @@ -770,7 +770,17 @@ ending the turn of session with @var{session-id}." ("thoughtTokens" . ,thought-tokens) ("cachedReadTokens" . ,cache-read-tokens) ("cachedWriteTokens" . ,cache-write-tokens))) - '())))))))) + '())))) + (acp-message `(("jsonrpc" . "2.0") + ("method" . "session/update") + ("params" + ("sessionId" . ,session-id) + ("update" + ("sessionUpdate" . "usage_update") + ("cost" + ("amount" . ,(focus (state-session-cost session-id) + state)) + ("currency" . "USD")))))))))) (define (next-state-llm-response state response tools) "Given current @var{state} and a new LLM @var{response}, return the next state -- cgit 1.4.1