Skip to content

fix(orchestrator): guard missing plan blocks - #269

Open
Gujiassh wants to merge 1 commit into
TencentCloudADP:mainfrom
Gujiassh:fix/chain-planner-parse-taskrecorder-261
Open

fix(orchestrator): guard missing plan blocks#269
Gujiassh wants to merge 1 commit into
TencentCloudADP:mainfrom
Gujiassh:fix/chain-planner-parse-taskrecorder-261

Conversation

@Gujiassh

@Gujiassh Gujiassh commented Jul 6, 2026

Copy link
Copy Markdown

Summary

Fixes #261.

Guards the orchestrator chain-plan parser when the model output omits the <plan>...</plan> block, and aligns TaskRecorder.input with its declared str | list[TResponseInputItem] type.

Changes

  • treat a missing <plan>...</plan> block as an empty plan payload instead of calling .group(1) on None
  • preserve the existing assert len(tasks) > 0, "No tasks parsed from plan" failure so malformed plan output reports a clear assertion instead of an AttributeError
  • change TaskRecorder.input from default_factory=dict to default_factory=list
  • add focused regressions for the missing-plan path, the valid-plan path, and the TaskRecorder.input default type

Verification

  • source .venv312/bin/activate && python -m pytest tests/agents/test_orchestrator_chain_regressions.py -q
  • source .venv312/bin/activate && python -m ruff format utu/agents/common.py utu/agents/orchestrator/chain.py tests/agents/test_orchestrator_chain_regressions.py
  • source .venv312/bin/activate && python -m ruff check utu/agents/common.py utu/agents/orchestrator/chain.py tests/agents/test_orchestrator_chain_regressions.py
  • git diff --check

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.

Two small bugs: ChainPlanner._parse crashes on missing <plan> block; TaskRecorder.input wrong default_factory

1 participant