Skip to content

feat(tracing): TS SDK session/user metadata API (0.10.0)#128

Merged
davidfarah2003 merged 1 commit intomainfrom
feat/ts-sdk-session-user-0.10.0
Apr 25, 2026
Merged

feat(tracing): TS SDK session/user metadata API (0.10.0)#128
davidfarah2003 merged 1 commit intomainfrom
feat/ts-sdk-session-user-0.10.0

Conversation

@davidfarah2003
Copy link
Copy Markdown
Contributor

Summary

  • Adds setSession, setUser, and updateTrace to @kayba_ai/tracing so callers can group multiple traces into a single agent run via mlflow.trace.session and mlflow.trace.user metadata.
  • Internal injectFolderTag renamed to injectKaybaContext, now emits folder + session + user in one updateCurrentTrace call.
  • Lockfile rewrite corrects a pre-existing mismatch (was @kayba/tracing@0.1.0 with stray openai/dotenv).
  • Bumps SDK to 0.10.0 (additive, no breaking changes).

Why

Each call to kayba.trace(fn) creates a new MLflow trace. Without a session id, agents that emit one trace per tool call (e.g. traderclaw plugin) leave 50+ disconnected traces in the dashboard with no way to filter them as a single conversation. This adds the standard MLflow mlflow.trace.session / mlflow.trace.user metadata, plus a generic updateTrace escape hatch for per-call tags.

Test plan

  • tsc --noEmit clean
  • tsup build clean (cjs/esm/dts)
  • Verified consumer (traderclaw plugin) imports kayba.setSession / setUser / updateTrace and bundles cleanly via npm link
  • After merge: cut release v0.10.0-ts to trigger publish-to-npm workflow

Adds setSession, setUser, and updateTrace helpers so callers can group
multiple traces (e.g. one trace per tool call) into a single agent run
via mlflow.trace.session and mlflow.trace.user metadata.

Internal injectFolderTag renamed to injectKaybaContext and now emits
folder, session, and user in one updateCurrentTrace call.

Lockfile rewrite drops unused openai/dotenv that didn't match the
declared deps in package.json.
@davidfarah2003 davidfarah2003 merged commit 527ce05 into main Apr 25, 2026
3 checks passed
@davidfarah2003 davidfarah2003 deleted the feat/ts-sdk-session-user-0.10.0 branch April 25, 2026 20:56
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