feat(core)!: Remove enableTruncation flag and all AI integrations truncation logic - #23045
Draft
nicohrubec wants to merge 4 commits into
Draft
feat(core)!: Remove enableTruncation flag and all AI integrations truncation logic#23045nicohrubec wants to merge 4 commits into
enableTruncation flag and all AI integrations truncation logic#23045nicohrubec wants to merge 4 commits into
Conversation
Remove genai text truncation: - Removes the `enableTruncation` integration option and all gen_ai text-truncation logic (`messageTruncation.ts`); byte-limit cropping and "keep only the last message" are gone now that gen_ai spans always use the v2 span path. - Keeps inline media stripping and makes it unconditional, so this is now being applied to both transaction and span streaming paths. - All input messages are now recorded in full (media stripped), stripping is consolidated into `mediaStripping.ts`. - Covers both `@sentry/core` and `@sentry/server-utils`. - Removes truncation specific tests. Adds a new span streaming scenario because the span streaming path was so far only tested together with truncation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
size-limit report 📦
|
…-text-truncation-2 # Conflicts: # dev-packages/node-integration-tests/suites/tracing/anthropic/test.ts # dev-packages/node-integration-tests/suites/tracing/langchain/v1/test.ts # dev-packages/node-integration-tests/suites/tracing/openai/test.ts # packages/server-utils/src/ai/vercel-ai/utils.ts # packages/server-utils/src/vercel-ai/vercel-ai-dc-subscriber.ts
Media stripping was the last piece of gen_ai input processing left after truncation removal. Since gen_ai spans always use the v2 span path (not subject to transaction payload-size limits), full input messages — including inline media (base64 images, audio, files) — are now recorded verbatim. - Delete `mediaStripping.ts` and the `getGenAiMessagesJsonString` helper; call sites now use `stringify` from `@sentry/core` directly. - Collapse langchain's `normalizeContent` into `stringify` now that it no longer strips media. - Remove media-stripping unit tests and the anthropic/openai media scenarios; the node integration suites already assert the full output format. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
enableTruncation flag and gen_ai text truncationenableTruncation flag and all AI integrations truncation logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove genai text truncation:
enableTruncationintegration option and all gen_ai text-truncation logic (messageTruncation.ts); byte-limit cropping and "keep only the last message" are gone now that gen_ai spans always use the v2 span path.mediaStripping.ts.@sentry/coreand@sentry/server-utils.