Skip to content

ENG-3027 Scrub OpenCode AI SDK payloads before Langfuse export#2

Closed
zigelboim-misha wants to merge 2 commits into
mainfrom
ENG-3027-scrub-ai-sdk-langfuse-payloads
Closed

ENG-3027 Scrub OpenCode AI SDK payloads before Langfuse export#2
zigelboim-misha wants to merge 2 commits into
mainfrom
ENG-3027-scrub-ai-sdk-langfuse-payloads

Conversation

@zigelboim-misha

@zigelboim-misha zigelboim-misha commented May 15, 2026

Copy link
Copy Markdown

Summary

  • Add a span processor wrapper around LangfuseSpanProcessor that strips OpenCode/Vercel AI SDK prompt and response payload attributes before export.
  • Preserve model, usage, timing, finish reason, and gen_ai attributes so cost and performance analytics still work.
  • Add a focused test proving payload attributes are removed and usage/model attributes remain.

Duplicated Data Addressed

OpenCode's AI SDK spans were exporting these large payload attributes into Langfuse:

  • ai.prompt
  • ai.prompt.messages
  • ai.prompt.tools
  • ai.prompt.toolChoice
  • ai.response.text
  • ai.response.toolCalls
  • ai.response.object

These duplicate snakur/OpenCode request and response content and were a major contributor to Langfuse ClickHouse/MinIO growth.

Related PRs

Verification

  • bun test
  • bun run typecheck
  • bun run lint
  • bun run format:check

Linear: https://linear.app/dalton-ai/issue/ENG-3027

@zigelboim-misha

Copy link
Copy Markdown
Author

Closing per scope change: we are not changing the Langfuse plugin for ENG-3027. The active fix will be limited to snakur-2 wrapper payload capture.

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