From bbd923a0cc8842a6f31b104820a531554c43c253 Mon Sep 17 00:00:00 2001 From: Gokhan Ozdemir Date: Sat, 5 Sep 2026 18:26:58 +0300 Subject: [PATCH 1/2] fix(assistants): improve error logging in chat to show actual error details Fixes #499 - Serialize error objects properly to capture message, name, code, and stack trace for debugging. --- src/cli/commands/assistants/chat/index.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/cli/commands/assistants/chat/index.ts b/src/cli/commands/assistants/chat/index.ts index f28748f12..20a07ff92 100644 --- a/src/cli/commands/assistants/chat/index.ts +++ b/src/cli/commands/assistants/chat/index.ts @@ -419,6 +419,21 @@ async function handleChatError(error: unknown, config: ProviderProfile): Promise const context = createErrorContext(error); logger.error('Assistant chat API call failed', context); + // Log the actual error details for debugging (instead of [object Object]) + if (error instanceof Error) { + logger.error('Assistant chat error details', { + message: error.message, + name: error.name, + code: (error as any).code, + stack: error.stack + }); + } else { + logger.error('Assistant chat error details (non-Error)', { + error: String(error), + type: typeof error + }); + } + if (error instanceof Error && (error.message.includes('401') || error.message.includes('403'))) { await promptReauthentication(config); } From 110add2fe9bc1dcdf47235d23fbcf3e0db0f1898 Mon Sep 17 00:00:00 2001 From: Gokhan Ozdemir Date: Sat, 5 Sep 2026 20:43:51 +0300 Subject: [PATCH 2/2] fix(tests): improve temp directory cleanup in flaky migration runner tests --- .../__tests__/migration-runner-ordering.test.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/migrations/__tests__/migration-runner-ordering.test.ts b/src/migrations/__tests__/migration-runner-ordering.test.ts index 2c8b3af4c..9176bd1dd 100644 --- a/src/migrations/__tests__/migration-runner-ordering.test.ts +++ b/src/migrations/__tests__/migration-runner-ordering.test.ts @@ -85,7 +85,14 @@ afterEach(async () => { openLoggers = []; if (originalCodemieHome !== undefined) process.env.CODEMIE_HOME = originalCodemieHome; else delete process.env.CODEMIE_HOME; - rmSync(tmpHome, { recursive: true, force: true }); + // Windows can still hold log file handles briefly after stream.end(); force + + // maxRetries only suppress ENOENT, so treat residual ENOTEMPTY/EBUSY as + // best-effort teardown (matches claude.metrics-processor-names.test.ts). + try { + rmSync(tmpHome, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 }); + } catch { + /* ignore temp-dir cleanup races */ + } vi.restoreAllMocks(); });