Skip to content

Detect isolated nodes in finalize_workflow and prompt remediation#358

Open
zhongkaifu wants to merge 1 commit into
mainfrom
codex/check-for-isolated-nodes-after-workflow-finalize
Open

Detect isolated nodes in finalize_workflow and prompt remediation#358
zhongkaifu wants to merge 1 commit into
mainfrom
codex/check-for-isolated-nodes-after-workflow-finalize

Conversation

@zhongkaifu
Copy link
Copy Markdown
Owner

Motivation

  • Ensure workflows submitted via finalize_workflow are not leaving behind truly isolated nodes (zero indegree and zero outdegree) that likely indicate missing bindings.
  • Prompt the planner/LLM to analyze and fix nodes that should reference other node fields rather than silently accepting orphaned nodes.
  • Provide actionable feedback so authors can use update tools to add params, depends_on, or branch targets to form connections.
  • Improve gating so finalization requires explicit resolution or justification of isolated nodes.

Description

  • Add a new helper _find_isolated_nodes(workflow) which computes indegree/outdegree using infer_edges_from_bindings and returns nodes with zero in/out degree.
  • Add _build_isolated_nodes_feedback_message to generate human/LLM-readable guidance about isolated nodes and suggested remediation tools like update_action_node, update_condition_node, and update_loop_node.
  • Update the planner system prompt to mention that finalize_workflow will check for isolated nodes and instruct authors to fix them before finalizing.
  • Modify finalize_workflow to call the new detection, include isolated_nodes in the returned payload, append isolation feedback to feedback, and mark should_continue when isolation review is required.

Testing

  • No automated tests were executed for this change.
  • Static checks and type expectations were not run as part of this PR.
  • Manual lint/formatting checks were not run as part of this PR.
  • Further CI/test runs should be added to validate detection behavior and integration with LLM-driven remediation tools.

Codex Task

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