Commit 6cf6672
fix(skills): resolve non-coroutine awaitables in resolve_response
`inspect.isawaitable()` also matches Tasks, Futures and custom `__await__`
types, while `asyncio.run()` takes a coroutine specifically — so a client
returning anything other than a raw coroutine raised "a coroutine was expected".
Wrap the awaitable instead, which also makes the two `type: ignore[arg-type]`
comments unnecessary.
Awaitables already bound to a running loop still raise, since resolving one
synchronously would block the loop it needs to progress; documented on the
function.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent d8aa275 commit 6cf6672
2 files changed
Lines changed: 26 additions & 2 deletions
File tree
- lib/crewai
- src/crewai/utilities
- tests/utilities
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
| |||
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
81 | 92 | | |
82 | 93 | | |
83 | 94 | | |
| |||
87 | 98 | | |
88 | 99 | | |
89 | 100 | | |
90 | | - | |
| 101 | + | |
91 | 102 | | |
92 | | - | |
| 103 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
0 commit comments