Skip to content
Open
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
6 changes: 4 additions & 2 deletions packages/ai/src/ai/tools/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ export function createToolLogger(toolName: string) {
log.info({ service: "api", aiTool: toolName, message, ...context });
},
error: (message: string, context?: Record<string, unknown>) => {
const err = new Error(message);
const requestLogger = getActiveAiRequestLogger();
if (requestLogger) {
requestLogger.error(err, {
// Use warn so that recoverable tool errors do not escalate the
// final job-level log to ERROR. True job failures call
// logger.error() directly in jobs.ts and will still emit ERROR.
requestLogger.warn(message, {
aiTool: { name: toolName },
...context,
});
Expand Down
Loading