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
8 changes: 4 additions & 4 deletions src/claude/runClaude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,15 @@ export async function runClaude(credentials: Credentials, options: StartOptions
logger.debug('[START] Failed to report to daemon (may not be running):', error);
}

// Create realtime session FIRST (before SDK metadata extraction)
const session = api.sessionSyncClient(response);

// Extract SDK metadata in background and update session when ready
extractSDKMetadataAsync(async (sdkMetadata) => {
logger.debug('[start] SDK metadata extracted, updating session:', sdkMetadata);
try {
// Update session metadata with tools and slash commands
api.sessionSyncClient(response).updateMetadata((currentMetadata) => ({
session.updateMetadata((currentMetadata) => ({
...currentMetadata,
tools: sdkMetadata.tools,
slashCommands: sdkMetadata.slashCommands
Expand All @@ -178,9 +181,6 @@ export async function runClaude(credentials: Credentials, options: StartOptions
}
});

// Create realtime session
const session = api.sessionSyncClient(response);

// Start Happy MCP server
const happyServer = await startHappyServer(session);
logger.debug(`[START] Happy MCP server started at ${happyServer.url}`);
Expand Down