Skip to content

fix(cli): redirect Console on a bare/reserved platform host to the cloud console#2355

Merged
xuyushun441-sys merged 1 commit into
mainfrom
fix/cli-bare-host-console-redirect
Jun 27, 2026
Merged

fix(cli): redirect Console on a bare/reserved platform host to the cloud console#2355
xuyushun441-sys merged 1 commit into
mainfrom
fix/cli-bare-host-console-redirect

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

The "dead login face"

objectstack serve / dev serves the Console SPA on any host, but a bare/reserved platform host (the apex, or www/app/… — none bind a tenant env) has no env → its /api/v1/auth/* calls 404 → the login renders the misleading "Auth request failed with status 404" dead form. The unknown-hostname guard already passes reserved hosts through (RESERVED includes the empty/apex subdomain), so the SPA loads and breaks.

Fix

In the guard, when a reserved/apex platform host gets a /_console* request and the runtime is cloud-connected (OS_CLOUD_URL set), 302 it to the cloud control plane (OS_CLOUD_URL + /_console/). A self-hosted single-env runtime (no OS_CLOUD_URL) keeps the prior pass-through; non-console paths (infra, health, /api) are unchanged; a real env host resolves to a tenant and is served normally.

Verification

Mirrors the same cleanup on the cloud serve-node path (objectos server/index.ts), which was verified live: bare localhost/_console/login302 → cloud console; /api/v1/auth/* still 404; env host /_console200. @objectstack/cli build green (DTS typecheck clean).

Found while dogfooding the magic moment locally (run-stack.sh --seed boots objectos via objectstack dev → this guard). The cloud-side mirror is a separate cloud PR; a cloud .framework-sha bump consumes this.

🤖 Generated with Claude Code

…oud console

`objectstack serve`/`dev` serves the Console SPA on ANY host, but a bare/reserved
platform host (the apex, or `www`/`app`/… — none bind a tenant env) has no env, so
its `/api/v1/auth/*` calls 404 → the login renders the misleading "Auth request
failed with status 404" dead form. The unknown-hostname guard already passed these
reserved hosts straight through (RESERVED includes the empty/apex subdomain), so
the SPA loaded and broke.

Fix: in the guard, when a reserved/apex platform host receives a `/_console*`
request AND the runtime is cloud-connected (`OS_CLOUD_URL` set), 302 it to the
cloud control plane (`OS_CLOUD_URL` + `/_console/`), where the user picks/opens an
environment. A self-hosted single-env runtime (no `OS_CLOUD_URL`) keeps the prior
pass-through, and non-console paths (infra, health, /api) are unchanged. A real env
host resolves to a tenant and is served normally.

Mirrors the same cleanup on the cloud serve-node path (objectos `server/index.ts`),
which was verified live: bare `/_console/login` → 302 → cloud console; `/api/v1/auth/*`
still 404; env host /_console → 200. cli build green (DTS typecheck clean).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 27, 2026 6:16am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cli.

15 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/cloud-artifact-api.mdx (via packages/cli)
  • content/docs/concepts/implementation-status.mdx (via @objectstack/cli)
  • content/docs/concepts/packages.mdx (via @objectstack/cli)
  • content/docs/getting-started/cli.mdx (via @objectstack/cli)
  • content/docs/getting-started/quick-start.mdx (via @objectstack/cli)
  • content/docs/guides/authentication.mdx (via @objectstack/cli)
  • content/docs/guides/client-sdk.mdx (via @objectstack/cli)
  • content/docs/guides/hook-bodies.mdx (via packages/cli)
  • content/docs/guides/packages.mdx (via @objectstack/cli)
  • content/docs/guides/project-scoping.mdx (via @objectstack/cli)
  • content/docs/guides/runtime-services/data-service.mdx (via packages/cli)
  • content/docs/guides/runtime-services/index.mdx (via packages/cli)
  • content/docs/guides/skills.mdx (via packages/cli)
  • content/docs/protocol/objectos/plugin-spec.mdx (via @objectstack/cli)
  • content/docs/protocol/objectos/realtime-protocol.mdx (via @objectstack/cli)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@xuyushun441-sys xuyushun441-sys merged commit 914aaa9 into main Jun 27, 2026
16 checks passed
@xuyushun441-sys xuyushun441-sys deleted the fix/cli-bare-host-console-redirect branch June 27, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants