: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
fix(mcp): raise search pattern limit to 400 chars (#69312)
Georgiy Tarasova4442976cca2
diff --git a/services/mcp/src/tools/exec.ts b/services/mcp/src/tools/exec.tsindex 3d8da7885cdc..24e95f0e4c18 100644--- a/services/mcp/src/tools/exec.ts+++ b/services/mcp/src/tools/exec.ts@@ -20,7 +20,7 @@ import {/** Upper bound on a `search` regex pattern — keeps a pathological pattern from* forcing catastrophic backtracking against tool metadata. */-const MAX_SEARCH_PATTERN_LENGTH = 200+const MAX_SEARCH_PATTERN_LENGTH = 400/** Ranked (plain-word) search can match loosely on a common token like* "create"; cap the returned names so a vague query can't dump the catalog. */diff --git a/services/mcp/tests/unit/exec.test.ts b/services/mcp/tests/unit/exec.test.tsindex a6051b1eb612..5c3ac542cc38 100644--- a/services/mcp/tests/unit/exec.test.ts+++ b/services/mcp/tests/unit/exec.test.ts@@ -734,7 +734,7 @@ describe('exec tool', () => {it('rejects an overly long search pattern before compiling the regex', async () => {const exec = createExec([makeMockTool()])- const longPattern = 'a'.repeat(201)+ const longPattern = 'a'.repeat(401)await expect(exec.handler(mockContext, { command: `search ${longPattern}` })).rejects.toThrow(/pattern too long/i)