Skip to content
Merged
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
4 changes: 2 additions & 2 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"jose": "^6.2.8"
},
"devDependencies": {
"@anthropic-ai/claude-agent-sdk": "^0.3.228",
"@anthropic-ai/claude-agent-sdk": "^0.3.229",
Comment thread
jgoux marked this conversation as resolved.
"@anthropic-ai/sdk": "^0.116.0",
"@clack/prompts": "^1.7.0",
"@effect/atom-react": "catalog:",
Expand Down Expand Up @@ -78,7 +78,7 @@
"oxlint-tsgolint": "catalog:",
"pg": "^8.23.0",
"pg-copy-streams": "^7.0.0",
"posthog-node": "^5.48.1",
"posthog-node": "^5.48.2",
"react": "^19.2.8",
"react-devtools-core": "^7.0.1",
"semantic-release": "^25.0.9",
Expand Down
21 changes: 8 additions & 13 deletions apps/cli/src/shared/telemetry/posthog-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,12 @@ export const scopedPosthogClient = (apiKey: string, host: string) =>
return { client, shutdown };
}),
({ client, shutdown }) =>
Effect.promise(async () => {
try {
await client._shutdown(EXIT_DELAY_CAP_MS);
} catch {
// The deadline rejection must be swallowed: Effect.promise turns
// rejections into defects, which would fail the command.
} finally {
// The shutdown deadline only stops the wait; the SDK's drain keeps
// in-flight requests running and starts queued ones after release.
// Aborting cancels them so nothing outlives the scope.
shutdown.abort();
}
}),
Effect.promise(() => client.shutdown(30_000).catch(() => undefined)).pipe(
// Our Effect deadline precedes the SDK's noisy 30-second deadline.
Effect.timeoutOption(EXIT_DELAY_CAP_MS),
Effect.asVoid,
// The SDK drain can continue after the Effect deadline; aborting its
// fetches lets that background drain settle without active requests.
Effect.ensuring(Effect.sync(() => shutdown.abort())),
),
).pipe(Effect.map(({ client }) => client));
Loading
Loading