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.
73 lines
1.7 KiB
JSON
73 lines
1.7 KiB
JSON
{
|
|
"source": "golden/notion/tools",
|
|
"tools": [
|
|
{
|
|
"name": "notion_fetch_page",
|
|
"description": "Fetch a Notion page.",
|
|
"input_schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"page": {
|
|
"$ref": "#/$defs/Page%20Ref"
|
|
},
|
|
"filter": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"$ref": "#/$defs/Filter"
|
|
}
|
|
},
|
|
"content_mode": {
|
|
"description": "How much content to return.",
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"enum": [
|
|
"summary",
|
|
"full"
|
|
]
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"$defs": {
|
|
"Page Ref": {
|
|
"type": "string",
|
|
"description": "Notion page ID or URL."
|
|
},
|
|
"Filter": {
|
|
"type": "object",
|
|
"description": "Filter object.",
|
|
"properties": {
|
|
"created_by": {
|
|
"type": "string",
|
|
"description": "Creator user ID."
|
|
}
|
|
}
|
|
},
|
|
"UnusedDatabase": {
|
|
"type": "object",
|
|
"description": "Unreachable Notion database schema."
|
|
}
|
|
}
|
|
},
|
|
"expected_preserved": [
|
|
{
|
|
"pointer": "/properties/page/$ref",
|
|
"value": "#/$defs/Page%20Ref"
|
|
},
|
|
{
|
|
"pointer": "/properties/content_mode/anyOf/0/enum/0",
|
|
"value": "summary"
|
|
}
|
|
],
|
|
"expected_pruned": [
|
|
"/$defs/UnusedDatabase"
|
|
],
|
|
"expected_dropped_fields": []
|
|
}
|
|
]
|
|
}
|