Skip to content

fix(node): re-export GenAI helpers from node entry - #29

Merged
brentrager merged 1 commit into
mainfrom
fix-node-genai-exports
May 23, 2026
Merged

fix(node): re-export GenAI helpers from node entry#29
brentrager merged 1 commit into
mainfrom
fix-node-genai-exports

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Summary

The node entry (packages/core/src/node/index.ts) was missing re-exports for setGenAIAttributes, recordGenAIMessage, GenAIAttributes, GenAIOperationName, and GenAISystem.

Since @smooai/observability resolves to ./dist/node.mjs in Node via the "node" conditional export, consumers importing these helpers from the bare package name fail to build:

Error: No matching export in "node_modules/@smooai/observability/dist/node.mjs" for import "setGenAIAttributes"

Two consecutive smooai prod deploys failed on this (workflow runs 26322401458, 26334390802).

Fix

Add the missing re-exports from ../gen-ai-attributes to packages/core/src/node/index.ts, mirroring the exports already present in packages/core/src/index.ts:11.

Test plan

  • pnpm --filter @smooai/observability build succeeds
  • grep "setGenAIAttributes" packages/core/dist/node.mjs matches
  • pnpm --filter @smooai/observability test — all 53 tests pass
  • Changeset added: @smooai/observability patch → 0.10.1

The node entry was missing re-exports for setGenAIAttributes,
recordGenAIMessage, and the GenAI types (GenAIAttributes,
GenAIOperationName, GenAISystem). Since '@smooai/observability'
resolves to ./dist/node.mjs in Node via the 'node' conditional export,
consumers importing these helpers from the bare package name failed
to build with 'No matching export in node.mjs for import setGenAIAttributes'.

Mirrors the exports already present in src/index.ts.
@changeset-bot

changeset-bot Bot commented May 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ec16ab4

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

This PR includes changesets to release 1 package
Name Type
@smooai/observability 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 170b137 into main May 23, 2026
1 check failed
brentrager added a commit that referenced this pull request Jun 21, 2026
…ansport (not raw reqwest) (#61)

auth.rs (M2M token mint) and transport.rs (webhook event delivery) now go
through smooai-fetch (retries/timeouts/circuit-breaking). reqwest kept only
for the OTLP exporter (opentelemetry-http HttpClient coupling) and the
reqwest_mw integration helper — documented per Code-Conventions #29.
fmt+clippy(--all-features)+test green.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
brentrager added a commit that referenced this pull request Jun 21, 2026
…OTLP where feasible)

The batched webhook event delivery now goes through smooai-fetch
(retries/timeouts/circuit-breaking) instead of raw httpx. smooai-fetch is
async-only, so the transport's daemon worker thread owns a private asyncio loop
and drives fetch() via run_until_complete; the host loop is never touched. The
fetch call is injectable (fetch_fn) because smooai-fetch constructs its own
httpx.AsyncClient with no client-injection seam — tests substitute an async stub.

smooai-fetch requires Python >=3.12, so the SDK floor bumps from >=3.10 to
>=3.12 (ruff target-version py312, uv.lock drops cp310/cp311 wheels).

OTLP exporter (secondary) deferred: opentelemetry-exporter-otlp-proto-http is
coupled to a sync requests.Session and owns protobuf serialization + its own
retry loop. Backing it with async smooai-fetch would mean reimplementing that
encoding/retry surface — the same reason the Rust SDK kept reqwest for OTLP
(#61, Code-Conventions #29). Deferred cleanly rather than hacked; no
double-retry layer introduced. The OAuth token provider keeps httpx for the same
reason (it backs the OTLP path).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
brentrager added a commit that referenced this pull request Jun 21, 2026
…s Python floor to 3.12) (#64)

* SMOODEV-2026: Python observability SDK transport via smooai-fetch (+ OTLP where feasible)

The batched webhook event delivery now goes through smooai-fetch
(retries/timeouts/circuit-breaking) instead of raw httpx. smooai-fetch is
async-only, so the transport's daemon worker thread owns a private asyncio loop
and drives fetch() via run_until_complete; the host loop is never touched. The
fetch call is injectable (fetch_fn) because smooai-fetch constructs its own
httpx.AsyncClient with no client-injection seam — tests substitute an async stub.

smooai-fetch requires Python >=3.12, so the SDK floor bumps from >=3.10 to
>=3.12 (ruff target-version py312, uv.lock drops cp310/cp311 wheels).

OTLP exporter (secondary) deferred: opentelemetry-exporter-otlp-proto-http is
coupled to a sync requests.Session and owns protobuf serialization + its own
retry loop. Backing it with async smooai-fetch would mean reimplementing that
encoding/retry surface — the same reason the Rust SDK kept reqwest for OTLP
(#61, Code-Conventions #29). Deferred cleanly rather than hacked; no
double-retry layer introduced. The OAuth token provider keeps httpx for the same
reason (it backs the OTLP path).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* SMOODEV-2026: PEP 695 generic for run_with_scope (ruff UP047 under py312 floor)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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