fix: default generated POSTHOG_HOST to the detected region#802
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix: default generated POSTHOG_HOST to the detected region#802posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
The integration agent was copying the `https://us.i.posthog.com` fallback literal from example code (skill docs / inline snippets) even when the user selected the EU region, producing configs like `POSTHOG_HOST = os.environ.get('POSTHOG_HOST', 'https://us.i.posthog.com')` for EU projects. The detected host was already in the prompt but the agent wasn't using it as the fallback default. Add an explicit instruction to the shared integration prompt to use the detected PostHog Host as any hardcoded fallback/default, and stop the inline Ruby example from hardcoding the US host (which contradicted that guidance). Generated-By: PostHog Code Task-Id: 72a06317-16be-4f06-8590-d001dd2d3dc3
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
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
An EU customer who explicitly selected the EU region in the CLI got a Django config that pointed at the US cloud:
POSTHOG_HOST = os.environ.get('POSTHOG_HOST', 'https://us.i.posthog.com'). Their events would silently land in the wrong region — a data-residency correctness bug.The wizard already knows the region (detected post-token) and threads the correct host into the agent prompt as
PostHog Host. But when the agent generated config code, it copied thehttps://us.i.posthog.comfallback literal from example code (context-mill skill docs for Django; an inline snippet for Ruby) instead of using the detected host as the default.Changes
posthog-integration/index.ts): added an explicit instruction that any hardcoded fallback/default host in generated code must use the detectedPostHog Host, and never emit a fallback for a different region than the detected one. This covers Django and every skill-driven framework.ruby-wizard-agent.ts): stopped hardcodinghttps://us.i.posthog.com, which directly contradicted the new guidance.Test plan
pnpm build && pnpm test(1157 passing) andpnpm lint(0 errors).Created with PostHog Code from an inbox report.