@posthog/agent 2.1.2 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/agent.js CHANGED
@@ -276,7 +276,7 @@ import { v7 as uuidv7 } from "uuid";
276
276
  // package.json
277
277
  var package_default = {
278
278
  name: "@posthog/agent",
279
- version: "2.1.2",
279
+ version: "2.1.5",
280
280
  repository: "https://github.com/PostHog/twig",
281
281
  description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
282
282
  exports: {
@@ -3598,20 +3598,22 @@ var Agent = class {
3598
3598
  if (config.posthog) {
3599
3599
  this.posthogAPI = new PostHogAPIClient(config.posthog);
3600
3600
  }
3601
- if (config.otelTransport) {
3602
- this.sessionLogWriter = new SessionLogWriter({
3603
- otelConfig: {
3604
- posthogHost: config.otelTransport.host,
3605
- apiKey: config.otelTransport.apiKey,
3606
- logsPath: config.otelTransport.logsPath
3607
- },
3608
- logger: this.logger.child("SessionLogWriter")
3609
- });
3610
- } else if (config.posthog) {
3611
- this.sessionLogWriter = new SessionLogWriter({
3612
- posthogAPI: this.posthogAPI,
3613
- logger: this.logger.child("SessionLogWriter")
3614
- });
3601
+ if (!config.skipLogPersistence) {
3602
+ if (config.otelTransport) {
3603
+ this.sessionLogWriter = new SessionLogWriter({
3604
+ otelConfig: {
3605
+ posthogHost: config.otelTransport.host,
3606
+ apiKey: config.otelTransport.apiKey,
3607
+ logsPath: config.otelTransport.logsPath
3608
+ },
3609
+ logger: this.logger.child("SessionLogWriter")
3610
+ });
3611
+ } else if (config.posthog) {
3612
+ this.sessionLogWriter = new SessionLogWriter({
3613
+ posthogAPI: this.posthogAPI,
3614
+ logger: this.logger.child("SessionLogWriter")
3615
+ });
3616
+ }
3615
3617
  }
3616
3618
  }
3617
3619
  _configureLlmGateway(_adapter) {