Skip to content

Require full reasoning params when adding nodes#407

Merged
zhongkaifu merged 2 commits into
mainfrom
codex/validate-required-fields-for-reasoning-node
Jan 25, 2026
Merged

Require full reasoning params when adding nodes#407
zhongkaifu merged 2 commits into
mainfrom
codex/validate-required-fields-for-reasoning-node

Conversation

@zhongkaifu
Copy link
Copy Markdown
Owner

Motivation

  • Ensure reasoning nodes always include the full set of parameters the executor and planner expect so LLM-driven nodes are well-specified and predictable.
  • Surface clear validation errors when a reasoning node is created with missing fields to guide callers to supply complete prompts, context, expected output schema and toolset.

Description

  • Updated the reasoning params schema in velvetflow/planner/params_tools.py to mark system_prompt, task_prompt, context, expected_output_format, and toolset as required in _reasoning_params_schema.
  • Added runtime validation in add_reasoning_node in velvetflow/planner/structure.py to detect empty or missing reasoning fields and return a structured validation error listing missing_fields, required_fields, and required_out_params_schema (which must match expected_output_format).
  • The validation error message was clarified to call out that out_params_schema must align with expected_output_format.

Testing

  • No automated tests were run as part of this change.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d3572a488

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1449 to +1453
missing_reasoning_fields.append(field)
elif isinstance(value, str) and not value.strip():
missing_reasoning_fields.append(field)
elif isinstance(value, (list, dict)) and not value:
missing_reasoning_fields.append(field)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow empty context/toolset for reasoning nodes

The new validation treats any empty list/dict/blank string as “missing” for all required reasoning fields, so toolset: [] or context: {} now causes add_reasoning_node to reject nodes that intentionally have no tools or no context. This is a regression because the executor already tolerates toolset being empty (it resolves to no tools) and can build prompts without context; workflows that previously created tool-free or context-free reasoning nodes will now fail validation even though they still execute correctly.

Useful? React with 👍 / 👎.

@zhongkaifu zhongkaifu merged commit 5153384 into main Jan 25, 2026
1 check failed
@zhongkaifu zhongkaifu deleted the codex/validate-required-fields-for-reasoning-node branch January 25, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant