Skip to content

fix(agent): Hyperlink pull requests in agent replies#3208

Merged
charlesvien merged 1 commit into
mainfrom
fix/hyperlink-prs-in-agent-prompts
Jul 6, 2026
Merged

fix(agent): Hyperlink pull requests in agent replies#3208
charlesvien merged 1 commit into
mainfrom
fix/hyperlink-prs-in-agent-prompts

Conversation

@charlesvien

Copy link
Copy Markdown
Member

Problem

Agents mention the PRs they open as plain text. The link users usually see on cloud tasks comes from workflow plumbing, not the agent's own reply, so worktree and local sessions surface PRs without a link. None of our prompts told the agent to hyperlink PRs. Companion to PostHog/posthog#68770, which fixes the repo-owned cloud task prompts.

Changes

Adds one instruction to every prompt surface that produces user-facing replies: when mentioning a pull request, hyperlink its full URL as a markdown link instead of plain text.

  • APPENDED_INSTRUCTIONS in the Claude session adapter (every desktop session, including worktree tasks)
  • buildCloudSystemPrompt in agent-server (Slack app plus cloud and inbox runs; shared prLinkInstructions const included in all five prompt branches)
  • buildSystemPrompt in workspace-server's agent service (locally spawned task and channel sessions)

How did you test this?

turbo typecheck on @posthog/agent and @posthog/workspace-server passes, and biome check on the three changed files reports nothing new (one pre-existing warning elsewhere in agent-server.ts). Prompt-string change only, so no runtime flow to exercise beyond prompt assembly.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@trunk-io

trunk-io Bot commented Jul 6, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 4556a09.

@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 6, 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.

Purely additive system-prompt instruction changes across three agent files telling the model to hyperlink PR references. No logic, API contracts, data models, or security surfaces touched.

@charlesvien charlesvien enabled auto-merge (squash) July 6, 2026 21:24
@charlesvien charlesvien merged commit a18b37c into main Jul 6, 2026
24 checks passed
@charlesvien charlesvien deleted the fix/hyperlink-prs-in-agent-prompts branch July 6, 2026 21:26
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