Skip to content

chore: add @posthog/ai sdk test scripts with opt-in local-sdk linking - #57

Merged
carlos-marchal-ph merged 1 commit into
mainfrom
chore(aiobs)/adapt-tooling-optional-peer-deps
Jun 8, 2026
Merged

chore: add @posthog/ai sdk test scripts with opt-in local-sdk linking#57
carlos-marchal-ph merged 1 commit into
mainfrom
chore(aiobs)/adapt-tooling-optional-peer-deps

Conversation

@carlos-marchal-ph

Copy link
Copy Markdown
Contributor

Summary

Prepares the tools and adds Node test scripts that exercise the @posthog/ai surface relevant to posthog-js#3739 (provider SDKs becoming optional peer dependencies, OTel exporters requiring projectToken)

Testing

Ran both scripts live against a local PostHog (:8010) on both the published SDK and a linked local build: OpenAI + Anthropic subpath clients returned real responses, captureAiGeneration fired, and the OTel scenarios exported via PostHogSpanProcessor. Confirmed ingestion by querying the instance — $ai_generation + $ai_trace events landed. Scripts typecheck clean under tsc --strict.

🤖 Agent context

Generated with Claude Code while validating posthog-js#3739. Initially the scripts were hard-linked to a sibling ../posthog-js; reworked so the default is the published SDK (works without a checkout) and linking is opt-in and path-agnostic. The published @posthog/ai@7.20.14 already exposes the subpaths and accepts projectToken, so the scripts are compatible with both it and the unreleased major. The OTel script's pre-existing maxSteps usage (invalid under ai@6) was left untouched as out of scope.

@carlos-marchal-ph
carlos-marchal-ph requested a review from a team June 8, 2026 11:36
@carlos-marchal-ph
carlos-marchal-ph merged commit 1557049 into main Jun 8, 2026
11 checks passed
@carlos-marchal-ph
carlos-marchal-ph deleted the chore(aiobs)/adapt-tooling-optional-peer-deps branch June 8, 2026 17:07
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