Skip to content

fix(dashboard): prefer public endpoint URLs - #7547

Merged
diegosouzapw merged 4 commits into
cheaper-inference:release/v3.8.49from
nguyenha935:fix/prefer-public-endpoint-url
Jul 18, 2026
Merged

diegosouzapw merged 4 commits into
cheaper-inference:release/v3.8.49from
nguyenha935:fix/prefer-public-endpoint-url

Conversation

@nguyenha935

@nguyenha935 nguyenha935 commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Prefer the active public browser origin over a loopback URL embedded at build time.
  • Use active public or managed tunnel endpoints before cloud and local fallbacks.
  • Keep the runtime local API URL separate and stop onboarding from appending an internal port to public domains.

Tests

  • npm run lint
  • npm run typecheck:core
  • 16 focused Vitest regression tests passed.
  • npm run test:unit reached existing unrelated baseline failures: 21 failed and 2 cancelled locally. Tiny reproduced the cancelled Antigravity OAuth timeout test before the run was stopped.

Notes

This only changes display and copyable configuration URLs. Internal server-to-server resolution and OAuth redirect URI handling remain unchanged.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@nguyenha935
nguyenha935 marked this pull request as ready for review July 17, 2026 05:18
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@nguyenha935
nguyenha935 force-pushed the fix/prefer-public-endpoint-url branch from 465a985 to 46d452a Compare July 17, 2026 08:45
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks for this — verified the fix locally in an isolated worktree: npm run lint clean on the touched files, check:dashboard-typecheck passes with zero new TS debt (the pre-existing CopyHandler errors in EndpointPageClient.tsx match the frozen baseline exactly), and your vitest suite is green (useDisplayBaseUrl.test.tsx and EndpointPageClient.test.tsx fully pass; the one ApiEndpointsTab.test.tsx failure I saw is a pre-existing, unrelated base-red I reproduced on release/v3.8.49 without your changes — and your curl-path assertion fix actually resolves a second pre-existing broken assertion as a side effect, nice catch). The public/local URL separation and the onboarding internal-port fix both look correct and well-scoped.

One gap worth closing if you have a moment: onboarding/page.tsx changed production behavior (removing the apiPort-based URL construction) but doesn't get a direct component test — it's covered indirectly through the shared resolveDisplayBaseUrl/isPublicDisplayBaseUrl tests, which is probably enough, but a small render assertion on OnboardingWizard would make the fix self-evidently regression-proof. Not blocking merge from my side.

Separately (not this PR's problem, just flagging): the endpoint/tests and shared/hooks/tests vitest files — old and new — aren't actually reached by any CI script today (test:vitest only runs vitest.mcp.config.ts, and test:vitest:ui's path filter restricts it to tests/unit/ui). Worth a follow-up issue on the CI wiring itself.

nguyenha935 and others added 2 commits July 18, 2026 12:09
Decompose isPrivateIpv4 and isPublicDisplayBaseUrl (both over the ESLint
complexity gate of 15) into small named predicates. Behavior is unchanged:

- isPrivateIpv4 now checks a PRIVATE_IPV4_RANGES table (RFC1918 +
  special-use ranges) through isInIpv4Range instead of one long chain
  of ||/&& comparisons.
- isPublicDisplayBaseUrl now delegates to isSupportedProtocol,
  isLoopbackHostname, isMulticastDnsHostname and isNonPublicIpv6 (itself
  split into isIpv6LoopbackOrUnspecified / isIpv6UniqueLocal /
  isIpv6LinkLocal), preserving the isIpv6 gate so hostnames that merely
  start with "fc"/"fd" (e.g. fdroid.example.com) are not misclassified
  as IPv6 unique-local addresses.

Adds IPv4 range-boundary and IPv6-gate regression tests; all existing
assertions are unchanged.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw
diegosouzapw merged commit a7dba3b into cheaper-inference:release/v3.8.49 Jul 18, 2026
3 checks passed
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks @nguyenha935! Merged into release/v3.8.49 — validated in the combined merge-train. The display-URL predicates were split into named helpers to clear the complexity gate, with boundary tests added.

@diegosouzapw diegosouzapw mentioned this pull request Jul 23, 2026
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
* fix(dashboard): prefer public endpoint URLs

* docs: add changelog fragment for cheaper-inference#7547

* test(dashboard): cover onboarding public endpoint

* refactor(hooks): split display-URL predicates below complexity gate

Decompose isPrivateIpv4 and isPublicDisplayBaseUrl (both over the ESLint
complexity gate of 15) into small named predicates. Behavior is unchanged:

- isPrivateIpv4 now checks a PRIVATE_IPV4_RANGES table (RFC1918 +
  special-use ranges) through isInIpv4Range instead of one long chain
  of ||/&& comparisons.
- isPublicDisplayBaseUrl now delegates to isSupportedProtocol,
  isLoopbackHostname, isMulticastDnsHostname and isNonPublicIpv6 (itself
  split into isIpv6LoopbackOrUnspecified / isIpv6UniqueLocal /
  isIpv6LinkLocal), preserving the isIpv6 gate so hostnames that merely
  start with "fc"/"fd" (e.g. fdroid.example.com) are not misclassified
  as IPv6 unique-local addresses.

Adds IPv4 range-boundary and IPv6-gate regression tests; all existing
assertions are unchanged.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: nguyenha935 <208228297+nguyenha935@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
* fix(dashboard): prefer public endpoint URLs

* docs: add changelog fragment for cheaper-inference#7547

* test(dashboard): cover onboarding public endpoint

* refactor(hooks): split display-URL predicates below complexity gate

Decompose isPrivateIpv4 and isPublicDisplayBaseUrl (both over the ESLint
complexity gate of 15) into small named predicates. Behavior is unchanged:

- isPrivateIpv4 now checks a PRIVATE_IPV4_RANGES table (RFC1918 +
  special-use ranges) through isInIpv4Range instead of one long chain
  of ||/&& comparisons.
- isPublicDisplayBaseUrl now delegates to isSupportedProtocol,
  isLoopbackHostname, isMulticastDnsHostname and isNonPublicIpv6 (itself
  split into isIpv6LoopbackOrUnspecified / isIpv6UniqueLocal /
  isIpv6LinkLocal), preserving the isIpv6 gate so hostnames that merely
  start with "fc"/"fd" (e.g. fdroid.example.com) are not misclassified
  as IPv6 unique-local addresses.

Adds IPv4 range-boundary and IPv6-gate regression tests; all existing
assertions are unchanged.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: nguyenha935 <208228297+nguyenha935@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.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.

2 participants