fix: add detailed logging and error handling for chat API c9dd90c anderson-ufrj Claude commited on Sep 17