@posthog/agent 2.3.454 → 2.3.465

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.
@@ -8723,7 +8723,7 @@ var import_zod3 = require("zod");
8723
8723
  // package.json
8724
8724
  var package_default = {
8725
8725
  name: "@posthog/agent",
8726
- version: "2.3.454",
8726
+ version: "2.3.465",
8727
8727
  repository: "https://github.com/PostHog/code",
8728
8728
  description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
8729
8729
  exports: {
@@ -21081,7 +21081,6 @@ var AgentServer = class {
21081
21081
  type: "cloud",
21082
21082
  name: process.env.HOSTNAME || "cloud-sandbox"
21083
21083
  };
21084
- this.configureEnvironment();
21085
21084
  const [preTaskRun, preTask] = await Promise.all([
21086
21085
  this.posthogAPI.getTaskRun(payload.task_id, payload.run_id).catch((err2) => {
21087
21086
  this.logger.debug("Failed to fetch task run for session context", {
@@ -21099,6 +21098,7 @@ var AgentServer = class {
21099
21098
  return null;
21100
21099
  })
21101
21100
  ]);
21101
+ this.configureEnvironment({ isInternal: preTask?.internal === true });
21102
21102
  const prUrl = getTaskRunStateString(preTaskRun, "slack_notified_pr_url");
21103
21103
  if (prUrl) {
21104
21104
  this.detectedPrUrl = prUrl;
@@ -21799,9 +21799,11 @@ ${attributionInstructions}
21799
21799
  this.logger.error("Failed to signal task completion", error);
21800
21800
  }
21801
21801
  }
21802
- configureEnvironment() {
21802
+ configureEnvironment({
21803
+ isInternal = false
21804
+ } = {}) {
21803
21805
  const { apiKey, apiUrl, projectId } = this.config;
21804
- const product = this.config.mode === "background" ? "background_agents" : "posthog_code";
21806
+ const product = isInternal ? "background_agents" : "posthog_code";
21805
21807
  const gatewayUrl = process.env.LLM_GATEWAY_URL || getLlmGatewayUrl(apiUrl, product);
21806
21808
  const openaiBaseUrl = gatewayUrl.endsWith("/v1") ? gatewayUrl : `${gatewayUrl}/v1`;
21807
21809
  Object.assign(process.env, {