@posthog/agent 2.3.306 → 2.3.312

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.
@@ -5805,7 +5805,7 @@ var import_hono = require("hono");
5805
5805
  // package.json
5806
5806
  var package_default = {
5807
5807
  name: "@posthog/agent",
5808
- version: "2.3.306",
5808
+ version: "2.3.312",
5809
5809
  repository: "https://github.com/PostHog/code",
5810
5810
  description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
5811
5811
  exports: {
@@ -9232,11 +9232,6 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
9232
9232
  }
9233
9233
  }
9234
9234
  this.session.lastContextWindowSize = lastContextWindowSize;
9235
- this.logger.debug("Context window size from result", {
9236
- sdkReported: contextWindows,
9237
- resolved: lastContextWindowSize,
9238
- modelId: this.session.modelId
9239
- });
9240
9235
  this.session.contextSize = lastContextWindowSize;
9241
9236
  if (lastAssistantTotalUsage !== null) {
9242
9237
  this.session.contextUsed = lastAssistantTotalUsage;
@@ -9595,7 +9590,7 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
9595
9590
  const mcpServers = supportsMcpInjection(earlyModelId) ? parseMcpServers(params) : {};
9596
9591
  const systemPrompt = buildSystemPrompt(meta?.systemPrompt);
9597
9592
  const outputFormat = meta?.jsonSchema && this.options?.onStructuredOutput ? { type: "json_schema", schema: meta.jsonSchema } : void 0;
9598
- this.logger.info(isResume ? "Resuming session" : "Creating new session", {
9593
+ this.logger.debug(isResume ? "Resuming session" : "Creating new session", {
9599
9594
  sessionId,
9600
9595
  taskId,
9601
9596
  taskRunId: meta?.taskRunId,
@@ -9653,10 +9648,6 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
9653
9648
  };
9654
9649
  this.session = session;
9655
9650
  this.sessionId = sessionId;
9656
- this.logger.info(
9657
- isResume ? "Session query initialized, awaiting resumption" : "Session query initialized, awaiting initialization",
9658
- { sessionId, taskId, taskRunId: meta?.taskRunId }
9659
- );
9660
9651
  if (isResume) {
9661
9652
  try {
9662
9653
  const result = await withTimeout(
@@ -9758,14 +9749,6 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
9758
9749
  if (!creationOpts.skipBackgroundFetches) {
9759
9750
  this.deferBackgroundFetches(q);
9760
9751
  }
9761
- this.logger.info(
9762
- isResume ? "Session resumed successfully" : "Session created successfully",
9763
- {
9764
- sessionId,
9765
- taskId,
9766
- taskRunId: meta?.taskRunId
9767
- }
9768
- );
9769
9752
  return { sessionId, modes, models, configOptions };
9770
9753
  }
9771
9754
  createCanUseTool(sessionId, allowedDomains) {
@@ -9951,7 +9934,6 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
9951
9934
  * Both populate caches used later — neither is needed to return configOptions.
9952
9935
  */
9953
9936
  deferBackgroundFetches(q) {
9954
- this.logger.info("Starting background fetches (commands + MCP metadata)");
9955
9937
  Promise.all([
9956
9938
  new Promise((resolve4) => setTimeout(resolve4, 10)).then(
9957
9939
  () => this.sendAvailableCommandsUpdate()
@@ -10707,7 +10689,6 @@ function createClaudeConnection(config) {
10707
10689
  ...config.processCallbacks,
10708
10690
  onStructuredOutput: config.onStructuredOutput
10709
10691
  });
10710
- logger.info(`Created ${agent.adapterName} agent`);
10711
10692
  return agent;
10712
10693
  }, agentStream);
10713
10694
  return {
@@ -10772,7 +10753,6 @@ function createCodexConnection(config) {
10772
10753
  codexProcessOptions: config.codexOptions ?? {},
10773
10754
  processCallbacks: config.processCallbacks
10774
10755
  });
10775
- logger.info(`Created ${agent.adapterName} agent`);
10776
10756
  return agent;
10777
10757
  }, agentStream);
10778
10758
  return {
@@ -11098,7 +11078,6 @@ var Saga = class {
11098
11078
  this.currentStepName = "unknown";
11099
11079
  this.stepTimings = [];
11100
11080
  const sagaStart = performance.now();
11101
- this.log.info("Starting saga", { sagaName: this.sagaName });
11102
11081
  try {
11103
11082
  const result = await this.execute(input);
11104
11083
  const totalDuration = performance.now() - sagaStart;
@@ -11113,7 +11092,8 @@ var Saga = class {
11113
11092
  this.log.error("Saga failed, initiating rollback", {
11114
11093
  sagaName: this.sagaName,
11115
11094
  failedStep: this.currentStepName,
11116
- error: error instanceof Error ? error.message : String(error)
11095
+ error: error instanceof Error ? error.message : String(error),
11096
+ completedStepTimings: this.stepTimings
11117
11097
  });
11118
11098
  await this.rollback();
11119
11099
  return {
@@ -11134,12 +11114,10 @@ var Saga = class {
11134
11114
  */
11135
11115
  async step(config) {
11136
11116
  this.currentStepName = config.name;
11137
- this.log.debug(`Executing step: ${config.name}`);
11138
11117
  const stepStart = performance.now();
11139
11118
  const result = await config.execute();
11140
11119
  const durationMs = Math.round(performance.now() - stepStart);
11141
11120
  this.stepTimings.push({ name: config.name, durationMs });
11142
- this.log.debug(`Step completed: ${config.name}`, { durationMs });
11143
11121
  this.completedSteps.push({
11144
11122
  name: config.name,
11145
11123
  rollback: () => config.rollback(result)
@@ -11157,12 +11135,10 @@ var Saga = class {
11157
11135
  */
11158
11136
  async readOnlyStep(name, execute) {
11159
11137
  this.currentStepName = name;
11160
- this.log.debug(`Executing read-only step: ${name}`);
11161
11138
  const stepStart = performance.now();
11162
11139
  const result = await execute();
11163
11140
  const durationMs = Math.round(performance.now() - stepStart);
11164
11141
  this.stepTimings.push({ name, durationMs });
11165
- this.log.debug(`Read-only step completed: ${name}`, { durationMs });
11166
11142
  return result;
11167
11143
  }
11168
11144
  /**
@@ -11176,9 +11152,7 @@ var Saga = class {
11176
11152
  const stepsReversed = [...this.completedSteps].reverse();
11177
11153
  for (const step of stepsReversed) {
11178
11154
  try {
11179
- this.log.debug(`Rolling back step: ${step.name}`);
11180
11155
  await step.rollback();
11181
- this.log.debug(`Step rolled back: ${step.name}`);
11182
11156
  } catch (error) {
11183
11157
  this.log.error(`Failed to rollback step: ${step.name}`, {
11184
11158
  error: error instanceof Error ? error.message : String(error)
@@ -12061,10 +12035,6 @@ var SessionLogWriter = class _SessionLogWriter {
12061
12035
  if (this.sessions.has(sessionId)) {
12062
12036
  return;
12063
12037
  }
12064
- this.logger.info("Session registered", {
12065
- taskId: context.taskId,
12066
- runId: context.runId
12067
- });
12068
12038
  this.sessions.set(sessionId, { context, currentTurnMessages: [] });
12069
12039
  this.lastFlushAttemptTime.set(sessionId, Date.now());
12070
12040
  if (this.localCachePath) {