Skip to content

v0.6.9

@Meskupie Meskupie tagged this 21 Oct 19:39
* feat(adk): price every model call of a GPT Live call (0.6.9)

A GPT Live call's ctx.usage now counts every model call made during the
call, not only those in backend runs' session events. Runs and decide()
read the observers of an async scope when they start; the Live handler
opens that scope for the call's entry, each backend run and each hook,
so decisions from hooks and tools are counted too.

A model call that ended without usage, or is still running when the call
closes, is priced at the input estimated when it started
(model_start.estimatedInput) with an estimated basis, instead of making
the whole total unavailable. LiveCallUsage breaks the cost into voice,
backend and decisions; GPT Live's transcripts carry no separate charge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(developer-docs): stub AsyncLocalStorage for the ADK browser bundle

The ADK's GPT Live handler now imports AsyncLocalStorage. It sits in the
lazy voice-eval chunk, which a page never loads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(adk): share the model call context across builds, estimate only failed calls

Review of the 0.6.9 change:
- The CommonJS build bundles each entry separately, so the runner and the
  Live handler held different context copies and counted nothing. The
  context now lives on globalThis under a Symbol.for key.
- The hook proxy runs getters on the hook, so private fields work, and
  returns a frozen method unchanged, as a proxy must.
- Only a call that failed without usage, or has not ended, is estimated;
  a step a beforeModel hook answered stays unknown. decide() reports zero
  usage when it fails before sending and keeps the provider's usage when
  the answers do not match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Assets 2
Loading