fix(assistants): improve error logging in chat to show actual error details - #537
Open
gokhanozdemir wants to merge 8 commits into
Open
gokhanozdemir wants to merge 8 commits into
gokhanozdemir wants to merge 8 commits into
Conversation
gokhanozdemir
force-pushed
the
fix/499-assistant-chat-error-logging
branch
from
September 5, 2026 17:08
e1e7c8f to
38b9eb4
Compare
…etails Fixes codemie-ai#499 - Serialize error objects properly to capture message, name, code, and stack trace for debugging.
gokhanozdemir
force-pushed
the
fix/499-assistant-chat-error-logging
branch
from
September 5, 2026 17:33
38b9eb4 to
bbd923a
Compare
gokhanozdemir
marked this pull request as ready for review
September 5, 2026 17:50
gokhanozdemir
marked this pull request as draft
September 15, 2026 06:43
…errors gracefully
… handle errors gracefully" This reverts commit a161f3d.
… runner tests" This reverts commit 110add2.
…bject] logger.error() only unwrapped .message/.stack for actual Error instances; any plain object (including the context built by createErrorContext) fell through to String(error), producing [object Object] in both the console and the debug log file. The previous fix attempt in handleChatError re-triggered the same bug by passing a new plain object literal through the same code path, so it's removed in favor of fixing the root cause once. Generated with AI Co-Authored-By: codemie-ai <[email protected]>
gokhanozdemir
commented
Sep 15, 2026
gokhanozdemir
left a comment
Contributor
Author
There was a problem hiding this comment.
self reviewed
gokhanozdemir
marked this pull request as ready for review
September 15, 2026 15:22
4 tasks
Collaborator
|
@gokhanozdemir pls provide screenshot with cli screen with state after fix. how error looks like |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Errors thrown during assistants chat were serialized as
[object Object], hiding the actual message, name, code, and stack trace needed for debugging, and could be mistaken for an authentication error.Root cause:
logger.error(message, error)only unwraps.message/.stackwhen the second argument is an actualErrorinstance. Any plain object — including the structured context produced bycreateErrorContext()— fell through toString(error), which yields[object Object].Fixes #499
Changes
src/utils/logger.ts: addedformatNonErrorValue()and used it inLogger.error()'s non-Errorbranch (both the file-log and console-log paths) so plain objects areJSON.stringify'd instead ofString()-ed. This fixes the bug at its source for every caller, including the existinglogger.error('Assistant chat API call failed', context)call inhandleChatError.Impact
Error output during assistants chat failures (and any other
logger.error()call site passing a non-Errorobject) now shows actionable detail instead of[object Object]; no change to normal (non-error) behavior.Checklist