Skip to content

Commit ee6f368

Browse files
committed
If outputSchema defined, outputMode must be 'json'
1 parent c60f2af commit ee6f368

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

common/src/templates/agent-validation.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,10 @@ export function validateSingleAgent(
226226
}
227227
}
228228
}
229-
// Determine outputMode: default to 'json' if outputSchema is present, otherwise 'last_message'
230-
const outputMode =
231-
template.outputMode ?? (template.outputSchema ? 'json' : 'last_message')
232229

233230
// Convert to internal AgentTemplate format
234231
const agentTemplate: AgentTemplate = {
235232
...template,
236-
displayName: template.displayName,
237-
outputMode,
238233
outputSchema,
239234
inputSchema,
240235
toolNames: template.toolNames as ToolName[],

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ export const DynamicAgentTemplateSchema = DynamicAgentConfigSchema.extend({
158158
})
159159
.refine(
160160
(data) => {
161-
// If outputSchema is provided, outputMode must be 'json' or undefined (will default to 'json')
162-
if (data.outputSchema && data.outputMode && data.outputMode !== 'json') {
161+
// If outputSchema is provided, outputMode must be explicitly set to 'json'
162+
if (data.outputSchema && data.outputMode !== 'json') {
163163
return false
164164
}
165165
return true
166166
},
167167
{
168168
message:
169-
"outputSchema can only be used with outputMode 'json'. Remove outputMode or set it to 'json'.",
169+
"outputSchema requires outputMode to be explicitly set to 'json'.",
170170
path: ['outputMode'],
171171
},
172172
)

0 commit comments

Comments
 (0)