@posthog/agent 2.3.145 → 2.3.155

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.
@@ -904,7 +904,7 @@ var import_hono = require("hono");
904
904
  // package.json
905
905
  var package_default = {
906
906
  name: "@posthog/agent",
907
- version: "2.3.145",
907
+ version: "2.3.155",
908
908
  repository: "https://github.com/PostHog/code",
909
909
  description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
910
910
  exports: {
@@ -3524,6 +3524,10 @@ function supportsEffort(modelId) {
3524
3524
  function supportsMaxEffort(modelId) {
3525
3525
  return MODELS_WITH_MAX_EFFORT.has(modelId);
3526
3526
  }
3527
+ var MODELS_TO_EXCLUDE_MCP_TOOLS = /* @__PURE__ */ new Set(["claude-haiku-4-5"]);
3528
+ function supportsMcpInjection(modelId) {
3529
+ return !MODELS_TO_EXCLUDE_MCP_TOOLS.has(modelId);
3530
+ }
3527
3531
  function getEffortOptions(modelId) {
3528
3532
  if (!supportsEffort(modelId)) return null;
3529
3533
  const options = [
@@ -4576,7 +4580,8 @@ var ClaudeAcpAgent = class extends BaseAcpAgent {
4576
4580
  const input = new Pushable();
4577
4581
  const settingsManager = new SettingsManager(cwd);
4578
4582
  await settingsManager.initialize();
4579
- const mcpServers = parseMcpServers(params);
4583
+ const earlyModelId = settingsManager.getSettings().model || meta?.model || "";
4584
+ const mcpServers = supportsMcpInjection(earlyModelId) ? parseMcpServers(params) : {};
4580
4585
  const systemPrompt = buildSystemPrompt(meta?.systemPrompt);
4581
4586
  this.logger.info(isResume ? "Resuming session" : "Creating new session", {
4582
4587
  sessionId,
@@ -12631,6 +12636,25 @@ ${toolSummary}`);
12631
12636
  return { append: cloudAppend };
12632
12637
  }
12633
12638
  buildCloudSystemPrompt(prUrl) {
12639
+ const taskId = this.config.taskId;
12640
+ const attributionInstructions = `
12641
+ ## Attribution
12642
+ Do NOT use Claude Code's default attribution (no "Co-Authored-By" trailers, no "Generated with [Claude Code]" lines).
12643
+
12644
+ Instead, add the following trailers to EVERY commit message (after a blank line at the end):
12645
+ Generated-By: PostHog Code
12646
+ Task-Id: ${taskId}
12647
+
12648
+ Example:
12649
+ \`\`\`
12650
+ git commit -m "$(cat <<'EOF'
12651
+ fix: resolve login redirect loop
12652
+
12653
+ Generated-By: PostHog Code
12654
+ Task-Id: ${taskId}
12655
+ EOF
12656
+ )"
12657
+ \`\`\``;
12634
12658
  if (prUrl) {
12635
12659
  return `
12636
12660
  # Cloud Task Execution
@@ -12644,8 +12668,7 @@ After completing the requested changes:
12644
12668
 
12645
12669
  Important:
12646
12670
  - Do NOT create a new branch or a new pull request.
12647
- - Do NOT add "Co-Authored-By" trailers to commit messages.
12648
- - Do NOT add "Generated with [Claude Code]" or similar attribution lines to PR descriptions.
12671
+ ${attributionInstructions}
12649
12672
  `;
12650
12673
  }
12651
12674
  if (!this.config.repositoryPath) {
@@ -12672,15 +12695,18 @@ Important:
12672
12695
  # Cloud Task Execution
12673
12696
 
12674
12697
  After completing the requested changes:
12675
- 1. Create a new branch with a descriptive name based on the work done
12698
+ 1. Create a new branch prefixed with \`posthog-code/\` (e.g. \`posthog-code/fix-login-redirect\`) based on the work done
12676
12699
  2. Stage and commit all changes with a clear commit message
12677
12700
  3. Push the branch to origin
12678
- 4. Create a draft pull request using \`gh pr create --draft${this.config.baseBranch ? ` --base ${this.config.baseBranch}` : ""}\` with a descriptive title and body
12701
+ 4. Create a draft pull request using \`gh pr create --draft${this.config.baseBranch ? ` --base ${this.config.baseBranch}` : ""}\` with a descriptive title and body. Add the following footer at the end of the PR description:
12702
+ \`\`\`
12703
+ ---
12704
+ *Created with [PostHog Code](https://posthog.com/code?ref=pr)*
12705
+ \`\`\`
12679
12706
 
12680
12707
  Important:
12681
12708
  - Always create the PR as a draft. Do not ask for confirmation.
12682
- - Do NOT add "Co-Authored-By" trailers to commit messages.
12683
- - Do NOT add "Generated with [Claude Code]" or similar attribution lines to PR descriptions.
12709
+ ${attributionInstructions}
12684
12710
  `;
12685
12711
  }
12686
12712
  async signalTaskComplete(payload, stopReason) {