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

@@ -111,6 +111,12 @@ Pattern B only (verify-only checkpoints). Skip for A/C.
- Verify key-files.created exist on disk with `[ -f ]`
- Check `git log --oneline --all --grep="{phase}-{plan}"` returns ≥1 commit
- Append `## Self-Check: PASSED` or `## Self-Check: FAILED` to SUMMARY
**Known Claude Code bug (classifyHandoffIfNeeded):** If any segment agent reports "failed" with `classifyHandoffIfNeeded is not defined`, this is a Claude Code runtime bug — not a real failure. Run spot-checks; if they pass, treat as successful.
</step>
<step name="load_prompt">