Enhance error handling and validation in agents and routes
- Added logging for empty responses in GeminiAgent and OpenRouterAgent to track potential session context issues. - Refactored settings file path usage in OpenRouterAgent to use a constant for better maintainability. - Improved error handling in SessionRoutes to log generator failures with detailed context. - Implemented JSON parsing error handling in SettingsRoutes to manage corrupted settings files gracefully. - Added validation for CLAUDE_MEM_OPENROUTER_MAX_CONTEXT_MESSAGES, CLAUDE_MEM_OPENROUTER_MAX_TOKENS, and CLAUDE_MEM_OPENROUTER_SITE_URL in SettingsRoutes to ensure valid configuration.
This commit is contained in:
@@ -170,6 +170,11 @@ export class GeminiAgent {
|
||||
|
||||
// Process response (no original timestamp for init - not from queue)
|
||||
await this.processGeminiResponse(session, initResponse.content, worker, tokensUsed, null);
|
||||
} else {
|
||||
logger.warn('SDK', 'Empty Gemini init response - session may lack context', {
|
||||
sessionId: session.sessionDbId,
|
||||
model
|
||||
});
|
||||
}
|
||||
|
||||
// Process pending messages
|
||||
|
||||
Reference in New Issue
Block a user