TC #65 — Phase 7 broker.chat_stream emits usage kind on cloud #65
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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).
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.