Skip to content

Commit 8489584

Browse files
fix: add missing threadId to native event logger in ClaudeCodeAdapter
The logNativeSdkMessage function was missing the canonical threadId in the event payload and was passing null as the thread ID to nativeEventLogger.write(), routing all Claude native events to the global log instead of per-thread files. Add context.session.threadId to both the event object and as the second argument to write(), matching how the Codex adapter routes native events per-thread. Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
1 parent 1beeff2 commit 8489584

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/server/src/provider/Layers/ClaudeCodeAdapter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ function makeClaudeCodeAdapter(options?: ClaudeCodeAdapterLiveOptions) {
502502
provider: PROVIDER,
503503
createdAt: observedAt,
504504
method: sdkNativeMethod(message),
505+
threadId: context.session.threadId,
505506
...(typeof message.session_id === "string"
506507
? { providerThreadId: message.session_id }
507508
: {}),
@@ -510,7 +511,7 @@ function makeClaudeCodeAdapter(options?: ClaudeCodeAdapterLiveOptions) {
510511
payload: message,
511512
},
512513
},
513-
null,
514+
context.session.threadId,
514515
);
515516
});
516517

0 commit comments

Comments
 (0)