refactor(host): route #746's host resolution through HostResolution#749
Merged
rafaeelaudibert merged 1 commit intoJun 30, 2026
Merged
Conversation
🧙 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. |
gewenyu99
added a commit
that referenced
this pull request
Jun 28, 2026
With HostResolution carrying the resolved region+host family on the credentials, the standalone `cloudRegion` option is fully dead: - `WizardRunOptions.cloudRegion` is never read anywhere. - `addMCPServerToClientsStep`'s `cloudRegion` param was already ignored (`_cloudRegion`) and its only caller never passes it. Remove both (and the now-unused `CloudRegion` import in the MCP step). Pure dead-code removal — no behavior change. Stacked on #749. Generated-By: PostHog Code Task-Id: fb61e413-9459-4e61-9396-ac008c6bec94
03864d4 to
a8be871
Compare
a8be871 to
25691f6
Compare
Introduce HostResolution — a frozen, resolve-once snapshot of every PostHog origin (api/app/asset/gateway/mcp), a façade over the @utils/urls resolvers that carries the --base-url override through every field. Point #746's own host resolution at it: the auth-time region+host resolution (setup-utils), the LLM gateway (agent-interface, mcp-prompt-streaming), and the region->app-url derivations (linear, audit, events-audit, posthog-integration, AiOptIn) now go through HostResolution instead of getHost/getCloudUrl/ getLlmGatewayUrl/detectRegion. Credentials.host stays a string here, so the single-field sites construct a throwaway HostResolution to read one origin — each marked TODO: clean up in #755, where the Credentials.host flip lets them read off the resolved object. Meant to merge into #746.
25691f6 to
e5eb333
Compare
gewenyu99
added a commit
that referenced
this pull request
Jun 28, 2026
The rest of the migration, on top of the class PR. Flip Credentials.host from a string to a HostResolution (resolved once at auth) and route every remaining consumer through it (host.apiHost / host.appHost / host.gatewayUrl / host.mcpUrl), replacing the loose (region, baseUrl) threading everywhere outside #746's surface: self-driving, source-maps, task-stream, orchestrator, agentic, prompts, Doctor/Slack screens, the WizardUI interfaces, plus test/playground ripple. Also resolves the #749 TODOs — the throwaway single-field constructions become reads off the resolved credentials.host. Pre-auth OAuth/provisioning URL resolution stays loose (no region yet).
rafaeelaudibert
approved these changes
Jun 30, 2026
Comment on lines
+65
to
+66
| /** The resolved cloud region. `'us'` when a base URL is pinned. */ | ||
| readonly region: CloudRegion; |
Member
There was a problem hiding this comment.
I wonder if this should simply be null when a base URL is pinned? We don't even use this for a lot. Or maybe unknown.
| */ | ||
| readonly mcpUrl: string; | ||
|
|
||
| private constructor(fields: { |
rafaeelaudibert
pushed a commit
that referenced
this pull request
Jun 30, 2026
…749) Introduces `HostResolution` and points **#746's own host-resolution code** at it — minimal, meant to **merge into #746** and release with it. Where #746 resolves a PostHog origin via the loose `getHost`/`getCloudUrl`/`getLlmGatewayUrl`/`detectRegion(region, baseUrl)` helpers, it now goes through `HostResolution` instead: - auth-time region+host resolution (`setup-utils`) - the LLM gateway (`agent-interface`, `mcp-prompt-streaming`) - the region→app-url derivations (`linear`, `audit`, `events-audit`, `posthog-integration`, `AiOptIn`) `Credentials.host` stays a `string` here. Flipping it to the object and migrating every *other* consumer is the stacked PR (#755), so this stays minimal and doesn't grow #746. Stacked on #746 (`feat/base-url-override`).
gewenyu99
added a commit
that referenced
this pull request
Jun 30, 2026
The rest of the migration, on top of the class PR. Flip Credentials.host from a string to a HostResolution (resolved once at auth) and route every remaining consumer through it (host.apiHost / host.appHost / host.gatewayUrl / host.mcpUrl), replacing the loose (region, baseUrl) threading everywhere outside prompts, Doctor/Slack screens, the WizardUI interfaces, plus test/playground ripple. Also resolves the #749 TODOs — the throwaway single-field constructions become reads off the resolved credentials.host. Pre-auth OAuth/provisioning URL resolution stays loose (no region yet).
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.
Introduces
HostResolutionand points #746's own host-resolution code at it — minimal, meant to merge into #746 and release with it.Where #746 resolves a PostHog origin via the loose
getHost/getCloudUrl/getLlmGatewayUrl/detectRegion(region, baseUrl)helpers, it now goes throughHostResolutioninstead:setup-utils)agent-interface,mcp-prompt-streaming)linear,audit,events-audit,posthog-integration,AiOptIn)Credentials.hoststays astringhere. Flipping it to the object and migrating every other consumer is the stacked PR (#755), so this stays minimal and doesn't grow #746.Stacked on #746 (
feat/base-url-override).