Skip to content

Normalize planner wire aliases new_tasks, name, and node_id - #32

Open
tanmays369 wants to merge 1 commit into
theschoolofai:mainfrom
tanmays369:fix/planner-new-tasks-alias
Open

tanmays369 wants to merge 1 commit into
theschoolofai:mainfrom
tanmays369:fix/planner-new-tasks-alias

Conversation

@tanmays369

Copy link
Copy Markdown

What breaks

Live planner calls (especially local/open-weight models) often return a next-frontier object that uses new_tasks instead of add, and task entries that use name / node_id instead of capability / id. After the existing repair pass, _parse still 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:

  1. {"new_tasks":[{"name":"answer_with_evidence","arguments":{...}}], ...} — previously raised unsupported/new_tasks failure; now normalizes to add with a generated id.
  2. {"new_tasks":[{"node_id":"clock","capability":"current_datetime",...}], ...} — previously failed missing id; now keeps the provided node id.

Fix

In GeneralAgentPlanner._parse, before the existing capability shorthand / task-keyed adapters:

  • Map new_tasks → add when add is absent.
  • Map task node_id → id, and registry-known name → capability.
  • Synthesize a stable id from capability when still missing.
  • Default empty depends_on for 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.py
  • git diff --check

No credentials, environment files, local databases, or message data are included.

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.
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.

1 participant