Fix misleading pyright error when calling async task with wrong argument types
When calling an async task with incorrect argument types, pyright would
show a confusing error: "State[CoroutineType[...]] is not awaitable"
instead of a normal argument type error.
This happened because:
1. Task.__call__ lacked explicit overloads for async tasks (Task[P, Coroutine[Any, Any, R]])
2. The return_state=True overload came before return_state=False
3. When pyright couldn't match argument types, it fell back to the *args overloads
and picked the first match (return_state=True), inferring State[Coroutine[...]]
Fix:
- Add explicit Task[P, Coroutine[Any, Any, R]] overloads (matching submit/map)
- Reorder overloads so return_state=False comes first (the default behavior)
Now pyright shows normal argument type errors instead of the confusing
"State is not awaitable" message.
Closes #19326
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
add debug log for fork handler registration failure
closes #19116
this PR adds a debug log when fork handler registration fails, as requested in review feedback from the original PR.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>