Files
cleveragents-core/tools/controller
drew ab8a5e5bfb fix(controller): T4-4 — route issue workflows to STUCK when role has no prefetch
Trial-4 observed wf=6 (entity #34, kind='issue') promoted ANALYZING→
IMPLEMENTING by the estimator, but build_implementer_input raises
``ValueError("implementer prefetch needs kind='pr', got 'issue'")``.
The scheduler logged WARNING and retried every ~5s forever — log spam
+ workflow never reached a terminal state. Pre-fix:

  2026-05-18 21:13:43 WARNING ... prefetch failed ...
  2026-05-18 21:13:50 WARNING ... prefetch failed ...
  2026-05-18 21:13:55 WARNING ... prefetch failed ...
  (50+ identical lines over the trial)

Fix: before calling prefetch, scheduler checks the workflow's kind
column. If kind='issue' and role in
{implementer, reviewer, conflict_resolver}, the workflow is routed
to STUCK with reason='issue-not-supported (T4-4)'. Operator-visible
controller_events row tags this as 'issue-not-supported'.

Future work: IssueImplementerOutputV1 contract already exists in
contracts/v1.py:362; a follow-up batch can add ``build_issue_
implementer_input`` + remove this short-circuit. For the trial we
just need issues to stop wedging.

Test: TestIssueWorkflowRoutedToStuck in test_batch_s_fixes.py.

833 controller tests pass (was 832; +1).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 21:20:17 -04:00
..