Skip to content

Commit 8bc124f

Browse files
committed
fix: handle missing getState method in provider for Task constructor
- Add defensive check for provider.getState existence before calling it - Prevents TypeError when provider doesn't have getState method defined - Fixes failing tests in Task.spec.ts
1 parent 2663615 commit 8bc124f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/task/Task.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export class Task extends EventEmitter<ClineEvents> {
280280
}
281281

282282
// If no historyItem, get the current mode from provider
283-
if (!historyItem) {
283+
if (!historyItem && provider.getState) {
284284
provider
285285
.getState()
286286
.then((state) => {

0 commit comments

Comments
 (0)