Skip to content

fix(flows): retry malformed structured answers once - #524

Open
kuafuwang wants to merge 1 commit into
humanfia:mainfrom
kuafuwang:fix/structured-output-retry
Open

kuafuwang wants to merge 1 commit into
humanfia:mainfrom
kuafuwang:fix/structured-output-retry

Conversation

@kuafuwang

Copy link
Copy Markdown

Summary

  • Retry malformed structured answers once with the validation error fed back, preserving STOP hooks, steering, over/interrupted behavior and accounting.
  • Keep raw answers in existing session event logs; never silently repair, truncate or accept invalid JSON.
  • Add regression tests and update the flow docs.

Validation

  • uv run pytest tests/unit/runtime/flowing/test_harnesses.py tests/unit/flows/builtin/test_rlar.py — 74 passed.
  • uv run ruff check and uv run ruff format --check — passed.
  • uv run pyright tests/unit/runtime/flowing/test_harnesses.py — 0 errors.
  • uv build --no-sources and uv tool run twine check --strict dist/* — passed.
  • Full uv run pytest: 6691 passed, 15 failed + 1 error. The same optional-dependency/Docker/network failures reproduce on main (14 failed + 1 error in the baseline subset); test_agents_fallback also passes in isolation. No new failure was identified in the changed area.
  • uv run pre-commit run --all-files could not initialize because the local LibreSSL/TLS stack could not fetch the GitHub hook repositories. The equivalent ruff, pyright and build checks above passed.

No real models, GPU/NPU, or paid system tests were run.

@kuafuwang
kuafuwang requested a review from futrime as a code owner October 26, 2026 11:53

This branch has not been deployed

No deployments
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