Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: self-host nudge dedupes against the loopback endpoint, not the tailnet one
[._.]/ Adam Eivy231a12c07336
diff --git a/client/src/components/providers/FleetHostSetup.jsx b/client/src/components/providers/FleetHostSetup.jsxindex 77e71b3c11..be3ad04889 100644--- a/client/src/components/providers/FleetHostSetup.jsx+++ b/client/src/components/providers/FleetHostSetup.jsx@@ -7,6 +7,15 @@ import { copyToClipboard } from '../../lib/clipboard';import { useAutoRefetch } from '../../hooks/useAutoRefetch';import RuntimeInstallModal from '../install/RuntimeInstallModal';import Banner from '../ui/Banner';+import { PORTS } from '../../lib/ports.js';++// A self-host provider (the auto-created Direct API one from `configure()` in+// server/services/fleetLlmHost.js, and the OpenCode one from `?selfHost=1`)+// is always wired to the loopback queue address, never `status.endpoint` (the+// tailnet-facing address published for OTHER machines to connect to) — dedupe+// against the address these providers actually use, or the "add a provider"+// nudge below never clears even after the provider exists.+const SELF_HOST_ENDPOINT = `http://127.0.0.1:${PORTS.FLEET_LLM}/v1`;export default function FleetHostSetup({ compact = false, providers = [], onConfigured }) {const [status, setStatus] = useState(null);@@ -39,10 +48,10 @@ export default function FleetHostSetup({ compact = false, providers = [], onConf// peer-discovery cards above only ever surface OTHER instances, so a host// machine that wants to also run OpenCode TUI against its own queue had no// discoverable path to it. Reuse the same dedupe the peer cards use, keyed- // on this machine's own tailnet endpoint.+ // on the loopback address self-host providers are actually wired to.const selfNeedsProvider = useMemo(- () => compact && Boolean(status?.endpoint) && Boolean(status?.serving || status?.enabled)- && !isFleetHostConfigured({ endpoint: status.endpoint }, providers),+ () => compact && Boolean(status?.serving || status?.enabled)+ && !isFleetHostConfigured({ endpoint: SELF_HOST_ENDPOINT }, providers),[compact, status, providers],);diff --git a/client/src/components/providers/FleetHostSetup.test.jsx b/client/src/components/providers/FleetHostSetup.test.jsxindex 52b9d19b93..7d11ad2c6c 100644--- a/client/src/components/providers/FleetHostSetup.test.jsx+++ b/client/src/components/providers/FleetHostSetup.test.jsx@@ -95,7 +95,11 @@ describe('dedicated model host setup', () => {it('does not prompt for this machine when it already has a matching provider', async () => {api.getFleetLlmHost.mockResolvedValue({ ...state, serving: true });api.getFleetPeerHosts.mockResolvedValue({ hosts: [] });- const providers = [{ id: 'self-p1', endpoint: state.endpoint }];+ // Self-host providers are wired to the loopback queue address (both the+ // auto-created Direct API one and the `?selfHost=1` OpenCode one) — never+ // to `state.endpoint`, which is the tailnet address published for OTHER+ // machines to connect to.+ const providers = [{ id: 'self-p1', endpoint: 'http://127.0.0.1:18022/v1' }];render(<MemoryRouter><FleetHostSetup compact providers={providers} /></MemoryRouter>);expect(await screen.findByText('Recommended model host setup')).toBeInTheDocument();expect(screen.queryByText(/serving its own model host/)).not.toBeInTheDocument();diff --git a/client/src/components/providers/FleetProviderSetup.jsx b/client/src/components/providers/FleetProviderSetup.jsxindex 0efd9c28d4..baae56af3e 100644--- a/client/src/components/providers/FleetProviderSetup.jsx+++ b/client/src/components/providers/FleetProviderSetup.jsx@@ -219,7 +219,11 @@ export default function FleetProviderSetup({ peers = [], providers = [], onClosesetError('');if (!name.trim()) return setError('Provider name is required.');if (!URL.canParse(endpoint)) return setError('Enter a full HTTP endpoint for the GPU host.');- if (!selfHost && (isLocalEndpoint(endpoint) || !isPrivateNetworkEndpoint(endpoint))) {+ // Self-host mode prefills the loopback address on purpose (it's this same+ // machine) — but if the user then edits that field to something else, the+ // normal "must be a private/remote endpoint" rule still applies rather+ // than skipping validation for whatever they typed.+ if (!(selfHost && isLocalEndpoint(endpoint)) && (isLocalEndpoint(endpoint) || !isPrivateNetworkEndpoint(endpoint))) {return setError('Use a private LAN, MagicDNS, or Tailscale endpoint on another machine.');}if (!apiKey.trim()) return setError('The networked vLLM runtime must have an API key.');diff --git a/client/src/components/providers/FleetProviderSetup.test.jsx b/client/src/components/providers/FleetProviderSetup.test.jsxindex 1542b2e6e3..c0750d9d9b 100644--- a/client/src/components/providers/FleetProviderSetup.test.jsx+++ b/client/src/components/providers/FleetProviderSetup.test.jsx@@ -141,6 +141,29 @@ describe('FleetProviderSetup', () => {expect(screen.getByPlaceholderText('Enter host API key').value).toBe('self-host-key-1234567890123456');});+ it('still validates the endpoint in self-host mode if the user edits it away from loopback', async () => {+ api.getFleetLlmHost.mockResolvedValue({ hasApiKey: true, model: 'qwen3.8-27b' });+ api.revealFleetLlmHostKey.mockResolvedValue({ apiKey: 'self-host-key-1234567890123456' });+ const onCreate = vi.fn();++ render(+ <MemoryRouter initialEntries={['/ai/fleet?fleetStep=client&selfHost=1']}>+ <FleetProviderSetup onClose={() => {}} onCreate={onCreate} />+ </MemoryRouter>+ );++ await waitFor(() => {+ expect(screen.getByLabelText('GPU host endpoint').value).toBe('http://127.0.0.1:18022/v1');+ });+ // The self-host bypass exists only for the prefilled loopback value — an+ // edited-away public endpoint must still fail the private-network check.+ fireEvent.change(screen.getByLabelText('GPU host endpoint'), { target: { value: 'http://example.com:18022/v1' } });+ fireEvent.click(screen.getByRole('button', { name: 'Create fleet provider' }));++ expect(await screen.findByText(/private LAN, MagicDNS, or Tailscale endpoint/)).toBeInTheDocument();+ expect(onCreate).not.toHaveBeenCalled();+ });+it('surfaces an error in self-host mode when the host has not been set up yet', async () => {api.getFleetLlmHost.mockResolvedValue({ hasApiKey: false });