@posthog/agent 2.3.233 → 2.3.256

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/agent",
3
- "version": "2.3.233",
3
+ "version": "2.3.256",
4
4
  "repository": "https://github.com/PostHog/code",
5
5
  "description": "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
6
6
  "exports": {
@@ -496,7 +496,7 @@ export async function hydrateSessionJsonl(params: {
496
496
  permissionMode?: string;
497
497
  posthogAPI: PostHogAPIClient;
498
498
  log: HydrationLog;
499
- }): Promise<void> {
499
+ }): Promise<boolean> {
500
500
  const { posthogAPI, log } = params;
501
501
 
502
502
  try {
@@ -506,7 +506,7 @@ export async function hydrateSessionJsonl(params: {
506
506
  log.info("Local JSONL exists, skipping S3 hydration", {
507
507
  sessionId: params.sessionId,
508
508
  });
509
- return;
509
+ return true;
510
510
  } catch {
511
511
  // File doesn't exist, proceed with hydration
512
512
  }
@@ -514,13 +514,13 @@ export async function hydrateSessionJsonl(params: {
514
514
  const taskRun = await posthogAPI.getTaskRun(params.taskId, params.runId);
515
515
  if (!taskRun.log_url) {
516
516
  log.info("No log URL, skipping JSONL hydration");
517
- return;
517
+ return false;
518
518
  }
519
519
 
520
520
  const entries = await posthogAPI.fetchTaskRunLogs(taskRun);
521
521
  if (entries.length === 0) {
522
522
  log.info("No S3 log entries, skipping JSONL hydration");
523
- return;
523
+ return false;
524
524
  }
525
525
 
526
526
  const entryCounts: Record<string, number> = {};
@@ -545,7 +545,7 @@ export async function hydrateSessionJsonl(params: {
545
545
  const allTurns = rebuildConversation(entries);
546
546
  if (allTurns.length === 0) {
547
547
  log.info("No conversation in S3 logs, skipping JSONL hydration");
548
- return;
548
+ return false;
549
549
  }
550
550
 
551
551
  const maxTokens = supports1MContext(params.model ?? "")
@@ -577,10 +577,12 @@ export async function hydrateSessionJsonl(params: {
577
577
  turns: conversation.length,
578
578
  lines: jsonlLines.length,
579
579
  });
580
+ return true;
580
581
  } catch (err) {
581
582
  log.warn("Failed to hydrate session JSONL, continuing", {
582
583
  sessionId: params.sessionId,
583
584
  error: err instanceof Error ? err.message : String(err),
584
585
  });
586
+ return false;
585
587
  }
586
588
  }