🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
fix(comments): dont expose inline data path on public api yet (#11415)
Nimardba9fe80d199
diff --git a/fern/apis/server/definition/comments.yml b/fern/apis/server/definition/comments.ymlindex b4c4fec019..e9baaa7dbe 100644--- a/fern/apis/server/definition/comments.yml+++ b/fern/apis/server/definition/comments.yml@@ -62,18 +62,6 @@ types:authorUserId:type: optional<string>docs: The id of the user who created the comment.- dataField:- type: optional<string>- docs: For inline comments on IO, specifies which field (input, output, or metadata). Must be set together with path, rangeStart, and rangeEnd.- path:- type: optional<list<string>>- docs: JSON Path expressions specifying comment location within the dataField. Must have same length as rangeStart and rangeEnd.- rangeStart:- type: optional<list<integer>>- docs: Start character offsets (inclusive, UTF-16 code units) for each path entry.- rangeEnd:- type: optional<list<integer>>- docs: End character offsets (exclusive, UTF-16 code units) for each path entry.CreateCommentResponse:properties:id:diff --git a/fern/apis/server/definition/commons.yml b/fern/apis/server/definition/commons.ymlindex 03ac97424e..2fdcdef75b 100644--- a/fern/apis/server/definition/commons.yml+++ b/fern/apis/server/definition/commons.yml@@ -377,18 +377,6 @@ types:objectId: stringcontent: stringauthorUserId: optional<string>- dataField:- type: optional<string>- docs: For inline comments, the IO field (input, output, metadata)- path:- type: optional<list<string>>- docs: JSON Path expressions for comment location- rangeStart:- type: optional<list<integer>>- docs: Start character offsets (inclusive, UTF-16)- rangeEnd:- type: optional<list<integer>>- docs: End character offsets (exclusive, UTF-16)Dataset:properties:diff --git a/web/public/generated/api/openapi.yml b/web/public/generated/api/openapi.ymlindex 83ef6e28d2..e4c4f46ea0 100644--- a/web/public/generated/api/openapi.yml+++ b/web/public/generated/api/openapi.yml@@ -6362,36 +6362,6 @@ components:type: stringnullable: truedescription: The id of the user who created the comment.- dataField:- type: string- nullable: true- description: >-- For inline comments on IO, specifies which field (input, output, or- metadata). Must be set together with path, rangeStart, and rangeEnd.- path:- type: array- items:- type: string- nullable: true- description: >-- JSON Path expressions specifying comment location within the- dataField. Must have same length as rangeStart and rangeEnd.- rangeStart:- type: array- items:- type: integer- nullable: true- description: >-- Start character offsets (inclusive, UTF-16 code units) for each path- entry.- rangeEnd:- type: array- items:- type: integer- nullable: true- description: >-- End character offsets (exclusive, UTF-16 code units) for each path- entry.required:- projectId- objectType@@ -7185,28 +7155,6 @@ components:authorUserId:type: stringnullable: true- dataField:- type: string- nullable: true- description: For inline comments, the IO field (input, output, metadata)- path:- type: array- items:- type: string- nullable: true- description: JSON Path expressions for comment location- rangeStart:- type: array- items:- type: integer- nullable: true- description: Start character offsets (inclusive, UTF-16)- rangeEnd:- type: array- items:- type: integer- nullable: true- description: End character offsets (exclusive, UTF-16)required:- id- projectIddiff --git a/web/public/generated/postman/collection.json b/web/public/generated/postman/collection.jsonindex 1050ae0a28..9cdd110faf 100644--- a/web/public/generated/postman/collection.json+++ b/web/public/generated/postman/collection.json@@ -570,7 +570,7 @@"auth": null,"body": {"mode": "raw",- "raw": "{\n \"projectId\": \"example\",\n \"objectType\": \"example\",\n \"objectId\": \"example\",\n \"content\": \"example\",\n \"authorUserId\": \"example\",\n \"dataField\": \"example\",\n \"path\": [\n \"example\"\n ],\n \"rangeStart\": [\n 0\n ],\n \"rangeEnd\": [\n 0\n ]\n}",+ "raw": "{\n \"projectId\": \"example\",\n \"objectType\": \"example\",\n \"objectId\": \"example\",\n \"content\": \"example\",\n \"authorUserId\": \"example\"\n}","options": {"raw": {"language": "json"diff --git a/web/src/features/public-api/types/comments.ts b/web/src/features/public-api/types/comments.tsindex 831c3a80b8..ceaa682712 100644--- a/web/src/features/public-api/types/comments.ts+++ b/web/src/features/public-api/types/comments.ts@@ -3,7 +3,6 @@ import {CreateCommentData,paginationMetaResponseZod,publicApiPaginationZod,- COMMENT_DATA_FIELDS,} from "@langfuse/shared";import { z } from "zod/v4";@@ -21,10 +20,6 @@ const APIComment = zobjectId: z.string(),content: z.string().min(1).max(5000),authorUserId: z.string().nullish(),- dataField: z.enum(COMMENT_DATA_FIELDS).nullish(),- path: z.array(z.string()).nullish(),- rangeStart: z.array(z.number()).nullish(),- rangeEnd: z.array(z.number()).nullish(),}).strict();@@ -33,10 +28,17 @@ const APIComment = z*/// POST /comments-// Note: Public API does not process mentions-export const PostCommentsV1Body = CreateCommentData.extend({- authorUserId: z.string().nullish(),-}).strict();+// Note: Public API does not process mentions or inline comment positioning+export const PostCommentsV1Body = CreateCommentData.omit({+ dataField: true,+ path: true,+ rangeStart: true,+ rangeEnd: true,+})+ .extend({+ authorUserId: z.string().nullish(),+ })+ .strict();export const PostCommentsV1Response = z.object({ id: z.string() }).strict();// GET /commentsdiff --git a/web/src/pages/api/public/comments/[commentId].ts b/web/src/pages/api/public/comments/[commentId].tsindex a6a81f3d42..7c3bf7d899 100644--- a/web/src/pages/api/public/comments/[commentId].ts+++ b/web/src/pages/api/public/comments/[commentId].ts@@ -1,10 +1,7 @@import { prisma } from "@langfuse/shared/src/db";import { withMiddlewares } from "@/src/features/public-api/server/withMiddlewares";import { createAuthedProjectAPIRoute } from "@/src/features/public-api/server/createAuthedProjectAPIRoute";-import {- LangfuseNotFoundError,- type COMMENT_DATA_FIELDS,-} from "@langfuse/shared";+import { LangfuseNotFoundError } from "@langfuse/shared";import {GetCommentV1Query,GetCommentV1Response,@@ -31,13 +28,10 @@ export default withMiddlewares({);}- // cast dataField to expected enum type, Prisma just returns string | null- return {- ...comment,- dataField: comment.dataField as- | (typeof COMMENT_DATA_FIELDS)[number]- | null,- };+ // Exclude inline positioning fields from public API+ const { dataField, path, rangeStart, rangeEnd, ...publicComment } =+ comment;+ return publicComment;},}),});diff --git a/web/src/pages/api/public/comments/index.ts b/web/src/pages/api/public/comments/index.tsindex 473e20aad1..60fe34d130 100644--- a/web/src/pages/api/public/comments/index.ts+++ b/web/src/pages/api/public/comments/index.ts@@ -9,10 +9,7 @@ import {import { prisma } from "@langfuse/shared/src/db";import { v4 } from "uuid";import { validateCommentReferenceObject } from "@/src/features/comments/validateCommentReferenceObject";-import {- LangfuseNotFoundError,- type COMMENT_DATA_FIELDS,-} from "@langfuse/shared";+import { LangfuseNotFoundError } from "@langfuse/shared";import { auditLog } from "@/src/features/audit-logs/auditLog";export default withMiddlewares({@@ -33,7 +30,7 @@ export default withMiddlewares({throw new LangfuseNotFoundError(result.errorMessage);}- // Create comment with content as-is (no mention processing)+ // Create comment with content as-is (no mention processing, no inline positioning)const comment = await prisma.comment.create({data: {content: body.content,@@ -42,10 +39,6 @@ export default withMiddlewares({authorUserId: body.authorUserId,id: v4(),projectId: auth.scope.projectId,- dataField: body.dataField ?? null,- path: body.path ?? [],- rangeStart: body.rangeStart ?? [],- rangeEnd: body.rangeEnd ?? [],},});@@ -90,13 +83,10 @@ export default withMiddlewares({});return {- data: comments.map((comment) => ({- ...comment,- // cast dataField to expected enum type, Prisma just returns string | null- dataField: comment.dataField as- | (typeof COMMENT_DATA_FIELDS)[number]- | null,- })),+ data: comments.map(+ // Exclude inline positioning fields from public API+ ({ dataField, path, rangeStart, rangeEnd, ...rest }) => rest,+ ),meta: {page: query.page,limit: query.limit,