fix(chat-tools): canonical JSON Schema across inc/Api/Chat/Tools/#1923
Merged
Conversation
Convert all 31 chat tool definitions in inc/Api/Chat/Tools/ from the legacy property-keyed parameter shape to canonical JSON Schema. DM 0.106.1 PR #1900 ("Require canonical AI tool schemas") removed RequestBuilder::normalizeToolParameters auto-normalization. Tool registrations now go to OpenAI as the schema literal, so chat tools that still emit the legacy {name => {type, required: true|false, description}} shape would fail provider validation post-0.106.1. Conversion rules (identical to Extra-Chill/data-machine-events#232): 1. Wrap properties under { type: 'object', properties: {...} }. 2. Move required => true properties into a top-level required[] array. 3. Drop required => false entirely (no-op). 4. Omit required key when no required properties (no empty array). 5. Every type: array property declares an items schema (OpenAI strict mode). 6. Preserve description, enum, and other property keys verbatim. Closes part of #1921. Refs: Extra-Chill/data-machine-events#232 (chat tools precedent) Refs: Extra-Chill/data-machine-events#235 (handler-tool merge precedent)
Contributor
Homeboy Results —
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
DM 0.106.1 PR #1900 ("Require canonical AI tool schemas") removed the auto-normalization layer in
RequestBuilder::normalizeToolParameters. Tool registrations now go to OpenAI as the schema literal — anything still emitting the legacy{name => {type, required: true|false, description}}shape gets rejected by provider strict-mode validation.This PR sweeps all chat tools in
inc/Api/Chat/Tools/. Two parallel PRs cover the other in-scope buckets identified by issue #1921: Global tools (inc/Engine/AI/Tools/Global/) and handler tools (inc/Core/Steps/Publish/Handlers/{WordPress,Email}/). This PR stays out of those directories.Closes part of #1921.
What changed
Converted 31 chat tool definitions from the legacy shape:
…to canonical JSON Schema:
Files
inc/Api/Chat/Tools/AddPipelineStep.phpinc/Api/Chat/Tools/ApiQuery.phpinc/Api/Chat/Tools/AssignTaxonomyTerm.phpinc/Api/Chat/Tools/AuthenticateHandler.phpinc/Api/Chat/Tools/ConfigureFlowSteps.phpinc/Api/Chat/Tools/ConfigurePipelineStep.phpinc/Api/Chat/Tools/CopyFlow.phpinc/Api/Chat/Tools/CreateFlow.phpinc/Api/Chat/Tools/CreatePipeline.phpinc/Api/Chat/Tools/CreateTaxonomyTerm.phpinc/Api/Chat/Tools/DeleteFile.phpinc/Api/Chat/Tools/DeleteFlow.phpinc/Api/Chat/Tools/DeletePipeline.phpinc/Api/Chat/Tools/DeletePipelineStep.phpinc/Api/Chat/Tools/ExecuteWorkflowTool.phpinc/Api/Chat/Tools/GetHandlerDefaults.phpinc/Api/Chat/Tools/GetProblemFlows.phpinc/Api/Chat/Tools/ListFlows.phpinc/Api/Chat/Tools/ManageJobs.phpinc/Api/Chat/Tools/ManageLogs.phpinc/Api/Chat/Tools/ManageQueue.phpinc/Api/Chat/Tools/MergeTaxonomyTerms.phpinc/Api/Chat/Tools/ReadLogs.phpinc/Api/Chat/Tools/ReorderPipelineSteps.phpinc/Api/Chat/Tools/RunFlow.phpinc/Api/Chat/Tools/SearchTaxonomyTerms.phpinc/Api/Chat/Tools/SendPing.phpinc/Api/Chat/Tools/SetHandlerDefaults.phpinc/Api/Chat/Tools/SystemHealthCheck.phpinc/Api/Chat/Tools/UpdateFlow.phpinc/Api/Chat/Tools/UpdateTaxonomyTerm.phpSchedulingDocumentation.phpis a helper class with no tool parameters and was not modified.Conversion rules applied
Identical to the rules used in Extra-Chill/data-machine-events#232 / #235:
{ type: 'object', properties: {...} }.required => trueinto a top-levelrequired[]string list.required => falseentirely (it was a no-op).requiredkey when no properties are required (don't emit empty arrays).type: arrayproperty declares anitemsschema (required by OpenAI strict tool-schema validation, see MEMORY.md). Choices made:step_order,pipelines,steps(workflow steps),flows,flow_configs,updates,requests→items: { type: object }(arrays of structured objects)disabled_tools,tool_categories,flow_step_ids,types(health-check types) →items: { type: string }(string lists)post_ids(AssignTaxonomyTerm) →items: { type: integer }(post ID list)description,enum) preserved verbatim.Required fields summary
ListFlows,GetProblemFlows,GetHandlerDefaults,ReadLogs,SystemHealthCheck,CreatePipeline,CreateFlow,ConfigureFlowSteps,ApiQuery(validated at handler level — multiple selection modes)action:ManageQueue,ManageJobs,ManageLogs,AuthenticateHandlerflow_id:DeleteFlow,UpdateFlow,RunFlowpipeline_id:DeletePipelinepipeline_id+step_type:AddPipelineSteppipeline_id+pipeline_step_id:DeletePipelineSteppipeline_id+step_order:ReorderPipelineStepspipeline_step_id:ConfigurePipelineStepsource_flow_id+target_pipeline_id+flow_name:CopyFlowwebhook_url:SendPingfilename:DeleteFilesteps:ExecuteWorkflowTooltaxonomy:SearchTaxonomyTermstaxonomy+name:CreateTaxonomyTermterm+taxonomy:UpdateTaxonomyTermterm+taxonomy+post_ids:AssignTaxonomyTermsource_term+target_term+taxonomy:MergeTaxonomyTermshandler_slug+defaults:SetHandlerDefaultsOut of scope (intentionally)
inc/Engine/AI/Tools/Global/) — handled by parallel PR per issue Sweep legacy tool parameter schemas after PR #1900 normalizer removal #1921.inc/Core/Steps/Publish/Handlers/{WordPress,Email}/) — handled by parallel PR per issue Sweep legacy tool parameter schemas after PR #1900 normalizer removal #1921.argsdefinitions (inc/Api/**non-Chat) — out of scope per issue Sweep legacy tool parameter schemas after PR #1900 normalizer removal #1921 (legitimate WP REST contract).Test plan
php -l) passes on all 31 modified files.homeboy lint --path . --changed-since mainreturns no findings.'required' => true|falsereferences remain ininc/Api/Chat/Tools/.tests/Unit/Api/Chat/Tools/ListFlowsTest.php(only test in this directory) does not pin schema shape — tests behavior viahandle_tool_call, unaffected by parameter schema changes.list_flows,create_flow,manage_jobs,assign_taxonomy_term).Constraints honored
main, no commits tomain.CHANGELOG.mdedits, no version constant bumps — homeboy owns those.inc/Api/Chat/Tools/modified — no Global tools, handler tools, REST API args, settings UI, or Abilities schemas touched.