Skip to content

Comments

feat(deepagents): add SDK version metadata to agent traces#209

Open
Hunter Lovell (hntrl) wants to merge 3 commits intomainfrom
hunter/trace-metadata
Open

feat(deepagents): add SDK version metadata to agent traces#209
Hunter Lovell (hntrl) wants to merge 3 commits intomainfrom
hunter/trace-metadata

Conversation

@hntrl
Copy link
Member

Summary

Add SDK version metadata to all agent runs created via createDeepAgent. Every trace sent to LangSmith now includes sdk: "deepagents-js" and sdk_version in the run metadata, making it easy to identify and filter deep agent runs.

Changes

  • libs/deepagents/src/agent.ts — Declare a __SDK_VERSION__ build-time constant and attach { sdk: "deepagents-js", sdk_version } to the .withConfig() metadata on the compiled agent.
  • libs/deepagents/tsdown.config.ts — Read the package version from package.json at build time and inject it via tsdown's define option, replacing __SDK_VERSION__ with the literal version string in the bundle.
  • libs/deepagents/vitest.config.ts — Mirror the same define so that __SDK_VERSION__ resolves during tests.

Comment on lines +7 to +10
const { version } = JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf-8"),
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const { version } = JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf-8"),
);

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.

2 participants