mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
10ac2781eb
## Why Before changing the Codex Bridge JSON schema policy, add integration coverage around real connector-like MCP tool schemas. The existing unit tests cover individual sanitizer behaviors, but they do not make it easy to see whether full fixture schemas keep model-visible guidance, prune only unreachable definitions, drop unsupported JSON Schema fields, and stay within the Responses API schema budget. ## What Changed - Added `tools/tests/json_schema_policy_fixtures.rs`, which converts MCP tool fixtures through `mcp_tool_to_responses_api_tool` and validates the resulting Responses tool parameters. - Added connector-style fixtures for Slack, Google Calendar, Google Drive, Notion, and Microsoft Outlook Email under `tools/tests/fixtures/json_schema_policy/`. - Added fixture assertions for preserved guidance, pruned definitions, expected field drops after `JsonSchema` conversion, marker count baselines, and dangling local `$ref` prevention. - Added a real oversized golden Notion `create_page` input schema fixture to exercise the compaction path that strips descriptions, drops root `$defs`, rewrites local refs, and fits the compacted schema under the budget.
86 lines
2.2 KiB
JSON
86 lines
2.2 KiB
JSON
{
|
|
"source": "standard/google_calendar/tools",
|
|
"tools": [
|
|
{
|
|
"name": "google_calendar_create_event",
|
|
"description": "Create a calendar event.",
|
|
"input_schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"event": {
|
|
"$ref": "#/definitions/Event"
|
|
},
|
|
"notify_attendees": {
|
|
"type": "boolean",
|
|
"description": "Whether attendees should receive notifications."
|
|
}
|
|
},
|
|
"required": [
|
|
"event"
|
|
],
|
|
"definitions": {
|
|
"Event": {
|
|
"type": "object",
|
|
"description": "Calendar event payload.",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "Event title."
|
|
},
|
|
"start": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/DateTime"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"DateTime": {
|
|
"type": "object",
|
|
"description": "Calendar date-time.",
|
|
"properties": {
|
|
"dateTime": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "RFC3339 date-time."
|
|
},
|
|
"timeZone": {
|
|
"type": "string",
|
|
"enum": [
|
|
"UTC",
|
|
"America/Los_Angeles"
|
|
],
|
|
"description": "IANA time zone."
|
|
}
|
|
}
|
|
},
|
|
"UnusedCalendarResource": {
|
|
"type": "string",
|
|
"description": "Unreachable calendar resource."
|
|
}
|
|
}
|
|
},
|
|
"expected_preserved": [
|
|
{
|
|
"pointer": "/properties/event/$ref",
|
|
"value": "#/definitions/Event"
|
|
},
|
|
{
|
|
"pointer": "/definitions/DateTime/properties/timeZone/enum/1",
|
|
"value": "America/Los_Angeles"
|
|
}
|
|
],
|
|
"expected_pruned": [
|
|
"/definitions/UnusedCalendarResource"
|
|
],
|
|
"expected_dropped_fields": [
|
|
"/definitions/DateTime/properties/dateTime/format"
|
|
]
|
|
}
|
|
]
|
|
}
|