fix: hide loop builder instructions from chat#3720
Merged
Conversation
|
😎 Merged manually by @charlesvien - details. |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
MattPua
marked this pull request as ready for review
July 22, 2026 15:28
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/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 |
charlesvien
approved these changes
Jul 23, 2026
Member
|
/trunk merge |
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. |
Generated-By: PostHog Code Task-Id: 4ede3282-1f33-48ee-bf6c-fe3329ef80b8
charlesvien
force-pushed
the
posthog-code/hide-loop-builder-instructions
branch
from
July 23, 2026 04:37
b0f16af to
c6f0878
Compare
charlesvien
approved these changes
Jul 23, 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.
Problem
Loop builder sessions show internal builder instructions as the user message in chat.
Changes
Before:

After:

How did you test this?
pnpm exec vitest run packages/ui/src/features/loops/loopBuilderPrompt.test.tspnpm 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.tspnpm --filter @posthog/ui typecheckapps/webon existing unresolved@posthog/agentand@posthog/host-trpcexportsAutomatic notifications
Created with PostHog Code