Conversation
The branch prefix convention was only injected into the auto-create-PR cloud prompt. When a cloud session ran in review-only mode and the user later asked the agent to create a branch, the agent had no convention loaded and fell back to its own default. Move the prefix instruction into the globally-appended BRANCH_NAMING block so it applies to every prompt branch. Generated-By: PostHog Code Task-Id: d218229f-4d24-49e8-b6cb-062ed96171f5
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/agent/src/adapters/claude/session/instructions.ts:6
**Instruction duplicated, not moved**
The PR description says this is a *move*, but the identical `posthog-code/` prefix instruction still exists in `agent-server.ts:1621` (the auto-PR branch). Now both prompts carry it, violating OnceAndOnlyOnce. The line in `agent-server.ts` that reads `1. Create a new branch prefixed with \`posthog-code/\` (e.g. \`posthog-code/fix-login-redirect\`) based on the work done` should be simplified to remove the redundant prefix hint and just say e.g. `1. Create a new branch based on the work done` (relying on the global instruction for the naming convention).
Reviews (1): Last reviewed commit: "fix(agent): include posthog-code/ branch..." | Re-trigger Greptile |
|
|
||
| When working in a detached HEAD state, create a descriptive branch name based on the work being done before committing. Do this automatically without asking the user. | ||
|
|
||
| When creating a new branch, prefix it with \`posthog-code/\` (e.g. \`posthog-code/fix-login-redirect\`). |
Contributor
There was a problem hiding this comment.
Instruction duplicated, not moved
The PR description says this is a move, but the identical posthog-code/ prefix instruction still exists in agent-server.ts:1621 (the auto-PR branch). Now both prompts carry it, violating OnceAndOnlyOnce. The line in agent-server.ts that reads 1. Create a new branch prefixed with \posthog-code/` (e.g. `posthog-code/fix-login-redirect`) based on the work doneshould be simplified to remove the redundant prefix hint and just say e.g.1. Create a new branch based on the work done` (relying on the global instruction for the naming convention).
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/agent/src/adapters/claude/session/instructions.ts
Line: 6
Comment:
**Instruction duplicated, not moved**
The PR description says this is a *move*, but the identical `posthog-code/` prefix instruction still exists in `agent-server.ts:1621` (the auto-PR branch). Now both prompts carry it, violating OnceAndOnlyOnce. The line in `agent-server.ts` that reads `1. Create a new branch prefixed with \`posthog-code/\` (e.g. \`posthog-code/fix-login-redirect\`) based on the work done` should be simplified to remove the redundant prefix hint and just say e.g. `1. Create a new branch based on the work done` (relying on the global instruction for the naming convention).
How can I resolve this? If you propose a fix, please make it concise.
jonathanlab
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
posthog-code/branch prefix convention was only injected into the auto-create-PR cloud prompt (agent-server.ts:1621).!shouldAutoCreatePrbranch and the user later asked the agent to create a branch, the agent had no convention loaded and fell back to its own default (<user>/<slug>).BRANCH_NAMINGblock inpackages/agent/src/adapters/claude/session/instructions.tsso it applies to every prompt branch — cloud auto-PR, cloud review-only, no-repo, and local.Test plan
posthog-code/prefix