Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(experiments): raise conclusion comment limit to 4000 chars (#65251)

posthog[bot]e95579198535
diff --git a/frontend/src/scenes/experiments/ExperimentView/ExperimentModals.tsx b/frontend/src/scenes/experiments/ExperimentView/ExperimentModals.tsx
index 985cefbac123..c1f2c52a1c7b 100644
--- a/frontend/src/scenes/experiments/ExperimentView/ExperimentModals.tsx
+++ b/frontend/src/scenes/experiments/ExperimentView/ExperimentModals.tsx
@@ -62,7 +62,7 @@ function ConclusionForm(): JSX.Element {
<LemonTextArea
className="w-full border rounded p-2"
minRows={6}
- maxLength={400}
+ maxLength={4000}
placeholder="Optional details about why this conclusion was selected..."
value={experiment.conclusion_comment || ''}
onChange={(value) =>
diff --git a/products/experiments/backend/presentation/serializers.py b/products/experiments/backend/presentation/serializers.py
index d12fdfe3c462..890cb6fcd888 100644
--- a/products/experiments/backend/presentation/serializers.py
+++ b/products/experiments/backend/presentation/serializers.py
@@ -181,6 +181,7 @@ class ExperimentBaseSerializer(UserAccessControlSerializerMixin, serializers.Mod
required=False,
allow_null=True,
allow_blank=True,
+ max_length=4000,
help_text="Comment about the experiment conclusion.",
)
archived = serializers.BooleanField(
@@ -622,6 +623,7 @@ class EndExperimentSerializer(serializers.Serializer):
required=False,
allow_null=True,
allow_blank=True,
+ max_length=4000,
help_text="Optional comment about the experiment conclusion.",
)
diff --git a/products/experiments/frontend/generated/api.schemas.ts b/products/experiments/frontend/generated/api.schemas.ts
index b9000d763a41..24d32997f184 100644
--- a/products/experiments/frontend/generated/api.schemas.ts
+++ b/products/experiments/frontend/generated/api.schemas.ts
@@ -385,6 +385,7 @@ export interface ExperimentBasicApi {
conclusion?: ConclusionEnumApi | null
/**
* Comment about the experiment conclusion.
+ * @maxLength 4000
* @nullable
*/
conclusion_comment?: string | null
@@ -708,6 +709,7 @@ export interface ExperimentApi {
conclusion?: ConclusionEnumApi | null
/**
* Comment about the experiment conclusion.
+ * @maxLength 4000
* @nullable
*/
conclusion_comment?: string | null
@@ -808,6 +810,7 @@ export interface PatchedExperimentApi {
conclusion?: ConclusionEnumApi | null
/**
* Comment about the experiment conclusion.
+ * @maxLength 4000
* @nullable
*/
conclusion_comment?: string | null
@@ -852,6 +855,7 @@ export interface EndExperimentApi {
conclusion?: ConclusionEnumApi | null
/**
* Optional comment about the experiment conclusion.
+ * @maxLength 4000
* @nullable
*/
conclusion_comment?: string | null
@@ -1032,6 +1036,7 @@ export interface ShipVariantApi {
conclusion?: ConclusionEnumApi | null
/**
* Optional comment about the experiment conclusion.
+ * @maxLength 4000
* @nullable
*/
conclusion_comment?: string | null
diff --git a/products/experiments/frontend/generated/api.zod.ts b/products/experiments/frontend/generated/api.zod.ts
index 09922c78362e..f2371a955b59 100644
--- a/products/experiments/frontend/generated/api.zod.ts
+++ b/products/experiments/frontend/generated/api.zod.ts
@@ -213,6 +213,8 @@ export const ExperimentsDuplicateCreateBody = /* @__PURE__ */ zod
*
* Returns 400 if the experiment is not running.
*/
+export const experimentsEndCreateBodyConclusionCommentMax = 4000
+
export const ExperimentsEndCreateBody = /* @__PURE__ */ zod.object({
conclusion: zod
.union([
@@ -227,7 +229,11 @@ export const ExperimentsEndCreateBody = /* @__PURE__ */ zod.object({
.describe(
'The conclusion of the experiment.\n\n\* `won` - won\n\* `lost` - lost\n\* `inconclusive` - inconclusive\n\* `stopped_early` - stopped_early\n\* `invalid` - invalid'
),
- conclusion_comment: zod.string().nullish().describe('Optional comment about the experiment conclusion.'),
+ conclusion_comment: zod
+ .string()
+ .max(experimentsEndCreateBodyConclusionCommentMax)
+ .nullish()
+ .describe('Optional comment about the experiment conclusion.'),
})
/**
@@ -297,6 +303,8 @@ export const ExperimentsRecalculateTimeseriesCreateBody = /* @__PURE__ */ zod
* Returns 400 if the experiment is in draft state, the variant_key is not found
* on the flag, or the experiment has no linked feature flag.
*/
+export const experimentsShipVariantCreateBodyConclusionCommentMax = 4000
+
export const experimentsShipVariantCreateBodyReleaseToEveryoneDefault = false
export const ExperimentsShipVariantCreateBody = /* @__PURE__ */ zod.object({
@@ -313,7 +321,11 @@ export const ExperimentsShipVariantCreateBody = /* @__PURE__ */ zod.object({
.describe(
'The conclusion of the experiment.\n\n\* `won` - won\n\* `lost` - lost\n\* `inconclusive` - inconclusive\n\* `stopped_early` - stopped_early\n\* `invalid` - invalid'
),
- conclusion_comment: zod.string().nullish().describe('Optional comment about the experiment conclusion.'),
+ conclusion_comment: zod
+ .string()
+ .max(experimentsShipVariantCreateBodyConclusionCommentMax)
+ .nullish()
+ .describe('Optional comment about the experiment conclusion.'),
variant_key: zod.string().describe('The key of the variant to ship.'),
release_to_everyone: zod
.boolean()
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 38ff1e283532..72d07c6184eb 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -17876,6 +17876,7 @@ export namespace Schemas {
conclusion?: ConclusionEnum | null;
/**
* Optional comment about the experiment conclusion.
+ * @maxLength 4000
* @nullable
*/
conclusion_comment?: string | null;
@@ -20604,6 +20605,7 @@ export namespace Schemas {
conclusion?: ConclusionEnum | null;
/**
* Comment about the experiment conclusion.
+ * @maxLength 4000
* @nullable
*/
conclusion_comment?: string | null;
@@ -20688,6 +20690,7 @@ export namespace Schemas {
conclusion?: ConclusionEnum | null;
/**
* Comment about the experiment conclusion.
+ * @maxLength 4000
* @nullable
*/
conclusion_comment?: string | null;
@@ -35541,6 +35544,7 @@ export namespace Schemas {
conclusion?: ConclusionEnum | null;
/**
* Comment about the experiment conclusion.
+ * @maxLength 4000
* @nullable
*/
conclusion_comment?: string | null;
@@ -45641,6 +45645,7 @@ export namespace Schemas {
conclusion?: ConclusionEnum | null;
/**
* Optional comment about the experiment conclusion.
+ * @maxLength 4000
* @nullable
*/
conclusion_comment?: string | null;
diff --git a/services/mcp/src/generated/experiments/api.ts b/services/mcp/src/generated/experiments/api.ts
index 52da34702ffd..7f9f407cf051 100644
--- a/services/mcp/src/generated/experiments/api.ts
+++ b/services/mcp/src/generated/experiments/api.ts
@@ -237,6 +237,8 @@ export const experimentsCreateBodyMetricsSecondaryOneItemUpperBoundPercentileOne
export const experimentsCreateBodyMetricsSecondaryOneItemUpperBoundPercentileOneMax = 1
export const experimentsCreateBodyAllowUnknownEventsDefault = false
+export const experimentsCreateBodyConclusionCommentMax = 4000
+
export const experimentsCreateBodyUpdateFeatureFlagParamsDefault = false
export const ExperimentsCreateBody = /* @__PURE__ */ zod
@@ -2501,7 +2503,11 @@ export const ExperimentsCreateBody = /* @__PURE__ */ zod
.describe(
'Experiment conclusion: won, lost, inconclusive, stopped_early, or invalid.\n\n* `won` - won\n* `lost` - lost\n* `inconclusive` - inconclusive\n* `stopped_early` - stopped_early\n* `invalid` - invalid'
),
- conclusion_comment: zod.string().nullish().describe('Comment about the experiment conclusion.'),
+ conclusion_comment: zod
+ .string()
+ .max(experimentsCreateBodyConclusionCommentMax)
+ .nullish()
+ .describe('Comment about the experiment conclusion.'),
primary_metrics_ordered_uuids: zod.unknown().optional(),
secondary_metrics_ordered_uuids: zod.unknown().optional(),
only_count_matured_users: zod.boolean().optional(),
@@ -2608,6 +2614,8 @@ export const experimentsPartialUpdateBodyMetricsSecondaryOneItemStartEventOnePro
export const experimentsPartialUpdateBodyMetricsSecondaryOneItemUpperBoundPercentileOneMin = 0
export const experimentsPartialUpdateBodyMetricsSecondaryOneItemUpperBoundPercentileOneMax = 1
+export const experimentsPartialUpdateBodyConclusionCommentMax = 4000
+
export const ExperimentsPartialUpdateBody = /* @__PURE__ */ zod
.object({
name: zod.string().max(experimentsPartialUpdateBodyNameMax).optional().describe('Name of the experiment.'),
@@ -4876,7 +4884,11 @@ export const ExperimentsPartialUpdateBody = /* @__PURE__ */ zod
.describe(
'Experiment conclusion: won, lost, inconclusive, stopped_early, or invalid.\n\n* `won` - won\n* `lost` - lost\n* `inconclusive` - inconclusive\n* `stopped_early` - stopped_early\n* `invalid` - invalid'
),
- conclusion_comment: zod.string().nullish().describe('Comment about the experiment conclusion.'),
+ conclusion_comment: zod
+ .string()
+ .max(experimentsPartialUpdateBodyConclusionCommentMax)
+ .nullish()
+ .describe('Comment about the experiment conclusion.'),
primary_metrics_ordered_uuids: zod.unknown().optional(),
secondary_metrics_ordered_uuids: zod.unknown().optional(),
only_count_matured_users: zod.boolean().optional(),
@@ -5036,6 +5048,8 @@ export const experimentsDuplicateCreateBodyMetricsSecondaryOneItemUpperBoundPerc
export const experimentsDuplicateCreateBodyMetricsSecondaryOneItemUpperBoundPercentileOneMax = 1
export const experimentsDuplicateCreateBodyAllowUnknownEventsDefault = false
+export const experimentsDuplicateCreateBodyConclusionCommentMax = 4000
+
export const experimentsDuplicateCreateBodyUpdateFeatureFlagParamsDefault = false
export const ExperimentsDuplicateCreateBody = /* @__PURE__ */ zod
@@ -7308,7 +7322,11 @@ export const ExperimentsDuplicateCreateBody = /* @__PURE__ */ zod
.describe(
'Experiment conclusion: won, lost, inconclusive, stopped_early, or invalid.\n\n* `won` - won\n* `lost` - lost\n* `inconclusive` - inconclusive\n* `stopped_early` - stopped_early\n* `invalid` - invalid'
),
- conclusion_comment: zod.string().nullish().describe('Comment about the experiment conclusion.'),
+ conclusion_comment: zod
+ .string()
+ .max(experimentsDuplicateCreateBodyConclusionCommentMax)
+ .nullish()
+ .describe('Comment about the experiment conclusion.'),
primary_metrics_ordered_uuids: zod.unknown().optional(),
secondary_metrics_ordered_uuids: zod.unknown().optional(),
only_count_matured_users: zod.boolean().optional(),
@@ -7356,6 +7374,8 @@ export const ExperimentsEndCreateParams = /* @__PURE__ */ zod.object({
),
})
+export const experimentsEndCreateBodyConclusionCommentMax = 4000
+
export const ExperimentsEndCreateBody = /* @__PURE__ */ zod.object({
conclusion: zod
.union([
@@ -7370,7 +7390,11 @@ export const ExperimentsEndCreateBody = /* @__PURE__ */ zod.object({
.describe(
'The conclusion of the experiment.\n\n* `won` - won\n* `lost` - lost\n* `inconclusive` - inconclusive\n* `stopped_early` - stopped_early\n* `invalid` - invalid'
),
- conclusion_comment: zod.string().nullish().describe('Optional comment about the experiment conclusion.'),
+ conclusion_comment: zod
+ .string()
+ .max(experimentsEndCreateBodyConclusionCommentMax)
+ .nullish()
+ .describe('Optional comment about the experiment conclusion.'),
})
/**
@@ -7476,6 +7500,8 @@ export const ExperimentsShipVariantCreateParams = /* @__PURE__ */ zod.object({
),
})
+export const experimentsShipVariantCreateBodyConclusionCommentMax = 4000
+
export const experimentsShipVariantCreateBodyReleaseToEveryoneDefault = false
export const ExperimentsShipVariantCreateBody = /* @__PURE__ */ zod.object({
@@ -7492,7 +7518,11 @@ export const ExperimentsShipVariantCreateBody = /* @__PURE__ */ zod.object({
.describe(
'The conclusion of the experiment.\n\n* `won` - won\n* `lost` - lost\n* `inconclusive` - inconclusive\n* `stopped_early` - stopped_early\n* `invalid` - invalid'
),
- conclusion_comment: zod.string().nullish().describe('Optional comment about the experiment conclusion.'),
+ conclusion_comment: zod
+ .string()
+ .max(experimentsShipVariantCreateBodyConclusionCommentMax)
+ .nullish()
+ .describe('Optional comment about the experiment conclusion.'),
variant_key: zod.string().describe('The key of the variant to ship.'),
release_to_everyone: zod
.boolean()
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-duplicate.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-duplicate.json
index 744956b00bac..eb93b81216ed 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-duplicate.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-duplicate.json
@@ -27,6 +27,7 @@
"conclusion_comment": {
"anyOf": [
{
+ "maxLength": 4000,
"type": "string"
},
{
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-end.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-end.json
index 4f1268024da8..cb78afd51c60 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-end.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-end.json
@@ -17,6 +17,7 @@
"conclusion_comment": {
"anyOf": [
{
+ "maxLength": 4000,
"type": "string"
},
{
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-ship-variant.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-ship-variant.json
index c1f6059c5ec6..9d4c5196b515 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-ship-variant.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-ship-variant.json
@@ -17,6 +17,7 @@
"conclusion_comment": {
"anyOf": [
{
+ "maxLength": 4000,
"type": "string"
},
{
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-update.json
index fd6579fa7f38..3226da00fa50 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-update.json
@@ -25,6 +25,7 @@
"conclusion_comment": {
"anyOf": [
{
+ "maxLength": 4000,
"type": "string"
},
{