Skip to content

Fix validation errors in view_task_steps(), tool methods, and type coercion#1096

Open
Vvkmnn wants to merge 1 commit intoRelevanceAI:mainfrom
Vvkmnn:bug/fix-validation-and-tool-methods
Open

Fix validation errors in view_task_steps(), tool methods, and type coercion#1096
Vvkmnn wants to merge 1 commit intoRelevanceAI:mainfrom
Vvkmnn:bug/fix-validation-and-tool-methods

Conversation

@Vvkmnn
Copy link
Copy Markdown

@Vvkmnn Vvkmnn commented Feb 20, 2026

Fixes #1093 and #1094.

Summary

Seven bugs across type models and resource methods that cause crashes or produce invalid data.

Changes

Type validation (#1093)

  • Content2 model (types/task.py): requires_confirmation changed from bool to Union[bool, str]; tool_run_state, tool_config, action_details, params, original_message_ids made Optional — fixes view_task_steps() ValidationError on tool-run responses
  • update_params() (resources/tool.py): strip required from property dicts before adding to params_schema["properties"] — JSON Schema requires required as a top-level array, not a boolean inside properties
  • PythonCodeTransformation (types/transformations.py): add model_validator to coerce packages string to list — platform API rejects strings with must be array validation error

Resource methods (#1094)

  • create_tool() (resources/tools.py:52): uuid.uuid4()str(uuid.uuid4()) — fixes TypeError: Object of type UUID is not JSON serializable (async version already correct)
  • add_tool() (resources/agent.py): guard against None actions on fresh agents, expose action_behaviour parameter ("always-ask" | "never-ask" | "agent-decide")
  • remove_tool() (resources/agent.py): guard against None actions
  • update_transformations() (resources/tool.py): fetch and include current params_schema in bulk_update body — prevents silent schema erasure when updating transformations after params

Testing

  • All 46 existing unit tests pass
  • 18/18 end-to-end tests against live API (Content2 parsing, UUID serialization, null-safe add/remove_tool, action_behaviour, params schema validity, schema preservation, packages coercion, view_task_steps with tool-run responses)

…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

view_task_steps() fails with ValidationError; update_params() produces invalid JSON Schema

1 participant