Skip to content

Commit f01d7e3

Browse files
committed
Fix tests
1 parent 7604d9c commit f01d7e3

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

backend/src/__tests__/dynamic-agent-loader.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ describe('Dynamic Agent Loader', () => {
217217
stepPrompt: 'Test step prompt',
218218
inputSchema: {
219219
prompt: {
220-
type: 'string', // Fixed - should allow strings
220+
type: 'number' as any, // Invalid - should only allow strings
221221
},
222222
},
223223
outputMode: 'last_message',

backend/src/__tests__/dynamic-agent-schema-validation.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ describe('Dynamic Agent Schema Validation', () => {
117117
inputSchema: {
118118
prompt: {
119119
type: 'string',
120+
minLength: 1,
120121
description: 'A required prompt',
121122
},
122123
params: {

common/src/types/dynamic-agent-template.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { z } from 'zod'
22
import { ALLOWED_MODEL_PREFIXES, models } from '../constants'
33
import { toolNames } from '../constants/tools'
4-
import type { AgentConfig } from '../templates/agent-template'
4+
import { AgentConfig } from '../util/agent-config'
55

66
// Filter models to only include those that begin with allowed prefixes
77
const filteredModels = Object.values(models).filter((model) =>
@@ -46,7 +46,11 @@ const JsonSchemaSchema: z.ZodType<any> = z.lazy(() =>
4646
const InputSchemaObjectSchema = z
4747
.object({
4848
prompt: z
49-
.object({ type: z.literal('string'), description: z.string().optional() })
49+
.object({
50+
type: z.literal('string'),
51+
description: z.string().optional(),
52+
})
53+
.passthrough()
5054
.optional(), // Optional JSON schema for prompt validation
5155
params: JsonSchemaSchema.optional(), // Optional JSON schema for params validation
5256
})

0 commit comments

Comments
 (0)