: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(cdp): add non_failure_status_codes inputs_schema type (#60866)
Meikel Ratzf38b5d3cc76d
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex b8c0b257923e..f8b874f4428c 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -4953,7 +4953,7 @@ snapshots:scenes-app-insights-funnels--funnel-left-to-right-edit-viewports--wide--dark:hash: v1.k794b7964.c47bdb853ef9b6becfb675e2ca0bdbdb0c1b4385cf2442d50dd92752d90f7906.URrKOLP9uUjbKWcui2yOA7hm_JsXsbkAlOcWJshoQrIscenes-app-insights-funnels--funnel-left-to-right-edit-viewports--wide--light:- hash: v1.k794b7964.6c391cbc05b64230fbd8defdbb960b131fd433409817497873fb9ffc705cd360.EIwByuofuT77yP259A9ffqfjSFwW9MrUDOvsZNA_aZM+ hash: v1.k794b7964.c63132bb5b13cbe97938ebdb2e59e320ebc338bd12b2d3bfd6af81e56270650a.KSiw8WpvjWXIDh87ExL4cPnopVJlTXvzU8N8ruh6Hi8scenes-app-insights-funnels--funnel-time-to-convert--dark:hash: v1.k794b7964.d64808d2bfc36017f89b57feeaa373e20188738a622801207fa1beb59d02fdd9.cFuKF_Ow887Z3X3BoNhtTvkUWY2vips9HDBe-B02eQEscenes-app-insights-funnels--funnel-time-to-convert--light:diff --git a/frontend/src/lib/components/CyclotronJob/CyclotronJobInputs.tsx b/frontend/src/lib/components/CyclotronJob/CyclotronJobInputs.tsxindex 5bb1d291a6f3..1fa5b22bc5f5 100644--- a/frontend/src/lib/components/CyclotronJob/CyclotronJobInputs.tsx+++ b/frontend/src/lib/components/CyclotronJob/CyclotronJobInputs.tsx@@ -50,8 +50,32 @@ const INPUT_TYPE_LIST = ['integration','email','native_email',+ 'non_failure_status_codes',] as const+// Keyed by the full CyclotronJobInputSchemaType['type'] union — the schema editor's LemonSelect+// receives `value={value.type}` which widens the inferred T past INPUT_TYPE_LIST, so the map's+// indexer needs to accept any of the schema types.+const INPUT_TYPE_LABELS: Partial<Record<CyclotronJobInputSchemaType['type'], string>> = {+ native_email: 'Native email',+ non_failure_status_codes: 'Non-failure codes',+}++const INPUT_TYPE_DEFAULT_DESCRIPTIONS: Partial<Record<CyclotronJobInputSchemaType['type'], string>> = {+ non_failure_status_codes:+ 'HTTP response codes that should NOT mark the invocation as failed. Accepts specific codes (e.g. 409, 422) or the wildcards 4xx and 5xx. Useful when an API returns 4xx for expected non-error states.',+}++const NON_FAILURE_STATUS_CODE_SUGGESTIONS = ['4xx', '5xx', '400', '401', '403', '404', '409', '422', '429']++function isValidNonFailureStatusCode(entry: string): boolean {+ if (/^[4-5]xx$/i.test(entry)) {+ return true+ }+ const n = Number(entry)+ return Number.isInteger(n) && n >= 400 && n <= 599+}+export type CyclotronJobInputsProps = {onInputChange?: (key: string, input: CyclotronJobInputType) => voidconfiguration: CyclotronJobInputConfiguration@@ -473,6 +497,46 @@ type CyclotronJobInputProps = {sampleGlobalsWithInputs: CyclotronJobInvocationGlobalsWithInputs | null}+function NonFailureStatusCodesField({+ value,+ onChange,+ disabled,+}: {+ value: unknown+ onChange: (value: Array<number | string>) => void+ disabled?: boolean+}): JSX.Element {+ const current: string[] = Array.isArray(value) ? value.map((v) => String(v)) : []+ const invalid = current.filter((v) => !isValidNonFailureStatusCode(v))++ return (+ <div className="deprecated-space-y-1">+ <LemonInputSelect+ mode="multiple"+ allowCustomValues+ value={current}+ onChange={(next) => {+ const normalized: Array<number | string> = next.map((entry) => {+ const trimmed = entry.trim()+ const n = Number(trimmed)+ return /^[1-5]xx$/i.test(trimmed) ? trimmed.toLowerCase() : Number.isInteger(n) ? n : trimmed+ })+ onChange(normalized)+ }}+ options={NON_FAILURE_STATUS_CODE_SUGGESTIONS.map((v) => ({ key: v, label: v }))}+ placeholder="e.g. 4xx, 400, 429"+ disabled={disabled}+ />+ {invalid.length > 0 && (+ <div className="text-xs text-danger">+ Invalid {invalid.length === 1 ? 'entry' : 'entries'}: {invalid.join(', ')}. Use a number between 400+ and 599, <code>4xx</code>, or <code>5xx</code>.+ </div>+ )}+ </div>+ )+}+function CyclotronJobInputRenderer({onChange,onInputChange,@@ -588,6 +652,8 @@ function CyclotronJobInputRenderer({sampleGlobalsWithInputs={sampleGlobalsWithInputs}/>)+ case 'non_failure_status_codes':+ return <NonFailureStatusCodesField value={input.value} onChange={onValueChange} disabled={disabled} />default: {const CustomRenderer = CUSTOM_INPUT_RENDERERS[schema.type]if (CustomRenderer) {@@ -640,12 +706,20 @@ function CyclotronJobInputSchemaControls({<LemonSelectsize="small"options={INPUT_TYPE_LIST.map((type) => ({- label: capitalizeFirstLetter(type),+ label: INPUT_TYPE_LABELS[type] ?? capitalizeFirstLetter(type),value: type,}))}value={value.type}- className="w-30"- onChange={(type) => _onChange({ type })}+ className="min-w-40"+ onChange={(type) => {+ const defaultDescription = INPUT_TYPE_DEFAULT_DESCRIPTIONS[type]+ // Seed the description from the type's default if the author hasn't written one+ if (defaultDescription && !value.description) {+ _onChange({ type, description: defaultDescription })+ } else {+ _onChange({ type })+ }+ }}/><LemonCheckboxsize="small"@@ -776,8 +850,17 @@ function CyclotronJobInputWithSchema({onInputChange?.(newSchema.key, value)}+ const isEmptyValue = (v: unknown): boolean =>+ v === null || v === undefined || v === '' || (Array.isArray(v) && v.length === 0)+if (newSchema?.type && newSchema.type !== schema.type) {- onInputChange?.(schema.key, { value: null })+ // Reset on type change; seed from schema default when one is declared+ onInputChange?.(schema.key, {+ value: newSchema.default !== undefined ? newSchema.default : null,+ })+ } else if (newSchema?.default !== undefined && isEmptyValue(value.value)) {+ // Seed an empty input value from the schema's default so save succeeds without a separate edit+ onInputChange?.(newSchema.key ?? schema.key, { ...value, value: newSchema.default })}onInputSchemaChange?.(inputsSchema)}diff --git a/frontend/src/types.ts b/frontend/src/types.tsindex 267d51118665..ccf53c8f1a85 100644--- a/frontend/src/types.ts+++ b/frontend/src/types.ts@@ -6565,6 +6565,7 @@ export type CyclotronJobInputSchemaType = {| 'posthog_assignee'| 'posthog_ticket_tags'| 'posthog_business_hours'+ | 'non_failure_status_codes'key: stringlabel: stringchoices?: { value: string; label: string }[]diff --git a/nodejs/src/cdp/services/hog-executor.service.test.ts b/nodejs/src/cdp/services/hog-executor.service.test.tsindex cfb857ff0dc4..8161228d31c5 100644--- a/nodejs/src/cdp/services/hog-executor.service.test.ts+++ b/nodejs/src/cdp/services/hog-executor.service.test.ts@@ -1407,6 +1407,17 @@ describe('Hog Executor', () => {})it('replaces access token placeholders in body, headers, and url', async () => {+ jest.mocked(fetch).mockImplementation(() => {+ return Promise.resolve({+ status: 200,+ body: 'Hello, world!',+ headers: {},+ json: () => Promise.resolve({}),+ text: () => Promise.resolve(''),+ dump: () => Promise.resolve(),+ })+ })+const mockIntegrationInputs = {oauth: {value: {@@ -1450,6 +1461,208 @@ describe('Hog Executor', () => {]`)})++ describe('with non_failure_status_codes', () => {+ beforeEach(() => {+ const actualRequest = jest.requireActual('~/utils/request') as { fetch: typeof fetch }+ jest.mocked(fetch).mockImplementation((url, options) => actualRequest.fetch(url, options))+ })++ const setNonFailureConfig = (+ invocation: CyclotronJobInvocationHogFunction,+ value: Array<number | string>+ ): void => {+ invocation.hogFunction.inputs_schema = [+ ...(invocation.hogFunction.inputs_schema ?? []),+ {+ key: 'non_failure_status_codes',+ type: 'non_failure_status_codes',+ label: 'Non-failure response codes',+ required: false,+ },+ ]+ invocation.hogFunction.inputs = {+ ...(invocation.hogFunction.inputs ?? {}),+ non_failure_status_codes: { value },+ }+ }++ it('treats matched non-retriable 4xx as success (exact match)', async () => {+ mockRequest.mockImplementation((req: any, res: any) => {+ res.writeHead(400, { 'Content-Type': 'text/plain' })+ res.end('backdated consent')+ })++ const invocation = await createFetchInvocation({+ url: `${baseUrl}/test`,+ method: 'GET',+ })+ setNonFailureConfig(invocation, [400])++ const result = await executor.executeFetch(invocation)++ expect(result.error).toBeUndefined()+ expect(result.invocation.queueScheduledAt).toBeUndefined()+ expect(result.invocation.state.vmState!.stack.slice(-1)[0]).toEqual({+ status: 400,+ body: 'backdated consent',+ })+ expect(result.logs.map((l) => ({ level: l.level, message: l.message }))).toEqual([+ {+ level: 'info',+ message: expect.stringContaining('status code 400'),+ },+ ])+ })++ it('treats matched 4xx as success via wildcard', async () => {+ mockRequest.mockImplementation((req: any, res: any) => {+ res.writeHead(404, { 'Content-Type': 'text/plain' })+ res.end('not found')+ })++ const invocation = await createFetchInvocation({+ url: `${baseUrl}/test`,+ method: 'GET',+ })+ setNonFailureConfig(invocation, ['4xx'])++ const result = await executor.executeFetch(invocation)++ expect(result.error).toBeUndefined()+ expect(result.invocation.state.vmState!.stack.slice(-1)[0]).toEqual({+ status: 404,+ body: 'not found',+ })+ })++ it('does not match when ignore list does not cover the status', async () => {+ mockRequest.mockImplementation((req: any, res: any) => {+ res.writeHead(401, { 'Content-Type': 'text/plain' })+ res.end('unauthorized')+ })++ const invocation = await createFetchInvocation({+ url: `${baseUrl}/test`,+ method: 'GET',+ })+ setNonFailureConfig(invocation, [400, 403])++ const result = await executor.executeFetch(invocation)++ expect(result.error).toBeInstanceOf(Error)+ expect(result.error.message).toContain('status code 401')+ expect(result.logs[0].level).toBe('error')+ })++ it('still retries a retriable status that is in the ignore list, then succeeds without setting result.error', async () => {+ mockRequest.mockImplementation((req: any, res: any) => {+ res.writeHead(500, { 'Content-Type': 'text/plain' })+ res.end('server error')+ })++ const invocation = await createFetchInvocation({+ url: `${baseUrl}/test`,+ method: 'GET',+ })+ setNonFailureConfig(invocation, [500])++ const maxRetries = executor['config'].fetchRetries+ let result = await executor.executeFetch(invocation)+ // Verify every intermediate attempt also logged at 'info' — regression guard+ // against any future change that re-raises retry logs to 'error' when the+ // status is in the non-failure list.+ expect(result.logs.every((l) => l.level === 'info')).toBe(true)++ for (let attempt = 1; attempt < maxRetries; attempt++) {+ expect(result.error).toBeUndefined()+ expect(result.invocation.queueScheduledAt).not.toBeUndefined()+ expect(result.invocation.state.attempts).toBe(attempt)+ result = await executor.executeFetch(result.invocation)+ expect(result.logs.every((l) => l.level === 'info')).toBe(true)+ }++ expect(result.error).toBeUndefined()+ expect(result.invocation.queueScheduledAt).toBeUndefined()+ expect(result.invocation.state.vmState!.stack.slice(-1)[0]).toEqual({+ status: 500,+ body: 'server error',+ })+ expect(result.logs.every((l) => l.level === 'info')).toBe(true)+ })++ it('mixed wildcard and number ignores both 4xx and the specific 5xx', async () => {+ mockRequest.mockImplementation((req: any, res: any) => {+ res.writeHead(404, { 'Content-Type': 'text/plain' })+ res.end('a')+ })+ let invocation = await createFetchInvocation({ url: `${baseUrl}/test`, method: 'GET' })+ setNonFailureConfig(invocation, ['4xx', 500])++ let result = await executor.executeFetch(invocation)+ expect(result.error).toBeUndefined()+ expect(result.invocation.state.vmState!.stack.slice(-1)[0]).toEqual({ status: 404, body: 'a' })++ mockRequest.mockImplementation((req: any, res: any) => {+ res.writeHead(500, { 'Content-Type': 'text/plain' })+ res.end('b')+ })+ invocation = await createFetchInvocation({ url: `${baseUrl}/test`, method: 'GET' })+ setNonFailureConfig(invocation, ['4xx', 500])++ // 500 is retriable — drain retries until terminal+ const maxRetries = executor['config'].fetchRetries+ result = await executor.executeFetch(invocation)+ for (let attempt = 1; attempt < maxRetries; attempt++) {+ result = await executor.executeFetch(result.invocation)+ }+ expect(result.error).toBeUndefined()+ expect(result.invocation.state.vmState!.stack.slice(-1)[0]).toEqual({ status: 500, body: 'b' })+ })++ it('does not ignore a 502 when config is [4xx, 500]', async () => {+ mockRequest.mockImplementation((req: any, res: any) => {+ res.writeHead(502, { 'Content-Type': 'text/plain' })+ res.end('bad gateway')+ })+ const invocation = await createFetchInvocation({ url: `${baseUrl}/test`, method: 'GET' })+ setNonFailureConfig(invocation, ['4xx', 500])++ const maxRetries = executor['config'].fetchRetries+ let result = await executor.executeFetch(invocation)+ for (let attempt = 1; attempt < maxRetries; attempt++) {+ result = await executor.executeFetch(result.invocation)+ }+ expect(result.error).toBeInstanceOf(Error)+ expect(result.error.message).toContain('status code 502')+ })++ it('does not affect successful responses', async () => {+ mockRequest.mockImplementation((req: any, res: any) => {+ res.writeHead(200, { 'Content-Type': 'text/plain' })+ res.end('ok')+ })+ const invocation = await createFetchInvocation({ url: `${baseUrl}/test`, method: 'GET' })+ setNonFailureConfig(invocation, ['4xx', 500])++ const result = await executor.executeFetch(invocation)+ expect(result.error).toBeUndefined()+ expect(result.invocation.state.vmState!.stack.slice(-1)[0]).toEqual({ status: 200, body: 'ok' })+ })++ it('is a no-op when ignore config is empty', async () => {+ mockRequest.mockImplementation((req: any, res: any) => {+ res.writeHead(400, { 'Content-Type': 'text/plain' })+ res.end('bad')+ })+ const invocation = await createFetchInvocation({ url: `${baseUrl}/test`, method: 'GET' })+ setNonFailureConfig(invocation, [])++ const result = await executor.executeFetch(invocation)+ expect(result.error).toBeInstanceOf(Error)+ expect(result.error.message).toContain('status code 400')+ })+ })})describe('isConnectionLevelError', () => {diff --git a/nodejs/src/cdp/services/hog-executor.service.ts b/nodejs/src/cdp/services/hog-executor.service.tsindex 0c338847a036..d4543bf83233 100644--- a/nodejs/src/cdp/services/hog-executor.service.ts+++ b/nodejs/src/cdp/services/hog-executor.service.ts@@ -30,6 +30,7 @@ import { createAddLogFunction, destinationE2eLagMsSummary, sanitizeLogMessage }import { execHog } from '../utils/hog-exec'import { convertToHogFunctionFilterGlobal, filterFunctionInstrumented } from '../utils/hog-function-filtering'import { createInvocation, createInvocationResult } from '../utils/invocation-utils'+import { isNonFailureStatus } from '../utils/non-failure-status-codes'import { HogInputsService } from './hog-inputs.service'import { EmailService } from './messaging/email.service'import { RecipientTokensService } from './messaging/recipient-tokens.service'@@ -682,6 +683,17 @@ export class HogExecutorService {result.invocation.state.attempts++if (!fetchResponse || (fetchResponse?.status && fetchResponse.status >= 400)) {+ const nonFailureSchemaEntry = invocation.hogFunction.inputs_schema?.find(+ (s) => s.type === 'non_failure_status_codes'+ )+ const nonFailureConfig = nonFailureSchemaEntry+ ? (invocation.hogFunction.inputs?.[nonFailureSchemaEntry.key]?.value as+ | Array<number | string>+ | null+ | undefined)+ : undefined+ const isNonFailure = isNonFailureStatus(fetchResponse?.status, nonFailureConfig)+const backoffMs = Math.min(this.config.fetchBackoffBaseMs * result.invocation.state.attempts +Math.floor(Math.random() * this.config.fetchBackoffBaseMs),@@ -702,7 +714,7 @@ export class HogExecutorService {message += ` Retrying in ${backoffMs}ms.`}- addLog('error', message)+ addLog(isNonFailure ? 'info' : 'error', message)const maxRetries = options?.maxFetchRetries ?? this.config.fetchRetriesif (canRetry && result.invocation.state.attempts < maxRetries) {@@ -713,7 +725,7 @@ export class HogExecutorService {result.invocation.queueScheduledAt = DateTime.utc().plus({ milliseconds: backoffMs })return result- } else {+ } else if (!isNonFailure) {result.error = new Error(message)}}diff --git a/nodejs/src/cdp/services/hogflows/actions/hog_function.test.ts b/nodejs/src/cdp/services/hogflows/actions/hog_function.test.tsindex 1d64bd8820c8..729498d9f09f 100644--- a/nodejs/src/cdp/services/hogflows/actions/hog_function.test.ts+++ b/nodejs/src/cdp/services/hogflows/actions/hog_function.test.ts@@ -373,4 +373,61 @@ describe('HogFunctionHandler', () => {expect(invocationResult.logs).toHaveLength(1)expect(invocationResult.logs[0].message).toContain('Recipient has opted out')})++ describe('non_failure_status_codes propagation', () => {+ it('propagates non_failure_status_codes from action.config.inputs into the synthetic hog function', async () => {+ const templateWithNonFailure = await insertHogFunctionTemplate(hub.postgres, {+ id: 'template-test-hogflow-non-failure-status',+ name: 'Test Template With Non-Failure Codes',+ code: `fetch('http://localhost/test', { 'method': 'POST', 'body': {} })`,+ inputs_schema: [+ {+ key: 'non_failure_status_codes',+ type: 'non_failure_status_codes',+ required: false,+ },+ ],+ })++ const hogFlow = new FixtureHogFlowBuilder()+ .withTeamId(team.id)+ .withWorkflow({+ actions: {+ function: {+ type: 'function',+ config: {+ template_id: templateWithNonFailure.template_id,+ inputs: {+ non_failure_status_codes: {+ value: ['4xx', 500],+ },+ },+ },+ },+ exit: {+ type: 'exit',+ config: {},+ },+ },+ edges: [{ from: 'function', to: 'exit', type: 'continue' }],+ })+ .build()++ const flowAction = findActionByType(hogFlow, 'function')!++ const builtHogFunction = await mockHogFlowFunctionsService.buildHogFunction(hogFlow, flowAction.config)++ expect(builtHogFunction.inputs_schema).toEqual(+ expect.arrayContaining([+ expect.objectContaining({+ key: 'non_failure_status_codes',+ type: 'non_failure_status_codes',+ }),+ ])+ )+ expect(builtHogFunction.inputs?.non_failure_status_codes).toEqual({+ value: ['4xx', 500],+ })+ })+ })})diff --git a/nodejs/src/cdp/types.ts b/nodejs/src/cdp/types.tsindex 30150322980d..69637ff9d441 100644--- a/nodejs/src/cdp/types.ts+++ b/nodejs/src/cdp/types.ts@@ -360,6 +360,7 @@ export type HogFunctionInputSchemaType = {| 'posthog_assignee'| 'posthog_ticket_tags'| 'posthog_business_hours'+ | 'non_failure_status_codes'key: stringlabel?: stringchoices?: { value: string; label: string }[]diff --git a/nodejs/src/cdp/utils/non-failure-status-codes.test.ts b/nodejs/src/cdp/utils/non-failure-status-codes.test.tsnew file mode 100644index 000000000000..a8f106bd3436--- /dev/null+++ b/nodejs/src/cdp/utils/non-failure-status-codes.test.ts@@ -0,0 +1,84 @@+import { isNonFailureStatus } from './non-failure-status-codes'++describe('isNonFailureStatus', () => {+ describe('exact numeric matches', () => {+ it.each([+ [400, [400], true],+ [400, [400, 429], true],+ [429, [400, 429], true],+ [400, [401], false],+ [200, [200], true],+ [500, [500], true],+ ])('status %p in %p => %p', (status, config, expected) => {+ expect(isNonFailureStatus(status, config)).toBe(expected)+ })+ })++ describe('wildcard matches', () => {+ it.each([+ [400, ['4xx'], true],+ [404, ['4xx'], true],+ [499, ['4xx'], true],+ [500, ['4xx'], false],+ [399, ['4xx'], false],+ [500, ['5xx'], true],+ [599, ['5xx'], true],+ [400, ['5xx'], false],+ // Only 4xx and 5xx wildcards are supported — non-failure config is irrelevant outside the error range.+ [100, ['1xx'], false],+ [200, ['2xx'], false],+ [301, ['3xx'], false],+ ])('status %p in %p => %p', (status, config, expected) => {+ expect(isNonFailureStatus(status, config)).toBe(expected)+ })+ })++ describe('mixed wildcards and numbers', () => {+ it('matches a 4xx via wildcard and a specific 500', () => {+ expect(isNonFailureStatus(404, ['4xx', 500])).toBe(true)+ expect(isNonFailureStatus(500, ['4xx', 500])).toBe(true)+ expect(isNonFailureStatus(502, ['4xx', 500])).toBe(false)+ })++ it('matches when only one entry hits', () => {+ expect(isNonFailureStatus(429, [400, '5xx'])).toBe(false)+ expect(isNonFailureStatus(503, [400, '5xx'])).toBe(true)+ })+ })++ describe('empty / missing config', () => {+ it.each([+ [400, null],+ [400, undefined],+ [400, []],+ ])('status %p with config %p returns false', (status, config) => {+ expect(isNonFailureStatus(status, config as any)).toBe(false)+ })+ })++ describe('missing status', () => {+ it('returns false when status is undefined', () => {+ expect(isNonFailureStatus(undefined, ['4xx', 500])).toBe(false)+ })+ })++ describe('invalid entries are silently dropped', () => {+ it.each([+ [400, ['foo', 400], true],+ [400, ['9xx', '4xx'], true],+ [400, [-1, 1000, 400], true],+ [400, ['abc', null, undefined, 400], true],+ [400, ['foo', 'bar'], false],+ [400, [-1, 1000], false],+ ])('status %p with config %p => %p', (status, config, expected) => {+ expect(isNonFailureStatus(status, config as any)).toBe(expected)+ })+ })++ describe('case insensitivity for wildcards', () => {+ it('accepts 4XX as well as 4xx', () => {+ expect(isNonFailureStatus(404, ['4XX'])).toBe(true)+ expect(isNonFailureStatus(404, ['4Xx'])).toBe(true)+ })+ })+})diff --git a/nodejs/src/cdp/utils/non-failure-status-codes.ts b/nodejs/src/cdp/utils/non-failure-status-codes.tsnew file mode 100644index 000000000000..7f277b7598d1--- /dev/null+++ b/nodejs/src/cdp/utils/non-failure-status-codes.ts@@ -0,0 +1,27 @@+const WILDCARD_PATTERN = /^([4-5])xx$/i++export function isNonFailureStatus(+ status: number | undefined,+ config: Array<number | string> | null | undefined+): boolean {+ if (typeof status !== 'number' || !Array.isArray(config) || config.length === 0) {+ return false+ }++ for (const entry of config) {+ if (typeof entry === 'number' && Number.isInteger(entry) && entry === status) {+ return true+ }+ if (typeof entry === 'string') {+ const match = WILDCARD_PATTERN.exec(entry)+ if (match) {+ const rangeStart = parseInt(match[1], 10) * 100+ if (status >= rangeStart && status < rangeStart + 100) {+ return true+ }+ }+ }+ }++ return false+}diff --git a/posthog/cdp/test/test_validation.py b/posthog/cdp/test/test_validation.pyindex 2b07c81ea07c..8b1717c849d6 100644--- a/posthog/cdp/test/test_validation.py+++ b/posthog/cdp/test/test_validation.py@@ -606,3 +606,60 @@ class TestHogFunctionValidation(ClickhouseTestMixin, APIBaseTest, QueryMatchingTassert "bracket notation" in error_msgelse:compile_hog(hog_code, "destination")++ def test_non_failure_status_codes_schema_type_is_valid(self):+ inputs_schema = [+ {+ "key": "non_failure_status_codes",+ "type": "non_failure_status_codes",+ "label": "Ignored response codes",+ "required": False,+ }+ ]+ validated = validate_inputs_schema(inputs_schema)+ assert validated[0]["type"] == "non_failure_status_codes"+ assert validated[0]["key"] == "non_failure_status_codes"++ @parameterized.expand(+ [+ ("exact_numbers", [400, 429]),+ ("wildcards", ["4xx", "5xx"]),+ ("mixed", ["4xx", 500]),+ ("single_number", [400]),+ ("single_wildcard", ["4xx"]),+ ("empty_list", []),+ ]+ )+ def test_validate_non_failure_status_codes_accepts_valid_values(self, _name, value):+ inputs_schema = [{"key": "non_failure_status_codes", "type": "non_failure_status_codes", "required": False}]+ inputs = {"non_failure_status_codes": {"value": value}}+ validated = validate_inputs(inputs_schema, inputs)+ # Empty list short-circuits (falsy value path), but anything truthy round-trips intact+ if value:+ assert validated["non_failure_status_codes"]["value"] == value++ @parameterized.expand(+ [+ ("non_list_string", "4xx"),+ ("non_list_number", 400),+ ("non_list_dict", {"foo": "bar"}),+ ("invalid_wildcard_9xx", ["9xx"]),+ ("informational_wildcard_1xx", ["1xx"]),+ ("success_wildcard_2xx", ["2xx"]),+ ("redirect_wildcard_3xx", ["3xx"]),+ ("invalid_string", ["foo"]),+ ("out_of_range_low_negative", [-1]),+ ("out_of_range_low_below_400", [200]),+ ("out_of_range_low_399", [399]),+ ("out_of_range_high", [1000]),+ ("mixed_invalid", [400, "9xx"]),+ ("mixed_with_2xx", [500, "2xx"]),+ ("float_value", [400.5]),+ ("bool_value", [True]),+ ]+ )+ def test_validate_non_failure_status_codes_rejects_invalid_values(self, _name, value):+ inputs_schema = [{"key": "non_failure_status_codes", "type": "non_failure_status_codes", "required": False}]+ inputs = {"non_failure_status_codes": {"value": value}}+ with self.assertRaises(ValidationError):+ validate_inputs(inputs_schema, inputs)diff --git a/posthog/cdp/validation.py b/posthog/cdp/validation.pyindex cd93a80617e1..9ad3734ec021 100644--- a/posthog/cdp/validation.py+++ b/posthog/cdp/validation.py@@ -1,3 +1,4 @@+import reimport jsonimport loggingfrom typing import Any, Optional@@ -221,6 +222,7 @@ class InputsSchemaItemSerializer(serializers.Serializer):"posthog_assignee","posthog_ticket_tags","posthog_business_hours",+ "non_failure_status_codes",])key = serializers.CharField()@@ -312,6 +314,20 @@ class InputsItemSerializer(serializers.Serializer):if not value.get("text") and not value.get("html"):raise serializers.ValidationError({"input": f"Either 'text' or 'html' is required."})+ elif item_type == "non_failure_status_codes":+ if not isinstance(value, list):+ raise serializers.ValidationError({"input": "Value must be a list of status codes."})+ for entry in value:+ if isinstance(entry, bool) or not isinstance(entry, int | str):+ raise serializers.ValidationError(+ {"input": "Entries must be integers between 400 and 599 or wildcards '4xx' or '5xx'."}+ )+ if isinstance(entry, int):+ if not (400 <= entry <= 599):+ raise serializers.ValidationError({"input": "Status code numbers must be between 400 and 599."})+ else:+ if not re.fullmatch(r"[4-5]xx", entry, re.IGNORECASE):+ raise serializers.ValidationError({"input": "Wildcards must be '4xx' or '5xx'."})try:if value and schema.get("templating", True):diff --git a/products/cdp/frontend/generated/api.schemas.ts b/products/cdp/frontend/generated/api.schemas.tsindex 72b6662f13ff..42e5cba70b65 100644--- a/products/cdp/frontend/generated/api.schemas.ts+++ b/products/cdp/frontend/generated/api.schemas.ts@@ -259,6 +259,7 @@ export const HogFunctionTypeEnumApi = {* `posthog_assignee` - posthog_assignee* `posthog_ticket_tags` - posthog_ticket_tags* `posthog_business_hours` - posthog_business_hours+ * `non_failure_status_codes` - non_failure_status_codes*/export type InputsSchemaItemTypeEnumApi = (typeof InputsSchemaItemTypeEnumApi)[keyof typeof InputsSchemaItemTypeEnumApi]@@ -276,6 +277,7 @@ export const InputsSchemaItemTypeEnumApi = {PosthogAssignee: 'posthog_assignee',PosthogTicketTags: 'posthog_ticket_tags',PosthogBusinessHours: 'posthog_business_hours',+ NonFailureStatusCodes: 'non_failure_status_codes',} as constexport type InputsSchemaItemApiChoicesItem = { [key: string]: unknown }diff --git a/products/cdp/frontend/generated/api.zod.ts b/products/cdp/frontend/generated/api.zod.tsindex 9f634d0af0db..582f661414e5 100644--- a/products/cdp/frontend/generated/api.zod.ts+++ b/products/cdp/frontend/generated/api.zod.ts@@ -75,9 +75,10 @@ export const HogFunctionsCreateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours'+ '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours\n\* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -171,9 +172,10 @@ export const HogFunctionsCreateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours'+ '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours\n\* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -317,9 +319,10 @@ export const HogFunctionsUpdateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours'+ '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours\n\* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -413,9 +416,10 @@ export const HogFunctionsUpdateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours'+ '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours\n\* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -559,9 +563,10 @@ export const HogFunctionsPartialUpdateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours'+ '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours\n\* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -655,9 +660,10 @@ export const HogFunctionsPartialUpdateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours'+ '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours\n\* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -805,9 +811,10 @@ export const HogFunctionsEnableBackfillsCreateBody = /* @__PURE__ */ zod.object('posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours'+ '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours\n\* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -901,9 +908,10 @@ export const HogFunctionsEnableBackfillsCreateBody = /* @__PURE__ */ zod.object('posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours'+ '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours\n\* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -1121,9 +1129,10 @@ export const HogFunctionsInvocationsCreateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours'+ '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours\n\* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -1226,9 +1235,10 @@ export const HogFunctionsInvocationsCreateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours'+ '\* `string` - string\n\* `number` - number\n\* `boolean` - boolean\n\* `dictionary` - dictionary\n\* `choice` - choice\n\* `json` - json\n\* `integration` - integration\n\* `integration_field` - integration_field\n\* `email` - email\n\* `native_email` - native_email\n\* `posthog_assignee` - posthog_assignee\n\* `posthog_ticket_tags` - posthog_ticket_tags\n\* `posthog_business_hours` - posthog_business_hours\n\* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),diff --git a/products/workflows/frontend/Workflows/hogflows/steps/types.ts b/products/workflows/frontend/Workflows/hogflows/steps/types.tsindex 25588e52bba6..6ffe2bae8104 100644--- a/products/workflows/frontend/Workflows/hogflows/steps/types.ts+++ b/products/workflows/frontend/Workflows/hogflows/steps/types.ts@@ -71,6 +71,7 @@ export const CyclotronJobInputSchemaTypeSchema = z.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]),key: z.string(),label: z.string(),diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 935427162678..53de05f6f78b 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -19072,6 +19072,7 @@ export namespace Schemas {* `posthog_assignee` - posthog_assignee* `posthog_ticket_tags` - posthog_ticket_tags* `posthog_business_hours` - posthog_business_hours+ * `non_failure_status_codes` - non_failure_status_codes*/export type InputsSchemaItemTypeEnum = typeof InputsSchemaItemTypeEnum[keyof typeof InputsSchemaItemTypeEnum];@@ -19090,6 +19091,7 @@ export namespace Schemas {PosthogAssignee: 'posthog_assignee',PosthogTicketTags: 'posthog_ticket_tags',PosthogBusinessHours: 'posthog_business_hours',+ NonFailureStatusCodes: 'non_failure_status_codes',} as const;export type InputsSchemaItemChoicesItem = { [key: string]: unknown };diff --git a/services/mcp/src/generated/cdp_functions/api.ts b/services/mcp/src/generated/cdp_functions/api.tsindex 33ce609c8e22..6577fae2e2f0 100644--- a/services/mcp/src/generated/cdp_functions/api.ts+++ b/services/mcp/src/generated/cdp_functions/api.ts@@ -100,9 +100,10 @@ export const HogFunctionsCreateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours'+ '* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -191,9 +192,10 @@ export const HogFunctionsCreateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours'+ '* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -345,9 +347,10 @@ export const HogFunctionsPartialUpdateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours'+ '* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -436,9 +439,10 @@ export const HogFunctionsPartialUpdateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours'+ '* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -664,9 +668,10 @@ export const HogFunctionsInvocationsCreateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours'+ '* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),@@ -769,9 +774,10 @@ export const HogFunctionsInvocationsCreateBody = /* @__PURE__ */ zod.object({'posthog_assignee','posthog_ticket_tags','posthog_business_hours',+ 'non_failure_status_codes',]).describe(- '* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours'+ '* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes'),key: zod.string(),label: zod.string().optional(),diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/cdp-functions-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/cdp-functions-create.jsonindex 82d7f0d21c07..a8fab38e00b9 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/cdp-functions-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/cdp-functions-create.json@@ -174,7 +174,7 @@]},"type": {- "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours",+ "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes","enum": ["string","number",@@ -188,7 +188,8 @@"native_email","posthog_assignee","posthog_ticket_tags",- "posthog_business_hours"+ "posthog_business_hours",+ "non_failure_status_codes"],"type": "string"}@@ -332,7 +333,7 @@]},"type": {- "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours",+ "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes","enum": ["string","number",@@ -346,7 +347,8 @@"native_email","posthog_assignee","posthog_ticket_tags",- "posthog_business_hours"+ "posthog_business_hours",+ "non_failure_status_codes"],"type": "string"}diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/cdp-functions-invocations-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/cdp-functions-invocations-create.jsonindex 78d31ff80392..55d101bac6e0 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/cdp-functions-invocations-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/cdp-functions-invocations-create.json@@ -314,7 +314,7 @@]},"type": {- "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours",+ "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes","enum": ["string","number",@@ -328,7 +328,8 @@"native_email","posthog_assignee","posthog_ticket_tags",- "posthog_business_hours"+ "posthog_business_hours",+ "non_failure_status_codes"],"type": "string"}@@ -492,7 +493,7 @@]},"type": {- "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours",+ "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes","enum": ["string","number",@@ -506,7 +507,8 @@"native_email","posthog_assignee","posthog_ticket_tags",- "posthog_business_hours"+ "posthog_business_hours",+ "non_failure_status_codes"],"type": "string"}diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/cdp-functions-partial-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/cdp-functions-partial-update.jsonindex cb19bf59edc3..78d73fb1f890 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/cdp-functions-partial-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/cdp-functions-partial-update.json@@ -178,7 +178,7 @@]},"type": {- "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours",+ "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes","enum": ["string","number",@@ -192,7 +192,8 @@"native_email","posthog_assignee","posthog_ticket_tags",- "posthog_business_hours"+ "posthog_business_hours",+ "non_failure_status_codes"],"type": "string"}@@ -336,7 +337,7 @@]},"type": {- "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours",+ "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes","enum": ["string","number",@@ -350,7 +351,8 @@"native_email","posthog_assignee","posthog_ticket_tags",- "posthog_business_hours"+ "posthog_business_hours",+ "non_failure_status_codes"],"type": "string"}