Fix validation errors in view_task_steps(), tool methods, and type coercion#1096
Open
Vvkmnn wants to merge 1 commit intoRelevanceAI:mainfrom
Open
Fix validation errors in view_task_steps(), tool methods, and type coercion#1096Vvkmnn wants to merge 1 commit intoRelevanceAI:mainfrom
view_task_steps(), tool methods, and type coercion#1096Vvkmnn wants to merge 1 commit intoRelevanceAI:mainfrom
Conversation
…cion - Content2: accept string requires_confirmation, make fields optional (RelevanceAI#1093) - update_params: strip invalid 'required' from property dicts (RelevanceAI#1093) - PythonCodeTransformation: coerce packages string to list (RelevanceAI#1093) - create_tool: serialize UUID to string (RelevanceAI#1094) - add_tool/remove_tool: handle None actions on fresh agents (RelevanceAI#1094) - add_tool: expose action_behaviour parameter (RelevanceAI#1094) - update_transformations: preserve params_schema (RelevanceAI#1094)
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.
Fixes #1093 and #1094.
Summary
Seven bugs across type models and resource methods that cause crashes or produce invalid data.
Changes
Type validation (#1093)
Content2model (types/task.py):requires_confirmationchanged frombooltoUnion[bool, str];tool_run_state,tool_config,action_details,params,original_message_idsmadeOptional— fixesview_task_steps()ValidationErroron tool-run responsesupdate_params()(resources/tool.py): striprequiredfrom property dicts before adding toparams_schema["properties"]— JSON Schema requiresrequiredas a top-level array, not a boolean inside propertiesPythonCodeTransformation(types/transformations.py): addmodel_validatorto coercepackagesstring to list — platform API rejects strings withmust be arrayvalidation errorResource methods (#1094)
create_tool()(resources/tools.py:52):uuid.uuid4()→str(uuid.uuid4())— fixesTypeError: Object of type UUID is not JSON serializable(async version already correct)add_tool()(resources/agent.py): guard againstNoneactions on fresh agents, exposeaction_behaviourparameter ("always-ask"|"never-ask"|"agent-decide")remove_tool()(resources/agent.py): guard againstNoneactionsupdate_transformations()(resources/tool.py): fetch and include currentparams_schemainbulk_updatebody — prevents silent schema erasure when updating transformations after paramsTesting