Merge branch 'codex/tool-json-schema-dsl' into codex/canonical-tool-output

# Conflicts:
#	packages/core/tools/src/schema.ts
This commit is contained in:
Tianyi Cui
2026-07-21 21:44:00 +08:00
7 changed files with 75 additions and 11 deletions
+19
View File
@@ -1807,6 +1807,25 @@ describe('defineTool validation (the runtime-validation Agent Note, part 1)', ()
})
describe('defineTool presentation (presentCall / presentResult)', () => {
it('preserves inline enum and const literals in inferred arguments', () => {
defineTool({
name: 'literal-args',
description: 'literal arguments',
parameters: {
mode: { type: 'string', enum: ['read', 'write'], required: true },
attempt: { type: 'integer', const: 1 },
},
output: {
schema: { type: 'null' },
render: () => [],
},
async execute(args) {
expectTypeOf(args).toEqualTypeOf<{ mode: 'read' | 'write'; attempt?: 1 }>()
return null
},
})
})
it('threads presentCall/presentResult onto the ToolDefinition with typed args', () => {
const tool = defineContentToolFixture({
name: 'demo',