Skip to content

feat(cli): forward env-driven cluster driver to the runtime in os serve - #2226

Merged
xuyushun441-sys merged 1 commit into
mainfrom
seam/serve-cluster-forwarding
Jun 22, 2026
Merged

feat(cli): forward env-driven cluster driver to the runtime in os serve#2226
xuyushun441-sys merged 1 commit into
mainfrom
seam/serve-cluster-forwarding

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Why

os serve built the Runtime with no cluster config, so it always used the in-memory cluster driver. A multi-replica deployment therefore couldn't coordinate, and the split-brain guard (correctly) blocked it. This is the missing enabler that lets the EE distribution activate the cluster seams cross-node (cloud ADR-0018).

What

  • os serve reads OS_CLUSTER_DRIVER (+ OS_REDIS_URL), dynamically imports the matching @objectstack/service-cluster-<driver> package (so it works in both config-boot and compiled-artifact mode), and forwards { driver, url } to the Runtime.
  • Open-core ships only the in-memory driver; remote drivers (redis) come from the EE distribution. Absent ⇒ graceful fallback to in-memory (warns, doesn't crash). Mirrors the existing OS_DATABASE_URL driver-by-env pattern.

Verification (A/B boot, local redis)

  • OS_CLUSTER_DRIVER=redis + OS_CLUSTER_REPLICAS=2boots (split-brain guard passes ⇒ redis active).
  • no OS_CLUSTER_DRIVER + OS_CLUSTER_REPLICAS=2 → process exits with the split-brain guard (in-memory driver).

Clean A/B proves the forwarding wires redis into the Runtime. Build Core type-checks the change (serve.ts has no unit-test harness).

🤖 Generated with Claude Code

…rve`
`os serve` constructed the Runtime without a cluster config, so it always used
the in-memory cluster driver — a multi-replica deployment could not coordinate
(and the split-brain guard blocked it). `os serve` now reads OS_CLUSTER_DRIVER
(+ OS_REDIS_URL), dynamically imports the matching remote driver package (so it
works in both config-boot and compiled-artifact mode), and forwards the cluster
config to the Runtime. Open-core ships only the in-memory driver; remote drivers
(e.g. @objectstack/service-cluster-redis) are provided by the EE distribution —
absent ⇒ graceful fallback to in-memory.
Verified via A/B boot (local redis): with OS_CLUSTER_DRIVER=redis + replicas=2
the server boots (guard passes = redis active); without it, replicas=2 trips the
split-brain guard (memory). Enables the EE multi-node activation (cloud ADR-0018)
of the cache-invalidation (#2213) and scheduler-leader-election (#2219) seams.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercelBot commented Jun 22, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentJun 22, 2026 4:43pm

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 53f146e into mainJun 22, 2026
16 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the seam/serve-cluster-forwarding branch June 22, 2026 16:45
Sign up for freeto 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

@xuyushun441-sys@os-zhuang