Skip to content

Remove finalize_workflow tool and run coverage checks after agent with iterative reruns#362

Open
zhongkaifu wants to merge 11 commits into
mainfrom
codex/update-structure.py-to-remove-finalize_workflow
Open

Remove finalize_workflow tool and run coverage checks after agent with iterative reruns#362
zhongkaifu wants to merge 11 commits into
mainfrom
codex/update-structure.py-to-remove-finalize_workflow

Conversation

@zhongkaifu
Copy link
Copy Markdown
Owner

Motivation

  • Move coverage and dependency checks out of the agent-invokable tool so the system can run checks after each agent run and drive further planning externally.
  • Allow automatic iterative re-runs of the planner when coverage or dependency issues are detected, driven by structured feedback.
  • Simplify agent toolset by removing the finalize_workflow function and avoid relying on the agent to call a finalize tool.

Description

  • Removed the finalize_workflow function_tool and removed it from the agent tools list in velvetflow/planner/structure.py.
  • Added post-run logic that calls _run_coverage_check after each agent execution and, when issues exist, constructs feedback and iteratively reruns the agent using a helper _run_agent until coverage/dependency limits (max_coverage_refine_rounds / max_dependency_refine_rounds) are reached.
  • Updated prompt and feedback text by changing _build_coverage_feedback_message and _build_dependency_feedback_message wording and adjusting the system prompt guidance to instruct the agent to stop calling tools when structure is done.
  • Removed finalized_state usage, introduced coverage_refines/dependency_refines counters, and fallback to _prepare_skeleton_for_coverage when no latest skeleton is available.

Testing

  • No automated tests were run as part of this change.
  • The modified file is velvetflow/planner/structure.py and changes were validated by static inspection only.

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