Skip to content

Commit e541815

Browse files
nicohrubecclaude
andcommitted
feat(core)!: Remove enableTruncation flag and gen_ai text truncation
Removes the `enableTruncation` integration option and the gen_ai message text-truncation machinery. Now that gen_ai spans always ride the v2 span path (far larger size limits than legacy transactions), the byte-limit cropping and "keep only the last message" reduction is dead weight. Inline media stripping is kept and is now unconditional: previously media was only stripped on the truncation path, so with truncation off inline base64 could leak into span attributes for openai/anthropic/google-genai/ vercel-ai/workers-ai. `getGenAiMessagesJsonString` now always strips media before serializing, keeping all messages. Media-stripping logic is consolidated into `mediaStripping.ts`; `messageTruncation.ts` is deleted. Truncation-specific test scenarios and instruments are removed; image-stripping tests are re-pointed at the default recording instruments, and full span-streaming coverage is kept via non-truncation streaming tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4fa02f8 commit e541815

74 files changed

Lines changed: 315 additions & 3131 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dev-packages/node-integration-tests/suites/tracing/anthropic/instrument-no-truncation.mjs

Lines changed: 0 additions & 24 deletions
This file was deleted.

dev-packages/node-integration-tests/suites/tracing/anthropic/instrument-streaming-with-truncation.mjs

Lines changed: 0 additions & 16 deletions
This file was deleted.

dev-packages/node-integration-tests/suites/tracing/anthropic/instrument-with-truncation.mjs

Lines changed: 0 additions & 18 deletions
This file was deleted.

dev-packages/node-integration-tests/suites/tracing/anthropic/scenario-media-truncation.mjs renamed to dev-packages/node-integration-tests/suites/tracing/anthropic/scenario-media-stripping.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ async function run() {
3636
});
3737

3838
// Send the image showing the number 3
39-
// Put the image in the last message so it doesn't get dropped
4039
await client.messages.create({
4140
model: 'claude-3-haiku-20240307',
4241
max_tokens: 1024,

dev-packages/node-integration-tests/suites/tracing/anthropic/scenario-message-truncation.mjs

Lines changed: 0 additions & 75 deletions
This file was deleted.

dev-packages/node-integration-tests/suites/tracing/anthropic/scenario-no-truncation.mjs

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)