Skip to content

fix(agent): avoid redundant PR checkout#3579

Merged
tatoalo merged 2 commits into
mainfrom
posthog-code/avoid-redundant-pr-checkout
Jul 20, 2026
Merged

fix(agent): avoid redundant PR checkout#3579
tatoalo merged 2 commits into
mainfrom
posthog-code/avoid-redundant-pr-checkout

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Problem

Cloud task follow-ups receive existing-PR instructions on every turn. The instructions required gh pr checkout unconditionally, so agents repeatedly checked out the same PR branch before handling each user message.

Why: Follow-up interactions should continue from the active branch without unnecessary repository setup or repetitive status messages.

Make existing-PR follow-up context check out the branch only when needed, preventing cloud agents from repeating the checkout on every prompt.

Generated-By: PostHog Code
Task-Id: 9e493924-1eab-496a-ba66-aba8366de96e
@trunk-io

trunk-io Bot commented Jul 20, 2026

Copy link
Copy Markdown

😎 Merged manually by @tatoalo - details.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 7f9775f.

@tatoalo tatoalo self-assigned this Jul 20, 2026
@tatoalo tatoalo added the Stamphog This will request an autostamp by stamphog on small changes label Jul 20, 2026
@tatoalo
tatoalo marked this pull request as ready for review July 20, 2026 12:22
github-actions[bot]
github-actions Bot previously approved these changes Jul 20, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small prompt-string fix with matching test updates. No logic changes, no API contracts touched, no security concerns.

@posthog

posthog Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

👋 Visual changes detected for this PR.

Review and approve in PostHog Visual Review

If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix.

@tatoalo
tatoalo enabled auto-merge (squash) July 20, 2026 12:23
@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(agent): avoid redundant PR checkout" | Re-trigger Greptile

Comment thread packages/agent/src/server/agent-server.ts Outdated
@tatoalo
tatoalo disabled auto-merge July 20, 2026 12:24
Use one conditional checkout instruction for both the static cloud system prompt and per-message detected PR context, preventing conflicting guidance on follow-up turns.

Generated-By: PostHog Code
Task-Id: 9e493924-1eab-496a-ba66-aba8366de96e
@tatoalo
tatoalo enabled auto-merge (squash) July 20, 2026 12:27
@github-actions
github-actions Bot dismissed their stale review July 20, 2026 12:27

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small prompt-string fix that makes PR checkout conditional in both instruction paths; tests updated to match. No logic, API contracts, or security concerns.

@tatoalo
tatoalo merged commit 53826a5 into main Jul 20, 2026
28 of 31 checks passed
@tatoalo
tatoalo deleted the posthog-code/avoid-redundant-pr-checkout branch July 20, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant