Skip to content

Commit 6e90614

Browse files
committed
changeset
1 parent 8d73cc9 commit 6e90614

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.changeset/fair-mugs-occur.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"magnitude-core": patch
3+
---
4+
5+
add retries for when no actions returned or other weird llm provider errors

packages/magnitude-core/src/agent/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ export class Agent {
337337
}
338338
},
339339
// HTTP body is not JSON - comes from Anthropic sometimes, weird error
340-
{ errorSubstrings: ['HTTP body is not JSON', 'No actions generated'], retryLimit: 3, delayMs: 1000, warn: true }
340+
// Sometimes Anthropic will give 401 Unauthorized randomly even when authorized
341+
{ errorSubstrings: ['HTTP body is not JSON', '401 Unauthorized', 'No actions generated'], retryLimit: 3, delayMs: 1000, warn: true }
341342
);
342343
} catch (error: unknown) {
343344
logger.error(`Error planning actions: ${error instanceof Error ? error.message : String(error)}`);

0 commit comments

Comments
 (0)