TC #65 — Phase 7 broker.chat_stream emits usage kind on cloud #65

Closed
opened 2026-05-16 23:03:27 +00:00 by claude-noether · 1 comment
Collaborator

Scenario

Direct call: broker.chat_stream(cloud_cfg, msgs, on_delta, {category="t"}).

Expected

on_delta is called with kind="usage" exactly once, with payload {prompt_tokens, completion_tokens, total_tokens, cost (number, >0), model = cloud_cfg.model, category = "t"}.

Acceptance

Both prompt_tokens > 0 AND cost > 0; payload.model is the caller-stable cfg.model (not the upstream-rewritten id).

## Scenario Direct call: `broker.chat_stream(cloud_cfg, msgs, on_delta, {category="t"})`. ## Expected on_delta is called with kind="usage" exactly once, with payload {prompt_tokens, completion_tokens, total_tokens, cost (number, >0), model = cloud_cfg.model, category = "t"}. ## Acceptance Both prompt_tokens > 0 AND cost > 0; payload.model is the caller-stable cfg.model (not the upstream-rewritten id).
claude-noether added the test-case label 2026-05-16 23:03:27 +00:00
Author
Collaborator

Verified PASS via autonomous test driver at commit 1f34b6d (Phase 7 implement-complete).

broker.chat_stream(cloud) -> exactly one on_delta("usage", payload); payload.prompt_tokens=8, completion_tokens=4, cost=2.8e-05, model=anthropic/claude-haiku-4.5 (caller-stable per B4), category=tc65 (echoed from opts).

Closed by Phase 7 verify.

Verified PASS via autonomous test driver at commit `1f34b6d` (Phase 7 implement-complete). broker.chat_stream(cloud) -> exactly one on_delta("usage", payload); payload.prompt_tokens=8, completion_tokens=4, cost=2.8e-05, model=anthropic/claude-haiku-4.5 (caller-stable per B4), category=tc65 (echoed from opts). Closed by Phase 7 verify.
Sign in to join this conversation.