Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/langfuse/trace-proxy-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export async function traceProxyRequest(ctx: TraceContext): Promise<void> {
);

// Explicitly set trace-level input/output (propagateAttributes does not support these)
rootSpan.updateTrace({
rootSpan.setTraceIO({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the Langfuse test mock for setTraceIO

In the unit-test environment, mockRootSpan in tests/unit/langfuse/langfuse-trace.test.ts still only defines updateTrace and the assertions still expect that method. After this call switches to setTraceIO, every successful trace path hits TypeError: rootSpan.setTraceIO is not a function, which is swallowed by the catch block before rootSpan.end() runs, so the Langfuse trace tests now fail instead of validating trace IO. Please update the test mock and expectations alongside this SDK method rename.

Useful? React with 👍 / 👎.

input: actualRequestBody,
output: actualResponseBody,
});
Comment on lines +411 to 414

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 setTraceIO is deprecated in the v5 SDK

The Langfuse JS/TS v5 migration guide marks setTraceIO() as deprecated — it exists only for backward compatibility with legacy trace-level LLM-as-a-judge evaluators. The project already declares @langfuse/tracing@^5. The recommended v5 approach is to set input/output directly on the root observation instead of calling setTraceIO on the span. While this fix unblocks the TypeScript build, it lands on a deprecated code path that may be removed in a future SDK minor or major.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/lib/langfuse/trace-proxy-request.ts
Line: 411-414

Comment:
**`setTraceIO` is deprecated in the v5 SDK**

The Langfuse JS/TS v5 migration guide marks `setTraceIO()` as deprecated — it exists only for backward compatibility with legacy trace-level LLM-as-a-judge evaluators. The project already declares `@langfuse/tracing@^5`. The recommended v5 approach is to set `input`/`output` directly on the root observation instead of calling `setTraceIO` on the span. While this fix unblocks the TypeScript build, it lands on a deprecated code path that may be removed in a future SDK minor or major.

How can I resolve this? If you propose a fix, please make it concise.

Expand Down