chore: remove langfuse integration - #1536
Conversation
Sourcebot no longer uses Langfuse, so drop the integration entirely: - Remove the `langfuse-vercel` `LangfuseExporter` registration from `instrumentation.ts`. This was the only consumer of `@vercel/otel`'s `registerOTel`, so `@vercel/otel` is dropped as well. - Remove the browser-side `LangfuseWeb` feedback score from `answerCard.tsx`, along with the now-unused `traceId` prop. `metadata.traceId` is still produced and consumed by the PostHog analytics paths. - Drop the `langfuseTraceId` key from the AI SDK `experimental_telemetry` metadata. The telemetry block itself is left in place, gated on `SOURCEBOT_TELEMETRY_PII_COLLECTION_ENABLED` as before. - Remove `LANGFUSE_SECRET_KEY`, `NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY`, and `NEXT_PUBLIC_LANGFUSE_BASE_URL` from the env schemas and the Dockerfile. Co-authored-by: Brendan Kellam <10233483+brendan-kellam@users.noreply.github.com>
|
Warning Review limit reached
Next review available in: 3 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
WalkthroughThe PR removes Langfuse from build configuration, environment schemas, dependencies, server instrumentation, agent telemetry, and chat feedback handling. Sentry request error handling remains configured. ChangesLangfuse integration removal
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG.md`:
- Around line 10-11: Complete the Langfuse removal by deleting the
NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY and NEXT_PUBLIC_LANGFUSE_BASE_URL Docker build
arguments and their corresponding repository variables from the cloud build
workflow. Keep the CHANGELOG removal entry only once the workflow no longer
references these configuration values.
- Around line 10-11: Update the Langfuse removal entry under “Removed” in
CHANGELOG.md to end with the current pull request link, using the required
[`#id`](https://github.com/sourcebot-dev/sourcebot/pull/<id>) format.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5b294857-d900-4f0f-9f1d-64538efe4b6d
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (9)
CHANGELOG.mdDockerfilepackages/shared/src/env.client.tspackages/shared/src/env.server.tspackages/web/package.jsonpackages/web/src/ee/features/chat/agent.tspackages/web/src/ee/features/chat/components/chatThread/answerCard.tsxpackages/web/src/ee/features/chat/components/chatThread/chatThreadListItem.tsxpackages/web/src/instrumentation.ts
💤 Files with no reviewable changes (7)
- packages/web/package.json
- packages/shared/src/env.client.ts
- packages/web/src/instrumentation.ts
- packages/web/src/ee/features/chat/agent.ts
- packages/web/src/ee/features/chat/components/chatThread/chatThreadListItem.tsx
- Dockerfile
- packages/shared/src/env.server.ts
| ### Removed | ||
| - Removed the Langfuse integration, along with the `langfuse` and `langfuse-vercel` dependencies and the `LANGFUSE_SECRET_KEY`, `NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY`, and `NEXT_PUBLIC_LANGFUSE_BASE_URL` environment variables. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Complete the Langfuse configuration cleanup before claiming removal.
.github/workflows/_build-cloud.yml:118-128 still passes NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY and NEXT_PUBLIC_LANGFUSE_BASE_URL as Docker build arguments. Remove those arguments and repository variables, or update this entry to state that the cleanup is incomplete.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@CHANGELOG.md` around lines 10 - 11, Complete the Langfuse removal by deleting
the NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY and NEXT_PUBLIC_LANGFUSE_BASE_URL Docker
build arguments and their corresponding repository variables from the cloud
build workflow. Keep the CHANGELOG removal entry only once the workflow no
longer references these configuration values.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add the pull request link to this entry.
The Unreleased changelog guidelines require each entry to end with the current pull request link in [ #id ](https://github.com/sourcebot-dev/sourcebot/pull/<id>) format.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@CHANGELOG.md` around lines 10 - 11, Update the Langfuse removal entry under
“Removed” in CHANGELOG.md to end with the current pull request link, using the
required [`#id`](https://github.com/sourcebot-dev/sourcebot/pull/<id>) format.
Source: Coding guidelines
There was a problem hiding this comment.
Claude finished @brendan-kellam's task in 1m 12s —— View job
CodeRabbit feedback
- Gather context / read CHANGELOG + workflow file
- Add PR link to the CHANGELOG entry — done in
0994e4d(pushed) - Remove Langfuse build args from
_build-cloud.yml— attempted, blocked by permissions (see below)
1. CHANGELOG PR link ✅
CHANGELOG.md:11 now ends with the required link:
... environment variables. [#1536](https://github.com/sourcebot-dev/sourcebot/pull/1536)
2. Langfuse build args in .github/workflows/_build-cloud.yml ⚠️
I made the edit locally and it applies cleanly, but the push was rejected:
! [remote rejected] refusing to allow a GitHub App to create or update workflow
`.github/workflows/_build-cloud.yml` without `workflows` permission
I'm unable to modify files in .github/workflows due to GitHub App permission restrictions. More detail in the FAQ.
The change needed is deleting lines 123-124:
NEXT_PUBLIC_SENTRY_BACKEND_DSN=${{ vars.NEXT_PUBLIC_SENTRY_BACKEND_DSN }}
- NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY=${{ vars.NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY }}
- NEXT_PUBLIC_LANGFUSE_BASE_URL=${{ vars.NEXT_PUBLIC_LANGFUSE_BASE_URL }}
SENTRY_ORG=${{ vars.SENTRY_ORG }}Plus deleting the matching NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY / NEXT_PUBLIC_LANGFUSE_BASE_URL repository variables in Settings → Actions → Variables.
I left the CHANGELOG entry as a plain removal statement rather than adding an "incomplete cleanup" caveat (CodeRabbit's alternative) — the two leftover build args are now unknown to the Dockerfile, so Docker only warns and the effective behavior is that Langfuse is fully removed. Once you delete those lines, no CHANGELOG edit is needed.
grep -r LANGFUSE over the repo confirms those two workflow lines are the only remaining references.
• Branch
There was a problem hiding this comment.
Skipped: comment is from another GitHub bot.
License Audit
Weak Copyleft Packages (informational)
Resolved Packages (17)
|
Co-authored-by: Brendan Kellam <10233483+brendan-kellam@users.noreply.github.com>
Sourcebot no longer uses Langfuse, so this removes the integration entirely.
Fixes #1453
Changes
packages/web/src/instrumentation.ts): removed thelangfuse-vercelLangfuseExporterregistration. This was the only consumer of@vercel/otel'sregisterOTel, so@vercel/otelis dropped as well.answerCard.tsx): removed theLangfuseWebclient and its.score(...)call, plus the now-unusedtraceIdprop and its pass-through inchatThreadListItem.tsx. PostHog feedback capture and thesubmitFeedbackserver action are unchanged.agent.ts): dropped thelangfuseTraceIdmetadata key. Theexperimental_telemetryblock itself is left in place, still gated onSOURCEBOT_TELEMETRY_PII_COLLECTION_ENABLED.LANGFUSE_SECRET_KEYfromenv.server.ts, andNEXT_PUBLIC_LANGFUSE_PUBLIC_KEY/NEXT_PUBLIC_LANGFUSE_BASE_URLfromenv.client.tsand theDockerfilebuild args.langfuse,langfuse-vercel, and@vercel/otelfrompackages/web/package.jsonand pruned the correspondingyarn.lockentries.metadata.traceIdon assistant messages is kept - it is still produced byagent.tsand consumed by the PostHog analytics paths (skillAnalytics,askMcpAnalytics).Follow-up required
.github/workflows/_build-cloud.ymlstill passesNEXT_PUBLIC_LANGFUSE_PUBLIC_KEYandNEXT_PUBLIC_LANGFUSE_BASE_URLas build args (lines 123-124). I cannot modify workflow files, so those two lines need to be removed manually (and the matching repo vars deleted). Docker only warns on unknown build args, so the build will not break in the meantime.yarn.lockwas hand-pruned (no network/yarn in this job) - worth confirming with a localyarn install.Generated with Claude Code
Note
Low Risk
Removal of unused third-party telemetry with no changes to auth, data handling, or core chat execution paths; Sentry and PostHog feedback paths remain.
Overview
Removes the Langfuse observability integration end-to-end now that Sourcebot no longer uses it.
Server startup no longer registers OpenTelemetry with
langfuse-vercelor@vercel/otel; Sentry instrumentation remains unchanged.Chat UI drops the browser
LangfuseWebclient and thumbs-up/down scoring tied to Langfuse traces. Feedback still goes throughsubmitFeedbackand PostHog (wa_chat_feedback_submitted).Ask agent still generates and stores
metadata.traceIdfor PostHog and other analytics, but AI SDK telemetry no longer passeslangfuseTraceIdinexperimental_telemetrymetadata (telemetry remains gated onSOURCEBOT_TELEMETRY_PII_COLLECTION_ENABLED).Configuration and build remove
LANGFUSE_SECRET_KEY,NEXT_PUBLIC_LANGFUSE_*from env schemas and Dockerfile build args. Dependencieslangfuse,langfuse-vercel, and@vercel/otelare removed from the web package and lockfile.CHANGELOG documents the removal under unreleased.
Reviewed by Cursor Bugbot for commit 3c66c74. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Bug Fixes
Chores