@posthog/agent 2.3.616 → 2.3.619

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.
@@ -8809,7 +8809,7 @@ var import_zod3 = require("zod");
8809
8809
  // package.json
8810
8810
  var package_default = {
8811
8811
  name: "@posthog/agent",
8812
- version: "2.3.616",
8812
+ version: "2.3.619",
8813
8813
  repository: "https://github.com/PostHog/code",
8814
8814
  description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
8815
8815
  exports: {
@@ -22486,9 +22486,14 @@ After completing the requested changes:
22486
22486
  1. Check out the existing PR branch with \`gh pr checkout ${prUrl}\`
22487
22487
  2. Stage and commit all changes with a clear commit message
22488
22488
  3. Push to the existing PR branch
22489
+ 4. For every PR review comment or review thread you addressed, treat the thread as done only after BOTH of these:
22490
+ - Reply on the thread with a short note describing what changed (reference the commit SHA when useful) using \`gh api -X POST /repos/{owner}/{repo}/pulls/{n}/comments/{id}/replies -f body='...'\`.
22491
+ - Resolve the thread via the \`resolveReviewThread\` GraphQL mutation: \`gh api graphql -f query='mutation($id:ID!){resolveReviewThread(input:{threadId:$id}){thread{isResolved}}}' -f id="<thread-node-id>"\`.
22492
+ List unresolved threads first with \`gh api graphql -f query='{repository(owner:"<owner>",name:"<repo>"){pullRequest(number:<n>){reviewThreads(first:100){nodes{id isResolved comments(first:1){nodes{body}}}}}}}'\` so you can resolve each one you fixed.
22489
22493
 
22490
22494
  Important:
22491
22495
  - Do NOT create a new branch or a new pull request.
22496
+ - Do NOT push fixes for review comments without replying to and resolving each related thread.
22492
22497
  ${attributionInstructions}
22493
22498
  `;
22494
22499
  }
@@ -22500,7 +22505,7 @@ When the user asks for code changes:
22500
22505
  When the user explicitly asks to clone or work in a GitHub repository:
22501
22506
  - Clone the repository into /tmp/workspace/repos/<owner>/<repo> using \`gh repo clone <owner>/<repo> /tmp/workspace/repos/<owner>/<repo>\`
22502
22507
  - Work from inside that cloned repository for follow-up code changes
22503
- - If the user explicitly asks you to open or update a pull request, create a branch, commit the requested changes, push it, and open a draft pull request from inside the clone
22508
+ - If the user explicitly asks you to open or update a pull request, create a branch, commit the requested changes, push it, and open a draft pull request from inside the clone. Before opening the PR, check the cloned repo for a PR template at \`.github/pull_request_template.md\` (or variants; fall back to the org's \`.github\` repo via \`gh api\`) and use it as the body structure, and search for matching open issues with \`gh issue list --search\` to include \`Closes #<n>\` / \`Refs #<n>\` links.
22504
22509
  - Do NOT create branches, commits, push changes, or open pull requests unless the user explicitly asks for that`;
22505
22510
  return `
22506
22511
  # Cloud Task Execution \u2014 No Repository Mode
@@ -22540,7 +22545,11 @@ After completing the requested changes:
22540
22545
  1. Create a new branch prefixed with \`posthog-code/\` (e.g. \`posthog-code/fix-login-redirect\`) based on the work done
22541
22546
  2. Stage and commit all changes with a clear commit message
22542
22547
  3. Push the branch to origin
22543
- 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:
22548
+ 4. Before opening the PR, prepare the body:
22549
+ - Check the repo for a PR template at \`.github/pull_request_template.md\` (also try \`.github/PULL_REQUEST_TEMPLATE.md\`, \`docs/pull_request_template.md\`, and root variants). If one exists, use its exact section headings as the PR body \u2014 do NOT fall back to a generic Summary/Test plan format.
22550
+ - If no repo-level template exists, check the org's \`.github\` repo via \`gh api /repos/<owner>/.github/contents/.github/pull_request_template.md\` (and other common paths) and use that as a fallback.
22551
+ - Search for matching open issues with \`gh issue list --state open --search '<keywords>'\` (derive keywords from the branch name, commits, and changed files; \`gh issue view <n>\` to confirm relevance). For every issue this PR would resolve, include a \`Closes #<n>\` line in the body so GitHub auto-links and auto-closes it on merge. For issues that are related but not fully resolved, use \`Refs #<n>\` instead.
22552
+ 5. Create a draft pull request using \`gh pr create --draft${this.config.baseBranch ? ` --base ${this.config.baseBranch}` : ""}\` with a descriptive title and the body prepared above. Add the following footer at the end of the PR description:
22544
22553
  \`\`\`
22545
22554
  ---
22546
22555
  *Created with [PostHog Code](https://posthog.com/code?ref=pr)*