Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/cli/commands/assistants/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
9 changes: 8 additions & 1 deletion src/migrations/__tests__/migration-runner-ordering.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand Down
Loading