@posthog/agent 2.3.152 → 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.152",
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: {
@@ -12636,6 +12636,25 @@ ${toolSummary}`);
12636
12636
  return { append: cloudAppend };
12637
12637
  }
12638
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
+ \`\`\``;
12639
12658
  if (prUrl) {
12640
12659
  return `
12641
12660
  # Cloud Task Execution
@@ -12649,8 +12668,7 @@ After completing the requested changes:
12649
12668
 
12650
12669
  Important:
12651
12670
  - Do NOT create a new branch or a new pull request.
12652
- - Do NOT add "Co-Authored-By" trailers to commit messages.
12653
- - Do NOT add "Generated with [Claude Code]" or similar attribution lines to PR descriptions.
12671
+ ${attributionInstructions}
12654
12672
  `;
12655
12673
  }
12656
12674
  if (!this.config.repositoryPath) {
@@ -12677,15 +12695,18 @@ Important:
12677
12695
  # Cloud Task Execution
12678
12696
 
12679
12697
  After completing the requested changes:
12680
- 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
12681
12699
  2. Stage and commit all changes with a clear commit message
12682
12700
  3. Push the branch to origin
12683
- 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
+ \`\`\`
12684
12706
 
12685
12707
  Important:
12686
12708
  - Always create the PR as a draft. Do not ask for confirmation.
12687
- - Do NOT add "Co-Authored-By" trailers to commit messages.
12688
- - Do NOT add "Generated with [Claude Code]" or similar attribution lines to PR descriptions.
12709
+ ${attributionInstructions}
12689
12710
  `;
12690
12711
  }
12691
12712
  async signalTaskComplete(payload, stopReason) {