mirror of
https://github.com/KeygraphHQ/shannon.git
synced 2026-04-05 04:02:30 +02:00
fix: err handling for claude code session limit
This commit is contained in:
@@ -273,6 +273,9 @@ async function runClaudePrompt(prompt, sourceDir, allowedTools = 'Read', context
|
||||
// Check for API error patterns in assistant message content
|
||||
if (content && typeof content === 'string') {
|
||||
const lowerContent = content.toLowerCase();
|
||||
if (lowerContent.includes('session limit reached')) {
|
||||
throw new PentestError('Session limit reached', 'billing', false);
|
||||
}
|
||||
if (lowerContent.includes('api error') || lowerContent.includes('terminated')) {
|
||||
apiErrorDetected = true;
|
||||
console.log(chalk.red(` ⚠️ API Error detected in assistant response: ${content.trim()}`));
|
||||
|
||||
@@ -134,6 +134,7 @@ export const isRetryableError = (error) => {
|
||||
message.includes('invalid prompt') ||
|
||||
message.includes('out of memory') ||
|
||||
message.includes('permission denied') ||
|
||||
message.includes('session limit reached') ||
|
||||
message.includes('invalid api key')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user