refactor(host): make every remaining consumer use HostResolution#755
Draft
gewenyu99 wants to merge 1 commit into
Draft
refactor(host): make every remaining consumer use HostResolution#755gewenyu99 wants to merge 1 commit into
gewenyu99 wants to merge 1 commit into
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. |
03864d4 to
a8be871
Compare
94b2f8d to
a3defe1
Compare
a8be871 to
25691f6
Compare
a3defe1 to
7ac776d
Compare
gewenyu99
added a commit
that referenced
this pull request
Jun 28, 2026
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
7ac776d to
4ecd3e3
Compare
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`).
Base automatically changed from
posthog-code/host-resolution-class
to
feat/base-url-override
June 30, 2026 00:31
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`).
1f6a999 to
3770db7
Compare
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).
4ecd3e3 to
8ddf75f
Compare
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.
The rest of the migration, stacked on #749 (which adds the class and routes #746's own resolution through it).
Flips
Credentials.hostfrom astringto aHostResolution(resolved once at auth) and routes every remaining consumer through it —host.apiHost/host.appHost/host.gatewayUrl/host.mcpUrl— replacing loose(region, baseUrl)threading everywhere outside #746's own surface: self-driving, source-maps, task-stream, orchestrator, agentic, prompts, Doctor/Slack screens, theWizardUIinterfaces, plus the test/playground ripple.Pre-auth OAuth/provisioning URL resolution stays loose (no region yet).
Review/merge order: #746 (with #749 merged in) → this.