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(aio): accept an empty target_config in evaluation tool schemas (#117098)

Bernat Torres298ea7579be0
diff --git a/products/ai_observability/backend/api/evaluations.py b/products/ai_observability/backend/api/evaluations.py
index 9f4aeed7bedb..239a58d0c8f7 100644
--- a/products/ai_observability/backend/api/evaluations.py
+++ b/products/ai_observability/backend/api/evaluations.py
@@ -259,75 +259,62 @@ class _OutputConfigField(serializers.DictField):
child = serializers.JSONField(allow_null=True)
+# One object rather than a `oneOf` per strategy: a generated zod union strips the keys a branch does not
+# declare, so a payload that matches the wrong branch loses its settings, and the empty config of a
+# generation target matches no branch. `validate_target_config` checks the per-strategy combination.
@extend_schema_field(
{
- "oneOf": [
- {
- "type": "object",
- "title": "Fixed window settle config",
- "required": ["strategy"],
- "properties": {
- "strategy": {
- "type": "string",
- "enum": ["fixed_window"],
- "description": "Wait a fixed window after the first matching generation, then evaluate.",
- },
- "window_seconds": {
- "type": "integer",
- "description": (
- "Seconds to wait after the first matching generation before evaluating the whole "
- "unit. Captured when the run is scheduled — editing it does not change runs "
- "already in flight. The accepted range depends on `target`: "
- f"{TRACE_EVAL_MIN_WINDOW_SECONDS}–{TRACE_EVAL_MAX_WINDOW_SECONDS} for 'trace', "
- f"{SESSION_EVAL_MIN_WINDOW_SECONDS}–{SESSION_EVAL_MAX_WINDOW_SECONDS} for 'session'. "
- "The default also depends on `target`; see the field-level help_text."
- ),
- "minimum": min(TRACE_EVAL_MIN_WINDOW_SECONDS, SESSION_EVAL_MIN_WINDOW_SECONDS),
- "maximum": max(TRACE_EVAL_MAX_WINDOW_SECONDS, SESSION_EVAL_MAX_WINDOW_SECONDS),
- },
- },
- "additionalProperties": False,
+ "type": "object",
+ "title": "Settle config",
+ "properties": {
+ "strategy": {
+ "type": "string",
+ "enum": ["fixed_window", "inactivity"],
+ "description": (
+ "'fixed_window' waits a fixed window after the first matching generation, then evaluates. "
+ "'inactivity' evaluates once the unit has had no new activity for the quiet period. "
+ "Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'."
+ ),
},
- {
- "type": "object",
- "title": "Inactivity settle config",
- "required": ["strategy"],
- "properties": {
- "strategy": {
- "type": "string",
- "enum": ["inactivity"],
- "description": "Evaluate once the unit has had no new activity for the quiet period.",
- },
- "quiet_period_seconds": {
- "type": "integer",
- "description": (
- "Seconds without new activity before the unit counts as settled. The accepted "
- f"range depends on `target`: {TRACE_EVAL_MIN_QUIET_PERIOD_SECONDS}–"
- f"{TRACE_EVAL_MAX_QUIET_PERIOD_SECONDS} for 'trace', "
- f"{SESSION_EVAL_MIN_QUIET_PERIOD_SECONDS}–{SESSION_EVAL_MAX_QUIET_PERIOD_SECONDS} "
- "for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- "minimum": min(TRACE_EVAL_MIN_QUIET_PERIOD_SECONDS, SESSION_EVAL_MIN_QUIET_PERIOD_SECONDS),
- "maximum": max(TRACE_EVAL_MAX_QUIET_PERIOD_SECONDS, SESSION_EVAL_MAX_QUIET_PERIOD_SECONDS),
- },
- "max_age_seconds": {
- "type": "integer",
- "description": (
- "Hard cap in seconds on the total wait from the first matching generation, even "
- "if the unit stays active. Must be at least quiet_period_seconds. The accepted "
- f"range depends on `target`: {TRACE_EVAL_MIN_MAX_AGE_SECONDS}–"
- f"{TRACE_EVAL_MAX_MAX_AGE_SECONDS} for 'trace', "
- f"{SESSION_EVAL_MIN_MAX_AGE_SECONDS}–{SESSION_EVAL_MAX_MAX_AGE_SECONDS} for 'session'. "
- "The default also depends on `target`; see the field-level help_text."
- ),
- "minimum": min(TRACE_EVAL_MIN_MAX_AGE_SECONDS, SESSION_EVAL_MIN_MAX_AGE_SECONDS),
- "maximum": max(TRACE_EVAL_MAX_MAX_AGE_SECONDS, SESSION_EVAL_MAX_MAX_AGE_SECONDS),
- },
- },
- "additionalProperties": False,
+ "window_seconds": {
+ "type": "integer",
+ "description": (
+ "fixed_window only. Seconds to wait after the first matching generation before evaluating "
+ "the whole unit. Captured when the run is scheduled — editing it does not change runs "
+ "already in flight. The accepted range depends on `target`: "
+ f"{TRACE_EVAL_MIN_WINDOW_SECONDS}–{TRACE_EVAL_MAX_WINDOW_SECONDS} for 'trace', "
+ f"{SESSION_EVAL_MIN_WINDOW_SECONDS}–{SESSION_EVAL_MAX_WINDOW_SECONDS} for 'session'. "
+ "The default also depends on `target`; see the field-level help_text."
+ ),
+ "minimum": min(TRACE_EVAL_MIN_WINDOW_SECONDS, SESSION_EVAL_MIN_WINDOW_SECONDS),
+ "maximum": max(TRACE_EVAL_MAX_WINDOW_SECONDS, SESSION_EVAL_MAX_WINDOW_SECONDS),
+ },
+ "quiet_period_seconds": {
+ "type": "integer",
+ "description": (
+ "inactivity only. Seconds without new activity before the unit counts as settled. The "
+ f"accepted range depends on `target`: {TRACE_EVAL_MIN_QUIET_PERIOD_SECONDS}–"
+ f"{TRACE_EVAL_MAX_QUIET_PERIOD_SECONDS} for 'trace', "
+ f"{SESSION_EVAL_MIN_QUIET_PERIOD_SECONDS}–{SESSION_EVAL_MAX_QUIET_PERIOD_SECONDS} "
+ "for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ "minimum": min(TRACE_EVAL_MIN_QUIET_PERIOD_SECONDS, SESSION_EVAL_MIN_QUIET_PERIOD_SECONDS),
+ "maximum": max(TRACE_EVAL_MAX_QUIET_PERIOD_SECONDS, SESSION_EVAL_MAX_QUIET_PERIOD_SECONDS),
},
- ],
- "discriminator": {"propertyName": "strategy"},
+ "max_age_seconds": {
+ "type": "integer",
+ "description": (
+ "inactivity only. Hard cap in seconds on the total wait from the first matching generation, "
+ "even if the unit stays active. Must be at least quiet_period_seconds. The accepted range "
+ f"depends on `target`: {TRACE_EVAL_MIN_MAX_AGE_SECONDS}–{TRACE_EVAL_MAX_MAX_AGE_SECONDS} "
+ f"for 'trace', {SESSION_EVAL_MIN_MAX_AGE_SECONDS}–{SESSION_EVAL_MAX_MAX_AGE_SECONDS} for "
+ "'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ "minimum": min(TRACE_EVAL_MIN_MAX_AGE_SECONDS, SESSION_EVAL_MIN_MAX_AGE_SECONDS),
+ "maximum": max(TRACE_EVAL_MAX_MAX_AGE_SECONDS, SESSION_EVAL_MAX_MAX_AGE_SECONDS),
+ },
+ },
+ "additionalProperties": False,
}
)
class _TargetConfigField(serializers.JSONField):
@@ -444,11 +431,10 @@ class EvaluationSerializer(UserAccessControlSerializerMixin, serializers.ModelSe
target_config = _TargetConfigField(
required=False,
help_text=(
- "Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on "
- "`strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, "
- "max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, "
- "using per-target defaults, and the accepted bounds also depend on `target`. "
- "Empty for 'generation'."
+ "Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a "
+ "settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, "
+ "max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other "
+ "field you omit, using per-target defaults, and the accepted bounds also depend on `target`."
),
)
conditions = EvaluationConditionSerializer(
diff --git a/products/ai_observability/backend/api/test/test_evaluations.py b/products/ai_observability/backend/api/test/test_evaluations.py
index c073dfee5375..d196324b347c 100644
--- a/products/ai_observability/backend/api/test/test_evaluations.py
+++ b/products/ai_observability/backend/api/test/test_evaluations.py
@@ -389,27 +389,21 @@ class TestModelConfigurationSerializer(SimpleTestCase):
class TestTargetConfigFieldSchema(SimpleTestCase):
- def test_every_oneof_branch_requires_the_discriminator(self) -> None:
- """Orval only emits a discriminated zod union (one that picks a branch by `strategy` alone,
- without matching optional fields against it) when every `oneOf` branch requires `strategy`.
- A branch missing it lets Orval fall through to a plain `zod.union`, which previously let a
- session payload sending only `{"strategy": "inactivity"}` match the fixed_window branch and
- silently drop the inactivity fields.
- """
+ def test_schema_is_one_object_with_an_optional_strategy(self) -> None:
schema = get_override(_TargetConfigField(), "field")
- for branch in schema["oneOf"]:
- self.assertIn("strategy", branch.get("required", []), branch["title"])
+ self.assertNotIn("oneOf", schema)
+ self.assertNotIn("strategy", schema.get("required", []))
+ self.assertEqual(schema["properties"]["strategy"]["enum"], ["fixed_window", "inactivity"])
- def test_no_branch_declares_a_default_for_a_shared_field(self) -> None:
+ def test_no_field_declares_a_default(self) -> None:
"""window_seconds/quiet_period_seconds/max_age_seconds have no single correct default: it
depends on `target`, which lives outside this schema. A `default` here would regenerate as
a zod `.default(...)` that materializes the wrong target's value before the request ever
reaches `validate_target_config`, which is exactly how session evals got trace timings.
"""
schema = get_override(_TargetConfigField(), "field")
- for branch in schema["oneOf"]:
- for field_name, field_schema in branch["properties"].items():
- self.assertNotIn("default", field_schema, f"{branch['title']}.{field_name}")
+ for field_name, field_schema in schema["properties"].items():
+ self.assertNotIn("default", field_schema, field_name)
class TestEvaluationConfigsApi(APIBaseTest):
diff --git a/products/ai_observability/frontend/generated/api.schemas.ts b/products/ai_observability/frontend/generated/api.schemas.ts
index df8016f738a3..c117d38da1bb 100644
--- a/products/ai_observability/frontend/generated/api.schemas.ts
+++ b/products/ai_observability/frontend/generated/api.schemas.ts
@@ -1912,6 +1912,17 @@ export const EvaluationTargetEnumApi = {
Session: 'session',
} as const
+/**
+ * 'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'.
+ */
+export type EvaluationApiTargetConfigStrategy =
+ (typeof EvaluationApiTargetConfigStrategy)[keyof typeof EvaluationApiTargetConfigStrategy]
+
+export const EvaluationApiTargetConfigStrategy = {
+ FixedWindow: 'fixed_window',
+ Inactivity: 'inactivity',
+} as const
+
/**
* * `openai` - Openai
* * `anthropic` - Anthropic
@@ -2055,35 +2066,30 @@ export type EvaluationApiOutputConfig = {
}
/**
- * Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'.
+ * Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`.
*/
-export type EvaluationApiTargetConfig =
- | {
- /** Wait a fixed window after the first matching generation, then evaluate. */
- strategy: 'fixed_window'
- /**
- * Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
- * @minimum 10
- * @maximum 604800
- */
- window_seconds?: number
- }
- | {
- /** Evaluate once the unit has had no new activity for the quiet period. */
- strategy: 'inactivity'
- /**
- * Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.
- * @minimum 10
- * @maximum 86400
- */
- quiet_period_seconds?: number
- /**
- * Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
- * @minimum 60
- * @maximum 604800
- */
- max_age_seconds?: number
- }
+export type EvaluationApiTargetConfig = {
+ /** 'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'. */
+ strategy?: EvaluationApiTargetConfigStrategy
+ /**
+ * fixed_window only. Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
+ * @minimum 10
+ * @maximum 604800
+ */
+ window_seconds?: number
+ /**
+ * inactivity only. Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.
+ * @minimum 10
+ * @maximum 86400
+ */
+ quiet_period_seconds?: number
+ /**
+ * inactivity only. Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
+ * @minimum 60
+ * @maximum 604800
+ */
+ max_age_seconds?: number
+}
/**
* An evaluation that scores LLM generations, traces, or sessions.
@@ -2136,7 +2142,7 @@ export interface EvaluationApi {
* * `trace` - Trace
* * `session` - Session */
target?: EvaluationTargetEnumApi
- /** Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'. */
+ /** Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. */
target_config?: EvaluationApiTargetConfig
/** Provider and model for an llm_judge evaluation. Required when creating or switching to llm_judge. To add or replace a model, provide both provider and model. On an existing configured llm_judge, omit this field to keep the current model; null is rejected. When switching an llm_judge to hog or sentiment, set this field to null. Legacy llm_judge evaluations without a model remain editable without adding one. The nested provider_key_id may be null. */
model_configuration?: ModelConfigurationApi | null
@@ -2381,35 +2387,41 @@ export type PatchedEvaluationApiOutputConfig = {
}
/**
- * Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'.
+ * 'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'.
*/
-export type PatchedEvaluationApiTargetConfig =
- | {
- /** Wait a fixed window after the first matching generation, then evaluate. */
- strategy: 'fixed_window'
- /**
- * Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
- * @minimum 10
- * @maximum 604800
- */
- window_seconds?: number
- }
- | {
- /** Evaluate once the unit has had no new activity for the quiet period. */
- strategy: 'inactivity'
- /**
- * Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.
- * @minimum 10
- * @maximum 86400
- */
- quiet_period_seconds?: number
- /**
- * Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
- * @minimum 60
- * @maximum 604800
- */
- max_age_seconds?: number
- }
+export type PatchedEvaluationApiTargetConfigStrategy =
+ (typeof PatchedEvaluationApiTargetConfigStrategy)[keyof typeof PatchedEvaluationApiTargetConfigStrategy]
+
+export const PatchedEvaluationApiTargetConfigStrategy = {
+ FixedWindow: 'fixed_window',
+ Inactivity: 'inactivity',
+} as const
+
+/**
+ * Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`.
+ */
+export type PatchedEvaluationApiTargetConfig = {
+ /** 'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'. */
+ strategy?: PatchedEvaluationApiTargetConfigStrategy
+ /**
+ * fixed_window only. Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
+ * @minimum 10
+ * @maximum 604800
+ */
+ window_seconds?: number
+ /**
+ * inactivity only. Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.
+ * @minimum 10
+ * @maximum 86400
+ */
+ quiet_period_seconds?: number
+ /**
+ * inactivity only. Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
+ * @minimum 60
+ * @maximum 604800
+ */
+ max_age_seconds?: number
+}
/**
* An evaluation that scores LLM generations, traces, or sessions.
@@ -2462,7 +2474,7 @@ export interface PatchedEvaluationApi {
* * `trace` - Trace
* * `session` - Session */
target?: EvaluationTargetEnumApi
- /** Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'. */
+ /** Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. */
target_config?: PatchedEvaluationApiTargetConfig
/** Provider and model for an llm_judge evaluation. Required when creating or switching to llm_judge. To add or replace a model, provide both provider and model. On an existing configured llm_judge, omit this field to keep the current model; null is rejected. When switching an llm_judge to hog or sentiment, set this field to null. Legacy llm_judge evaluations without a model remain editable without adding one. The nested provider_key_id may be null. */
model_configuration?: ModelConfigurationApi | null
diff --git a/products/ai_observability/frontend/generated/api.zod.ts b/products/ai_observability/frontend/generated/api.zod.ts
index 7d70c6e03a3f..0a6987d1b920 100644
--- a/products/ai_observability/frontend/generated/api.zod.ts
+++ b/products/ai_observability/frontend/generated/api.zod.ts
@@ -528,14 +528,14 @@ export const evaluationsCreateBodyConditionsItemRolloutPercentageDefault = 100
export const evaluationsCreateBodyConditionsItemRolloutPercentageMin = 0
export const evaluationsCreateBodyConditionsItemRolloutPercentageMax = 100
-export const evaluationsCreateBodyTargetConfigOneWindowSecondsMin = 10
-export const evaluationsCreateBodyTargetConfigOneWindowSecondsMax = 604800
+export const evaluationsCreateBodyTargetConfigWindowSecondsMin = 10
+export const evaluationsCreateBodyTargetConfigWindowSecondsMax = 604800
-export const evaluationsCreateBodyTargetConfigTwoQuietPeriodSecondsMin = 10
-export const evaluationsCreateBodyTargetConfigTwoQuietPeriodSecondsMax = 86400
+export const evaluationsCreateBodyTargetConfigQuietPeriodSecondsMin = 10
+export const evaluationsCreateBodyTargetConfigQuietPeriodSecondsMax = 86400
-export const evaluationsCreateBodyTargetConfigTwoMaxAgeSecondsMin = 60
-export const evaluationsCreateBodyTargetConfigTwoMaxAgeSecondsMax = 604800
+export const evaluationsCreateBodyTargetConfigMaxAgeSecondsMin = 60
+export const evaluationsCreateBodyTargetConfigMaxAgeSecondsMax = 604800
export const evaluationsCreateBodyModelConfigurationOneModelMax = 100
@@ -720,45 +720,41 @@ export const EvaluationsCreateBody = /* @__PURE__ */ zod
"What the evaluation runs on. 'generation' evaluates each matching $ai_generation event individually. 'trace' evaluates the whole trace once and 'session' the whole $ai_session_id session once: the first matching generation schedules a run that waits for the unit to settle, then evaluates all of its events together. Condition filters still match individual generations — a unit is evaluated when any of its generations matches, and sampling applies per unit. A 'session' evaluation only fires for generations that carry $ai_session_id. When and how the run fires is controlled by target_config's settle strategy.\n\n\* `generation` - Generation\n\* `trace` - Trace\n\* `session` - Session"
),
target_config: zod
- .union([
- zod.object({
- strategy: zod
- .enum(['fixed_window'])
- .describe('Wait a fixed window after the first matching generation, then evaluate.'),
- window_seconds: zod
- .number()
- .min(evaluationsCreateBodyTargetConfigOneWindowSecondsMin)
- .max(evaluationsCreateBodyTargetConfigOneWindowSecondsMax)
- .optional()
- .describe(
- "Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- }),
- zod.object({
- strategy: zod
- .enum(['inactivity'])
- .describe('Evaluate once the unit has had no new activity for the quiet period.'),
- quiet_period_seconds: zod
- .number()
- .min(evaluationsCreateBodyTargetConfigTwoQuietPeriodSecondsMin)
- .max(evaluationsCreateBodyTargetConfigTwoQuietPeriodSecondsMax)
- .optional()
- .describe(
- "Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- max_age_seconds: zod
- .number()
- .min(evaluationsCreateBodyTargetConfigTwoMaxAgeSecondsMin)
- .max(evaluationsCreateBodyTargetConfigTwoMaxAgeSecondsMax)
- .optional()
- .describe(
- "Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- }),
- ])
+ .object({
+ strategy: zod
+ .enum(['fixed_window', 'inactivity'])
+ .optional()
+ .describe(
+ "'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'."
+ ),
+ window_seconds: zod
+ .number()
+ .min(evaluationsCreateBodyTargetConfigWindowSecondsMin)
+ .max(evaluationsCreateBodyTargetConfigWindowSecondsMax)
+ .optional()
+ .describe(
+ "fixed_window only. Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ quiet_period_seconds: zod
+ .number()
+ .min(evaluationsCreateBodyTargetConfigQuietPeriodSecondsMin)
+ .max(evaluationsCreateBodyTargetConfigQuietPeriodSecondsMax)
+ .optional()
+ .describe(
+ "inactivity only. Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ max_age_seconds: zod
+ .number()
+ .min(evaluationsCreateBodyTargetConfigMaxAgeSecondsMin)
+ .max(evaluationsCreateBodyTargetConfigMaxAgeSecondsMax)
+ .optional()
+ .describe(
+ "inactivity only. Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ })
.optional()
.describe(
- "Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'."
+ "Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`."
),
model_configuration: zod
.union([
@@ -917,14 +913,14 @@ export const evaluationsUpdateBodyConditionsItemRolloutPercentageDefault = 100
export const evaluationsUpdateBodyConditionsItemRolloutPercentageMin = 0
export const evaluationsUpdateBodyConditionsItemRolloutPercentageMax = 100
-export const evaluationsUpdateBodyTargetConfigOneWindowSecondsMin = 10
-export const evaluationsUpdateBodyTargetConfigOneWindowSecondsMax = 604800
+export const evaluationsUpdateBodyTargetConfigWindowSecondsMin = 10
+export const evaluationsUpdateBodyTargetConfigWindowSecondsMax = 604800
-export const evaluationsUpdateBodyTargetConfigTwoQuietPeriodSecondsMin = 10
-export const evaluationsUpdateBodyTargetConfigTwoQuietPeriodSecondsMax = 86400
+export const evaluationsUpdateBodyTargetConfigQuietPeriodSecondsMin = 10
+export const evaluationsUpdateBodyTargetConfigQuietPeriodSecondsMax = 86400
-export const evaluationsUpdateBodyTargetConfigTwoMaxAgeSecondsMin = 60
-export const evaluationsUpdateBodyTargetConfigTwoMaxAgeSecondsMax = 604800
+export const evaluationsUpdateBodyTargetConfigMaxAgeSecondsMin = 60
+export const evaluationsUpdateBodyTargetConfigMaxAgeSecondsMax = 604800
export const evaluationsUpdateBodyModelConfigurationOneModelMax = 100
@@ -1109,45 +1105,41 @@ export const EvaluationsUpdateBody = /* @__PURE__ */ zod
"What the evaluation runs on. 'generation' evaluates each matching $ai_generation event individually. 'trace' evaluates the whole trace once and 'session' the whole $ai_session_id session once: the first matching generation schedules a run that waits for the unit to settle, then evaluates all of its events together. Condition filters still match individual generations — a unit is evaluated when any of its generations matches, and sampling applies per unit. A 'session' evaluation only fires for generations that carry $ai_session_id. When and how the run fires is controlled by target_config's settle strategy.\n\n\* `generation` - Generation\n\* `trace` - Trace\n\* `session` - Session"
),
target_config: zod
- .union([
- zod.object({
- strategy: zod
- .enum(['fixed_window'])
- .describe('Wait a fixed window after the first matching generation, then evaluate.'),
- window_seconds: zod
- .number()
- .min(evaluationsUpdateBodyTargetConfigOneWindowSecondsMin)
- .max(evaluationsUpdateBodyTargetConfigOneWindowSecondsMax)
- .optional()
- .describe(
- "Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- }),
- zod.object({
- strategy: zod
- .enum(['inactivity'])
- .describe('Evaluate once the unit has had no new activity for the quiet period.'),
- quiet_period_seconds: zod
- .number()
- .min(evaluationsUpdateBodyTargetConfigTwoQuietPeriodSecondsMin)
- .max(evaluationsUpdateBodyTargetConfigTwoQuietPeriodSecondsMax)
- .optional()
- .describe(
- "Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- max_age_seconds: zod
- .number()
- .min(evaluationsUpdateBodyTargetConfigTwoMaxAgeSecondsMin)
- .max(evaluationsUpdateBodyTargetConfigTwoMaxAgeSecondsMax)
- .optional()
- .describe(
- "Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- }),
- ])
+ .object({
+ strategy: zod
+ .enum(['fixed_window', 'inactivity'])
+ .optional()
+ .describe(
+ "'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'."
+ ),
+ window_seconds: zod
+ .number()
+ .min(evaluationsUpdateBodyTargetConfigWindowSecondsMin)
+ .max(evaluationsUpdateBodyTargetConfigWindowSecondsMax)
+ .optional()
+ .describe(
+ "fixed_window only. Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ quiet_period_seconds: zod
+ .number()
+ .min(evaluationsUpdateBodyTargetConfigQuietPeriodSecondsMin)
+ .max(evaluationsUpdateBodyTargetConfigQuietPeriodSecondsMax)
+ .optional()
+ .describe(
+ "inactivity only. Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ max_age_seconds: zod
+ .number()
+ .min(evaluationsUpdateBodyTargetConfigMaxAgeSecondsMin)
+ .max(evaluationsUpdateBodyTargetConfigMaxAgeSecondsMax)
+ .optional()
+ .describe(
+ "inactivity only. Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ })
.optional()
.describe(
- "Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'."
+ "Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`."
),
model_configuration: zod
.union([
@@ -1208,14 +1200,14 @@ export const evaluationsPartialUpdateBodyConditionsItemRolloutPercentageDefault
export const evaluationsPartialUpdateBodyConditionsItemRolloutPercentageMin = 0
export const evaluationsPartialUpdateBodyConditionsItemRolloutPercentageMax = 100
-export const evaluationsPartialUpdateBodyTargetConfigOneWindowSecondsMin = 10
-export const evaluationsPartialUpdateBodyTargetConfigOneWindowSecondsMax = 604800
+export const evaluationsPartialUpdateBodyTargetConfigWindowSecondsMin = 10
+export const evaluationsPartialUpdateBodyTargetConfigWindowSecondsMax = 604800
-export const evaluationsPartialUpdateBodyTargetConfigTwoQuietPeriodSecondsMin = 10
-export const evaluationsPartialUpdateBodyTargetConfigTwoQuietPeriodSecondsMax = 86400
+export const evaluationsPartialUpdateBodyTargetConfigQuietPeriodSecondsMin = 10
+export const evaluationsPartialUpdateBodyTargetConfigQuietPeriodSecondsMax = 86400
-export const evaluationsPartialUpdateBodyTargetConfigTwoMaxAgeSecondsMin = 60
-export const evaluationsPartialUpdateBodyTargetConfigTwoMaxAgeSecondsMax = 604800
+export const evaluationsPartialUpdateBodyTargetConfigMaxAgeSecondsMin = 60
+export const evaluationsPartialUpdateBodyTargetConfigMaxAgeSecondsMax = 604800
export const evaluationsPartialUpdateBodyModelConfigurationOneModelMax = 100
@@ -1402,45 +1394,41 @@ export const EvaluationsPartialUpdateBody = /* @__PURE__ */ zod
"What the evaluation runs on. 'generation' evaluates each matching $ai_generation event individually. 'trace' evaluates the whole trace once and 'session' the whole $ai_session_id session once: the first matching generation schedules a run that waits for the unit to settle, then evaluates all of its events together. Condition filters still match individual generations — a unit is evaluated when any of its generations matches, and sampling applies per unit. A 'session' evaluation only fires for generations that carry $ai_session_id. When and how the run fires is controlled by target_config's settle strategy.\n\n\* `generation` - Generation\n\* `trace` - Trace\n\* `session` - Session"
),
target_config: zod
- .union([
- zod.object({
- strategy: zod
- .enum(['fixed_window'])
- .describe('Wait a fixed window after the first matching generation, then evaluate.'),
- window_seconds: zod
- .number()
- .min(evaluationsPartialUpdateBodyTargetConfigOneWindowSecondsMin)
- .max(evaluationsPartialUpdateBodyTargetConfigOneWindowSecondsMax)
- .optional()
- .describe(
- "Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- }),
- zod.object({
- strategy: zod
- .enum(['inactivity'])
- .describe('Evaluate once the unit has had no new activity for the quiet period.'),
- quiet_period_seconds: zod
- .number()
- .min(evaluationsPartialUpdateBodyTargetConfigTwoQuietPeriodSecondsMin)
- .max(evaluationsPartialUpdateBodyTargetConfigTwoQuietPeriodSecondsMax)
- .optional()
- .describe(
- "Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- max_age_seconds: zod
- .number()
- .min(evaluationsPartialUpdateBodyTargetConfigTwoMaxAgeSecondsMin)
- .max(evaluationsPartialUpdateBodyTargetConfigTwoMaxAgeSecondsMax)
- .optional()
- .describe(
- "Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- }),
- ])
+ .object({
+ strategy: zod
+ .enum(['fixed_window', 'inactivity'])
+ .optional()
+ .describe(
+ "'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'."
+ ),
+ window_seconds: zod
+ .number()
+ .min(evaluationsPartialUpdateBodyTargetConfigWindowSecondsMin)
+ .max(evaluationsPartialUpdateBodyTargetConfigWindowSecondsMax)
+ .optional()
+ .describe(
+ "fixed_window only. Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ quiet_period_seconds: zod
+ .number()
+ .min(evaluationsPartialUpdateBodyTargetConfigQuietPeriodSecondsMin)
+ .max(evaluationsPartialUpdateBodyTargetConfigQuietPeriodSecondsMax)
+ .optional()
+ .describe(
+ "inactivity only. Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ max_age_seconds: zod
+ .number()
+ .min(evaluationsPartialUpdateBodyTargetConfigMaxAgeSecondsMin)
+ .max(evaluationsPartialUpdateBodyTargetConfigMaxAgeSecondsMax)
+ .optional()
+ .describe(
+ "inactivity only. Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ })
.optional()
.describe(
- "Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'."
+ "Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`."
),
model_configuration: zod
.union([
diff --git a/products/desktop/packages/api-client/src/generated.ts b/products/desktop/packages/api-client/src/generated.ts
index e33244d767e0..0857fdbb05be 100644
--- a/products/desktop/packages/api-client/src/generated.ts
+++ b/products/desktop/packages/api-client/src/generated.ts
@@ -9371,23 +9371,24 @@ export namespace Schemas {
* An evaluation that scores LLM generations, traces, or sessions.
*/
target_config?:
- | (
- | {
- /**
- * Wait a fixed window after the first matching generation, then evaluate.
- */
- strategy: "fixed_window";
- window_seconds?: number | undefined;
- }
- | {
- /**
- * Evaluate once the unit has had no new activity for the quiet period.
- */
- strategy: "inactivity";
- quiet_period_seconds?: number | undefined;
- max_age_seconds?: number | undefined;
- }
- )
+ | Partial<{
+ /**
+ * 'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'.
+ */
+ strategy: "fixed_window" | "inactivity";
+ /**
+ * fixed_window only. Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
+ */
+ window_seconds: number;
+ /**
+ * inactivity only. Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.
+ */
+ quiet_period_seconds: number;
+ /**
+ * inactivity only. Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
+ */
+ max_age_seconds: number;
+ }>
| undefined;
/**
* An evaluation that scores LLM generations, traces, or sessions.
@@ -19207,13 +19208,12 @@ export namespace Schemas {
}>;
conditions: Array<EvaluationCondition>;
target: EvaluationTargetEnum;
- target_config:
- | { strategy: "fixed_window"; window_seconds?: number | undefined }
- | {
- strategy: "inactivity";
- quiet_period_seconds?: number | undefined;
- max_age_seconds?: number | undefined;
- };
+ target_config: Partial<{
+ strategy: "fixed_window" | "inactivity";
+ window_seconds: number;
+ quiet_period_seconds: number;
+ max_age_seconds: number;
+ }>;
model_configuration: ModelConfiguration | null;
created_at: string;
updated_at: string;
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index abc883efafdd..6f75dc1145f7 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -42486,28 +42486,36 @@ export namespace Schemas {
};
/**
- * Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'.
+ * 'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'.
+ */
+ export type EvaluationTargetConfigStrategy = typeof EvaluationTargetConfigStrategy[keyof typeof EvaluationTargetConfigStrategy];
+
+
+ export const EvaluationTargetConfigStrategy = {
+ FixedWindow: 'fixed_window',
+ Inactivity: 'inactivity',
+ } as const;
+
+ /**
+ * Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`.
*/
export type EvaluationTargetConfig = {
- /** Wait a fixed window after the first matching generation, then evaluate. */
- strategy: 'fixed_window';
+ /** 'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'. */
+ strategy?: EvaluationTargetConfigStrategy;
/**
- * Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
+ * fixed_window only. Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
* @minimum 10
* @maximum 604800
*/
window_seconds?: number;
- } | {
- /** Evaluate once the unit has had no new activity for the quiet period. */
- strategy: 'inactivity';
/**
- * Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.
+ * inactivity only. Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.
* @minimum 10
* @maximum 86400
*/
quiet_period_seconds?: number;
/**
- * Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
+ * inactivity only. Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
* @minimum 60
* @maximum 604800
*/
@@ -42718,7 +42726,7 @@ export namespace Schemas {
* * `trace` - Trace
* * `session` - Session */
target?: EvaluationTargetEnum;
- /** Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'. */
+ /** Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. */
target_config?: EvaluationTargetConfig;
/** Provider and model for an llm_judge evaluation. Required when creating or switching to llm_judge. To add or replace a model, provide both provider and model. On an existing configured llm_judge, omit this field to keep the current model; null is rejected. When switching an llm_judge to hog or sentiment, set this field to null. Legacy llm_judge evaluations without a model remain editable without adding one. The nested provider_key_id may be null. */
model_configuration?: ModelConfiguration | null;
@@ -80259,28 +80267,36 @@ export namespace Schemas {
};
/**
- * Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'.
+ * 'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'.
+ */
+ export type PatchedEvaluationTargetConfigStrategy = typeof PatchedEvaluationTargetConfigStrategy[keyof typeof PatchedEvaluationTargetConfigStrategy];
+
+
+ export const PatchedEvaluationTargetConfigStrategy = {
+ FixedWindow: 'fixed_window',
+ Inactivity: 'inactivity',
+ } as const;
+
+ /**
+ * Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`.
*/
export type PatchedEvaluationTargetConfig = {
- /** Wait a fixed window after the first matching generation, then evaluate. */
- strategy: 'fixed_window';
+ /** 'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'. */
+ strategy?: PatchedEvaluationTargetConfigStrategy;
/**
- * Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
+ * fixed_window only. Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
* @minimum 10
* @maximum 604800
*/
window_seconds?: number;
- } | {
- /** Evaluate once the unit has had no new activity for the quiet period. */
- strategy: 'inactivity';
/**
- * Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.
+ * inactivity only. Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.
* @minimum 10
* @maximum 86400
*/
quiet_period_seconds?: number;
/**
- * Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
+ * inactivity only. Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.
* @minimum 60
* @maximum 604800
*/
@@ -80338,7 +80354,7 @@ export namespace Schemas {
* * `trace` - Trace
* * `session` - Session */
target?: EvaluationTargetEnum;
- /** Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'. */
+ /** Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. */
target_config?: PatchedEvaluationTargetConfig;
/** Provider and model for an llm_judge evaluation. Required when creating or switching to llm_judge. To add or replace a model, provide both provider and model. On an existing configured llm_judge, omit this field to keep the current model; null is rejected. When switching an llm_judge to hog or sentiment, set this field to null. Legacy llm_judge evaluations without a model remain editable without adding one. The nested provider_key_id may be null. */
model_configuration?: ModelConfiguration | null;
diff --git a/services/mcp/src/generated/ai_observability/api.ts b/services/mcp/src/generated/ai_observability/api.ts
index a9f229649b53..d067478bb12a 100644
--- a/services/mcp/src/generated/ai_observability/api.ts
+++ b/services/mcp/src/generated/ai_observability/api.ts
@@ -1298,14 +1298,14 @@ export const evaluationsCreateBodyConditionsItemRolloutPercentageDefault = 100
export const evaluationsCreateBodyConditionsItemRolloutPercentageMin = 0
export const evaluationsCreateBodyConditionsItemRolloutPercentageMax = 100
-export const evaluationsCreateBodyTargetConfigOneWindowSecondsMin = 10
-export const evaluationsCreateBodyTargetConfigOneWindowSecondsMax = 604800
+export const evaluationsCreateBodyTargetConfigWindowSecondsMin = 10
+export const evaluationsCreateBodyTargetConfigWindowSecondsMax = 604800
-export const evaluationsCreateBodyTargetConfigTwoQuietPeriodSecondsMin = 10
-export const evaluationsCreateBodyTargetConfigTwoQuietPeriodSecondsMax = 86400
+export const evaluationsCreateBodyTargetConfigQuietPeriodSecondsMin = 10
+export const evaluationsCreateBodyTargetConfigQuietPeriodSecondsMax = 86400
-export const evaluationsCreateBodyTargetConfigTwoMaxAgeSecondsMin = 60
-export const evaluationsCreateBodyTargetConfigTwoMaxAgeSecondsMax = 604800
+export const evaluationsCreateBodyTargetConfigMaxAgeSecondsMin = 60
+export const evaluationsCreateBodyTargetConfigMaxAgeSecondsMax = 604800
export const evaluationsCreateBodyModelConfigurationOneModelMax = 100
@@ -1490,45 +1490,41 @@ export const EvaluationsCreateBody = () => zod
"What the evaluation runs on. 'generation' evaluates each matching $ai_generation event individually. 'trace' evaluates the whole trace once and 'session' the whole $ai_session_id session once: the first matching generation schedules a run that waits for the unit to settle, then evaluates all of its events together. Condition filters still match individual generations — a unit is evaluated when any of its generations matches, and sampling applies per unit. A 'session' evaluation only fires for generations that carry $ai_session_id. When and how the run fires is controlled by target_config's settle strategy.\n\n\* `generation` - Generation\n\* `trace` - Trace\n\* `session` - Session"
),
target_config: zod
- .union([
- zod.object({
- strategy: zod
- .enum(['fixed_window'])
- .describe('Wait a fixed window after the first matching generation, then evaluate.'),
- window_seconds: zod
- .number()
- .min(evaluationsCreateBodyTargetConfigOneWindowSecondsMin)
- .max(evaluationsCreateBodyTargetConfigOneWindowSecondsMax)
- .optional()
- .describe(
- "Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- }),
- zod.object({
- strategy: zod
- .enum(['inactivity'])
- .describe('Evaluate once the unit has had no new activity for the quiet period.'),
- quiet_period_seconds: zod
- .number()
- .min(evaluationsCreateBodyTargetConfigTwoQuietPeriodSecondsMin)
- .max(evaluationsCreateBodyTargetConfigTwoQuietPeriodSecondsMax)
- .optional()
- .describe(
- "Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- max_age_seconds: zod
- .number()
- .min(evaluationsCreateBodyTargetConfigTwoMaxAgeSecondsMin)
- .max(evaluationsCreateBodyTargetConfigTwoMaxAgeSecondsMax)
- .optional()
- .describe(
- "Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- }),
- ])
+ .object({
+ strategy: zod
+ .enum(['fixed_window', 'inactivity'])
+ .optional()
+ .describe(
+ "'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'."
+ ),
+ window_seconds: zod
+ .number()
+ .min(evaluationsCreateBodyTargetConfigWindowSecondsMin)
+ .max(evaluationsCreateBodyTargetConfigWindowSecondsMax)
+ .optional()
+ .describe(
+ "fixed_window only. Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ quiet_period_seconds: zod
+ .number()
+ .min(evaluationsCreateBodyTargetConfigQuietPeriodSecondsMin)
+ .max(evaluationsCreateBodyTargetConfigQuietPeriodSecondsMax)
+ .optional()
+ .describe(
+ "inactivity only. Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ max_age_seconds: zod
+ .number()
+ .min(evaluationsCreateBodyTargetConfigMaxAgeSecondsMin)
+ .max(evaluationsCreateBodyTargetConfigMaxAgeSecondsMax)
+ .optional()
+ .describe(
+ "inactivity only. Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ })
.optional()
.describe(
- "Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'."
+ "Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`."
),
model_configuration: zod
.union([
@@ -1766,14 +1762,14 @@ export const evaluationsPartialUpdateBodyConditionsItemRolloutPercentageDefault
export const evaluationsPartialUpdateBodyConditionsItemRolloutPercentageMin = 0
export const evaluationsPartialUpdateBodyConditionsItemRolloutPercentageMax = 100
-export const evaluationsPartialUpdateBodyTargetConfigOneWindowSecondsMin = 10
-export const evaluationsPartialUpdateBodyTargetConfigOneWindowSecondsMax = 604800
+export const evaluationsPartialUpdateBodyTargetConfigWindowSecondsMin = 10
+export const evaluationsPartialUpdateBodyTargetConfigWindowSecondsMax = 604800
-export const evaluationsPartialUpdateBodyTargetConfigTwoQuietPeriodSecondsMin = 10
-export const evaluationsPartialUpdateBodyTargetConfigTwoQuietPeriodSecondsMax = 86400
+export const evaluationsPartialUpdateBodyTargetConfigQuietPeriodSecondsMin = 10
+export const evaluationsPartialUpdateBodyTargetConfigQuietPeriodSecondsMax = 86400
-export const evaluationsPartialUpdateBodyTargetConfigTwoMaxAgeSecondsMin = 60
-export const evaluationsPartialUpdateBodyTargetConfigTwoMaxAgeSecondsMax = 604800
+export const evaluationsPartialUpdateBodyTargetConfigMaxAgeSecondsMin = 60
+export const evaluationsPartialUpdateBodyTargetConfigMaxAgeSecondsMax = 604800
export const evaluationsPartialUpdateBodyModelConfigurationOneModelMax = 100
@@ -1960,45 +1956,41 @@ export const EvaluationsPartialUpdateBody = () => zod
"What the evaluation runs on. 'generation' evaluates each matching $ai_generation event individually. 'trace' evaluates the whole trace once and 'session' the whole $ai_session_id session once: the first matching generation schedules a run that waits for the unit to settle, then evaluates all of its events together. Condition filters still match individual generations — a unit is evaluated when any of its generations matches, and sampling applies per unit. A 'session' evaluation only fires for generations that carry $ai_session_id. When and how the run fires is controlled by target_config's settle strategy.\n\n\* `generation` - Generation\n\* `trace` - Trace\n\* `session` - Session"
),
target_config: zod
- .union([
- zod.object({
- strategy: zod
- .enum(['fixed_window'])
- .describe('Wait a fixed window after the first matching generation, then evaluate.'),
- window_seconds: zod
- .number()
- .min(evaluationsPartialUpdateBodyTargetConfigOneWindowSecondsMin)
- .max(evaluationsPartialUpdateBodyTargetConfigOneWindowSecondsMax)
- .optional()
- .describe(
- "Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- }),
- zod.object({
- strategy: zod
- .enum(['inactivity'])
- .describe('Evaluate once the unit has had no new activity for the quiet period.'),
- quiet_period_seconds: zod
- .number()
- .min(evaluationsPartialUpdateBodyTargetConfigTwoQuietPeriodSecondsMin)
- .max(evaluationsPartialUpdateBodyTargetConfigTwoQuietPeriodSecondsMax)
- .optional()
- .describe(
- "Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- max_age_seconds: zod
- .number()
- .min(evaluationsPartialUpdateBodyTargetConfigTwoMaxAgeSecondsMin)
- .max(evaluationsPartialUpdateBodyTargetConfigTwoMaxAgeSecondsMax)
- .optional()
- .describe(
- "Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
- ),
- }),
- ])
+ .object({
+ strategy: zod
+ .enum(['fixed_window', 'inactivity'])
+ .optional()
+ .describe(
+ "'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'."
+ ),
+ window_seconds: zod
+ .number()
+ .min(evaluationsPartialUpdateBodyTargetConfigWindowSecondsMin)
+ .max(evaluationsPartialUpdateBodyTargetConfigWindowSecondsMax)
+ .optional()
+ .describe(
+ "fixed_window only. Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ quiet_period_seconds: zod
+ .number()
+ .min(evaluationsPartialUpdateBodyTargetConfigQuietPeriodSecondsMin)
+ .max(evaluationsPartialUpdateBodyTargetConfigQuietPeriodSecondsMax)
+ .optional()
+ .describe(
+ "inactivity only. Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ max_age_seconds: zod
+ .number()
+ .min(evaluationsPartialUpdateBodyTargetConfigMaxAgeSecondsMin)
+ .max(evaluationsPartialUpdateBodyTargetConfigMaxAgeSecondsMax)
+ .optional()
+ .describe(
+ "inactivity only. Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text."
+ ),
+ })
.optional()
.describe(
- "Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'."
+ "Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`."
),
model_configuration: zod
.union([
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-evaluation-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-evaluation-create.json
index 27843339498b..2873e6b2cd5f 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-evaluation-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-evaluation-create.json
@@ -301,49 +301,33 @@
"type": "string"
},
"target_config": {
- "anyOf": [
- {
- "properties": {
- "strategy": {
- "description": "Wait a fixed window after the first matching generation, then evaluate.",
- "enum": ["fixed_window"],
- "type": "string"
- },
- "window_seconds": {
- "description": "Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.",
- "maximum": 604800,
- "minimum": 10,
- "type": "number"
- }
- },
- "required": ["strategy"],
- "type": "object"
+ "description": "Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`.",
+ "properties": {
+ "max_age_seconds": {
+ "description": "inactivity only. Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.",
+ "maximum": 604800,
+ "minimum": 60,
+ "type": "number"
},
- {
- "properties": {
- "max_age_seconds": {
- "description": "Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.",
- "maximum": 604800,
- "minimum": 60,
- "type": "number"
- },
- "quiet_period_seconds": {
- "description": "Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.",
- "maximum": 86400,
- "minimum": 10,
- "type": "number"
- },
- "strategy": {
- "description": "Evaluate once the unit has had no new activity for the quiet period.",
- "enum": ["inactivity"],
- "type": "string"
- }
- },
- "required": ["strategy"],
- "type": "object"
+ "quiet_period_seconds": {
+ "description": "inactivity only. Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.",
+ "maximum": 86400,
+ "minimum": 10,
+ "type": "number"
+ },
+ "strategy": {
+ "description": "'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'.",
+ "enum": ["fixed_window", "inactivity"],
+ "type": "string"
+ },
+ "window_seconds": {
+ "description": "fixed_window only. Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.",
+ "maximum": 604800,
+ "minimum": 10,
+ "type": "number"
}
- ],
- "description": "Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'."
+ },
+ "type": "object"
}
},
"required": ["name", "evaluation_type", "output_type"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-evaluation-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-evaluation-update.json
index 9b9b8ed3758c..6ecee1117f78 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-evaluation-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-evaluation-update.json
@@ -304,49 +304,33 @@
"type": "string"
},
"target_config": {
- "anyOf": [
- {
- "properties": {
- "strategy": {
- "description": "Wait a fixed window after the first matching generation, then evaluate.",
- "enum": ["fixed_window"],
- "type": "string"
- },
- "window_seconds": {
- "description": "Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.",
- "maximum": 604800,
- "minimum": 10,
- "type": "number"
- }
- },
- "required": ["strategy"],
- "type": "object"
+ "description": "Target-specific config. Send {} or omit it for 'generation'. For 'trace' and 'session' targets: a settle config, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Omit `strategy` to use the target's default. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`.",
+ "properties": {
+ "max_age_seconds": {
+ "description": "inactivity only. Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.",
+ "maximum": 604800,
+ "minimum": 60,
+ "type": "number"
},
- {
- "properties": {
- "max_age_seconds": {
- "description": "Hard cap in seconds on the total wait from the first matching generation, even if the unit stays active. Must be at least quiet_period_seconds. The accepted range depends on `target`: 60–7200 for 'trace', 60–604800 for 'session'. The default also depends on `target`; see the field-level help_text.",
- "maximum": 604800,
- "minimum": 60,
- "type": "number"
- },
- "quiet_period_seconds": {
- "description": "Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.",
- "maximum": 86400,
- "minimum": 10,
- "type": "number"
- },
- "strategy": {
- "description": "Evaluate once the unit has had no new activity for the quiet period.",
- "enum": ["inactivity"],
- "type": "string"
- }
- },
- "required": ["strategy"],
- "type": "object"
+ "quiet_period_seconds": {
+ "description": "inactivity only. Seconds without new activity before the unit counts as settled. The accepted range depends on `target`: 10–1800 for 'trace', 10–86400 for 'session'. The default also depends on `target`; see the field-level help_text.",
+ "maximum": 86400,
+ "minimum": 10,
+ "type": "number"
+ },
+ "strategy": {
+ "description": "'fixed_window' waits a fixed window after the first matching generation, then evaluates. 'inactivity' evaluates once the unit has had no new activity for the quiet period. Omit it to use the target's default: 'fixed_window' for 'trace', 'inactivity' for 'session'.",
+ "enum": ["fixed_window", "inactivity"],
+ "type": "string"
+ },
+ "window_seconds": {
+ "description": "fixed_window only. Seconds to wait after the first matching generation before evaluating the whole unit. Captured when the run is scheduled — editing it does not change runs already in flight. The accepted range depends on `target`: 10–7200 for 'trace', 10–604800 for 'session'. The default also depends on `target`; see the field-level help_text.",
+ "maximum": 604800,
+ "minimum": 10,
+ "type": "number"
}
- ],
- "description": "Target-specific config. For 'trace' and 'session' targets: a settle config discriminated on `strategy`, either 'fixed_window' {window_seconds} or 'inactivity' {quiet_period_seconds, max_age_seconds}. Send `strategy` explicitly. The server fills in any other field you omit, using per-target defaults, and the accepted bounds also depend on `target`. Empty for 'generation'."
+ },
+ "type": "object"
}
},
"required": ["id"],