Skip to content

fix(flow): bind router feedback to its producing invocation - #9591

Draft
Wang guanyu (wang1299) wants to merge 1 commit into
crewAIInc:mainfrom
wang1299:codex/fix-flow-router-feedback-origin
Draft

Wang guanyu (wang1299) wants to merge 1 commit into
crewAIInc:mainfrom
wang1299:codex/fix-flow-router-feedback-origin

Conversation

@wang1299

@wang1299 Wang guanyu (wang1299) commented Nov 20, 2026 •

Copy link
Copy Markdown

Related issue

Fixes #9586

Summary

After human feedback is recorded, an ordinary router can pass that old HumanFeedbackResult to its outcome listeners instead of its own return value. This also affects later kickoffs and pending-feedback recovery.

Carry the optional feedback object from the producing method invocation through the private execution return value. Capture it before persistence/downstream awaits, so another concurrent review cannot replace it. Ordinary routers keep their own payload; real HITL outcomes retain their feedback object and public feedback history stays intact.

This is an alternative to #9590. A method-name check against shared history is insufficient when another review finishes during persistence; comparing the upstream trigger name also loses real listener-based HITL feedback. This change includes behavioral regressions for both cases.

Verification

  • New regressions on unchanged main: 6 failed, 10 passed; on this fix: 16 passed. Covers sync/async, next kickoff, SQLite recovery, actual HITL emit, chained reviews and ordered concurrent persistence.
  • Broader routing, definition, persistence/resumability, checkpoint, HITL, usage, Agent-history and structured-tool selection: 602 passed, 3 failed. The same three failures reproduce on unchanged main: two require the absent Anthropic extra; one requires absent crewai_tools.
  • Separate Python processes with real SQLite: pause, reload via from_pending, then resume completes with INVOICE_READY.
  • Ruff lint/format for changed source and tests: passed. uv build --package crewai wheel/sdist on Python 3.12.16: passed.
  • Strict runtime mypy in the locked core+dev environment: 6 diagnostics caused by absent optional crewai_files types; unchanged main reproduces the same 6 diagnostics on the same lines. Providing the workspace's crewai-files sources via MYPYPATH removes runtime-file diagnostics but reports 13 dependency/stub-related diagnostics in 6 optional-package files. No workspace-wide mypy pass is claimed.
  • Independent read-only review of stable commit 45fe858408f4b47e377b5cb4603fe99a5de4a45e: no blocking substantive findings; this is not maintainer approval.

The same 16 tests against #9590 at 7ed47064e1b224e73c0880784b9dc878c5980645 produce 5 failed, 11 passed (listener HITL, chained reviews and concurrent start reviews). This compares source behavior in the same locked core+dev environment, not that PR's full CI.

  • Tests added or updated for the changed behavior
  • Relevant tests and quality checks pass locally — dependency-limited results above; no full workspace/CI pass claimed.

Additional context

Only private _execute_method and _execute_single_listener return tuples change from two to three elements; external overrides of these private methods may need adaptation. Public APIs and persisted/checkpoint schemas are unchanged. Sibling-route scheduling and broader checkpoint restoration are outside scope.

AI-assisted contribution. The issue's label request returned HTTP 403; please apply the required llm-generated label if the contributor integration cannot. Maintainer assignment/scope acceptance remains pending. No live model calls, production load or browser validation.

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.

[BUG] Previous human feedback replaces ordinary router payloads, including on later kickoffs

1 participant