fix: add workaround for Claude Code classifyHandoffIfNeeded bug (#480)

Claude Code v2.1.27+ has a bug where all Task tool agents report
"failed" due to `classifyHandoffIfNeeded is not defined` — a function
called but never defined in the cli.js bundle. The error fires AFTER
all agent work completes, so actual work is always done.

This adds spot-check fallback logic to execute-phase, execute-plan,
and quick workflows: when an agent reports this specific failure,
verify artifacts on disk (SUMMARY.md exists, git commits present).
If spot-checks pass, treat as successful.

Tracked upstream: anthropics/claude-code#24181

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
min-k-khant
2026-02-08 06:52:41 -08:00
committed by GitHub
parent ca03a061a8
commit 4072fd2baf
3 changed files with 14 additions and 1 deletions

View File

@@ -141,6 +141,8 @@ After executor returns:
2. Extract commit hash from executor output
3. Report completion status
**Known Claude Code bug (classifyHandoffIfNeeded):** If executor reports "failed" with error `classifyHandoffIfNeeded is not defined`, this is a Claude Code runtime bug — not a real failure. Check if summary file exists and git log shows commits. If so, treat as successful.
If summary not found, error: "Executor failed to create ${next_num}-SUMMARY.md"
Note: For quick tasks producing multiple plans (rare), spawn executors in parallel waves per execute-phase patterns.