Skip to content

changeset: release the org-scoping fix + turn cost / tool-span OTel work - #472

Merged
brentrager merged 1 commit into
mainfrom
changeset-otel-org-and-cost
Aug 18, 2026
Merged

brentrager merged 1 commit into
mainfrom
changeset-otel-org-and-cost

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

#470 and #471 both merged without a changeset. The crates.io release in this repo is changeset-driven, so as things stand neither fix publishes and neither reaches a consumer — they sit on main looking done.

That is the failure mode worth naming: a merged fix and a shipped fix are different things here, and nothing in CI distinguishes them.

Why the org-scoping half is urgent

Until the published crate moves, chat-ws and copilot-ws in the monorepo keep building against the old pin, so production continues to scope every tenant's host tools and persona to reference-org — for every customer, on every turn.

Contents

  • handle_send_message: stop re-binding the turn's org to the seed org #470 — handle_send_message bound org_id twice, the second binding shadowing the first with SEED_ORG_ID. The gateway key came from the first binding, so per-org billing stayed correct and hid the split.
  • otel: record per-turn cost, and make tool spans self-identifying #471 — the turn span now records the gateway's authoritative cost (previously parsed by core and carried to TurnUsage.cost_usd, but never recorded, so every consumer read "cost not measured"); tool spans now carry gen_ai.system / gen_ai.operation.name / gen_ai.conversation.id / smooai.org_id, without which OTLP consumers gating on gen_ai.system discarded every tool span ever emitted.

A gateway cost of 0 is deliberately not recorded as a cost — it means the model is unpriced, not free, and writing it as real would silently under-bill.

After this merges

The bot's version PR publishes the crates; then the monorepo pin bump (rust/chat-ws, rust/copilot-ws) and an image rebuild carry it to prod. I'm driving that.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LkCz96UfUxcai5RU4LwPnG

…el work

#470 and #471 both merged without a changeset, so nothing would publish and
neither fix would reach any consumer — the crates.io release here is
changeset-driven. This releases both.

The org-scoping half is the urgent one: until the published crate moves,
chat-ws and copilot-ws keep scoping every tenant's host tools and persona to
reference-org in production.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkCz96UfUxcai5RU4LwPnG
@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7404464

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@smooai/smooth-operator Patch
@smooai/smooth-operator-web-chat-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brentrager
brentrager merged commit aa9af9e into main Aug 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant