@lumoai/cli 1.20.2 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -216,14 +216,17 @@ function resolveSessionStartStdout(responseBody, deps, now = new Date()) {
|
|
|
216
216
|
return [formatSuggestLine(sessionId, match)];
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
219
|
-
* For stop/stop-failure hooks, read the transcript named in
|
|
220
|
-
* fold cumulative token totals into the body under
|
|
221
|
-
* can persist them on the Session.
|
|
222
|
-
*
|
|
223
|
-
*
|
|
219
|
+
* For stop/stop-failure/post-tool-batch hooks, read the transcript named in
|
|
220
|
+
* the payload and fold cumulative token totals into the body under
|
|
221
|
+
* `_lumo_usage` so the server can persist them on the Session. post-tool-batch
|
|
222
|
+
* carries usage so long single turns surface live burn before the first STOP
|
|
223
|
+
* (LUM-345); the server treats it as a flat-columns-only overwrite. Best-
|
|
224
|
+
* effort: returns the body unchanged on any failure (no transcript_path,
|
|
225
|
+
* unreadable, unparseable, no usage). The hook is never blocked or failed by
|
|
226
|
+
* this.
|
|
224
227
|
*/
|
|
225
228
|
function augmentBodyWithUsage(path, body) {
|
|
226
|
-
if (path !== 'stop' && path !== 'stop-failure')
|
|
229
|
+
if (path !== 'stop' && path !== 'stop-failure' && path !== 'post-tool-batch')
|
|
227
230
|
return body;
|
|
228
231
|
let parsed;
|
|
229
232
|
try {
|