Skip to content

fix: hide loop builder instructions from chat#3720

Merged
charlesvien merged 2 commits into
mainfrom
posthog-code/hide-loop-builder-instructions
Jul 23, 2026
Merged

fix: hide loop builder instructions from chat#3720
charlesvien merged 2 commits into
mainfrom
posthog-code/hide-loop-builder-instructions

Conversation

@MattPua

@MattPua MattPua commented Jul 22, 2026

Copy link
Copy Markdown
Member

Problem

Loop builder sessions show internal builder instructions as the user message in chat.

Changes

Before:
CleanShot 2026-07-22 at 11 28 26@2x

After:
CleanShot 2026-07-22 at 11 24 53@2x

  • Show only the prompt entered by the user
  • Pass builder guidance through hidden custom instructions
  • Keep context metadata available to the agent

How did you test this?

  • pnpm exec vitest run packages/ui/src/features/loops/loopBuilderPrompt.test.ts
  • pnpm exec biome check packages/ui/src/features/loops/loopBuilderPrompt.ts packages/ui/src/features/loops/loopBuilderPrompt.test.ts packages/ui/src/features/loops/hooks/useLoopBuilderTask.ts
  • pnpm --filter @posthog/ui typecheck
  • Full repository typecheck attempted by pre-commit, but failed in apps/web on existing unresolved @posthog/agent and @posthog/host-trpc exports

Automatic notifications

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

Created with PostHog Code

@trunk-io

trunk-io Bot commented Jul 22, 2026

Copy link
Copy Markdown

😎 Merged manually by @charlesvien - details.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit c6f0878.

@MattPua
MattPua marked this pull request as ready for review July 22, 2026 15:28
@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
packages/ui/src/features/loops/hooks/useLoopBuilderTask.ts:38-39
**Unseeded Builder Cannot Start**

When the instructions are empty or whitespace-only, both `content` and `taskDescription` become empty strings. Task creation requires one of these fields to contain non-whitespace text, so it returns `Task description cannot be empty` before the hidden instruction to ask what the user wants can reach the agent; previously, the generated builder prompt kept this flow valid.

Reviews (1): Last reviewed commit: "fix: hide loop builder instructions from..." | Re-trigger Greptile

Comment thread packages/ui/src/features/loops/hooks/useLoopBuilderTask.ts Outdated
@MattPua
MattPua requested a review from charlesvien July 22, 2026 17:11
@charlesvien

Copy link
Copy Markdown
Member

/trunk merge

@posthog

posthog Bot commented Jul 23, 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.

MattPua and others added 2 commits July 22, 2026 21:35
Generated-By: PostHog Code
Task-Id: 4ede3282-1f33-48ee-bf6c-fe3329ef80b8
@charlesvien
charlesvien force-pushed the posthog-code/hide-loop-builder-instructions branch from b0f16af to c6f0878 Compare July 23, 2026 04:37
@charlesvien
charlesvien merged commit f6e5e74 into main Jul 23, 2026
32 checks passed
@charlesvien
charlesvien deleted the posthog-code/hide-loop-builder-instructions branch July 23, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants