Normalize planner wire aliases new_tasks, name, and node_id - #32
Open
tanmays369 wants to merge 1 commit into
Open
tanmays369 wants to merge 1 commit into
tanmays369 wants to merge 1 commit into
Conversation
Open-weight providers often emit valid next-frontier work under new_tasks with name/node_id instead of add/id/capability, which failed validation after repair and stalled live runs. Accept those wire aliases before the existing strict schema checks.
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.
What breaks
Live planner calls (especially local/open-weight models) often return a next-frontier object that uses
new_tasksinstead ofadd, and task entries that usename/node_idinstead ofcapability/id. After the existing repair pass,_parsestill rejected those shapes as unsupported fields or invalid tasks, so the run stopped with a visible planner failure even though the model proposed usable work.Reproduction
Regression tests feed provider-shaped JSON:
{"new_tasks":[{"name":"answer_with_evidence","arguments":{...}}], ...}— previously raised unsupported/new_tasksfailure; now normalizes toaddwith a generated id.{"new_tasks":[{"node_id":"clock","capability":"current_datetime",...}], ...}— previously failed missingid; now keeps the provided node id.Fix
In
GeneralAgentPlanner._parse, before the existing capability shorthand / task-keyed adapters:new_tasks→addwhenaddis absent.node_id→id, and registry-knownname→capability.idfrom capability when still missing.depends_onfor otherwise complete task objects.Strict capability registry validation and max-new-task limits are unchanged.
Test plan
uv run pytest tests/test_general_planner.py -q(22 passed)uv run ruff check s16code/planner.py tests/test_general_planner.pygit diff --checkNo credentials, environment files, local databases, or message data are included.