Skip to content

fix: AI assistant loses deployment region context during setup workflow#156

Open
cristhianrivera wants to merge 1 commit into
PostHog:mainfrom
cristhianrivera:feat/region-aware-host-selection
Open

fix: AI assistant loses deployment region context during setup workflow#156
cristhianrivera wants to merge 1 commit into
PostHog:mainfrom
cristhianrivera:feat/region-aware-host-selection

Conversation

@cristhianrivera

Copy link
Copy Markdown

What happened

While onboarding PostHog and configuring a self-managed analytics setup, I turned to the PostHog chat agent for help with the manual instrumentation steps. That's when I noticed the agent had no awareness of which cloud region I was on. It consistently defaulted to US Cloud during my setup flow, referencing us.i.posthog.com endpoints even though my project lives on EU Cloud. The setup instructions it generated pointed at the wrong ingest host, which caused events to fail silently until I caught the discrepancy manually.

Root cause

The skill descriptions for all six instrument-* omnibus skills, and the base integration skill, listed both US and EU host options — but gave the AI no instruction on how to determine which one applied. Without resolution logic, the agent had no way to surface the ambiguity.

Fix

  • All six omnibus skill descriptions (instrument-integration, instrument-product-analytics, instrument-error-tracking, instrument-feature-flags, instrument-llm-analytics, instrument-logs) now instruct the agent to check the projects-get MCP response for a region field first. If that's unavailable, it must ask the user explicitly: "Are you on PostHog US Cloud or EU Cloud?" — and is explicitly forbidden from assuming US Cloud.
  • integration/description.md gains a new Region and host URL section; it previously had no host guidance at all.

Testing

All 60 existing tests pass (npm test).

…loud

All omnibus skill descriptions listed both US/EU host options but never
instructed the AI to resolve which one to use — causing it to silently
default to US Cloud even for EU users.

Now the AI checks the projects-get MCP response for a `region` field
first, and explicitly asks the user "Are you on PostHog US Cloud or EU
Cloud?" when the region cannot be determined from existing configuration.

Also adds the missing region/host guidance to integration/description.md,
which previously had no host URL instructions at all.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant