Skip to content

feat: add standard hosting profiles - #107765

Closed
giodl73-repo wants to merge 35 commits into
openclaw:mainfrom
giodl73-repo:user/giodl/standard-hosting-profiles-upstream
Closed

giodl73-repo wants to merge 35 commits into
openclaw:mainfrom
giodl73-repo:user/giodl/standard-hosting-profiles-upstream

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Related RFC: openclaw/rfcs#37 Depends on: #104018 > Stacked implementation: this branch contains readiness head c21cf2903f4 followed by twenty-one profile-only commits. Until PR 104018 lands, GitHub shows both layers; afterward this PR reduces to the Hosting Profiles work below. ## Problem OpenClaw runs locally, in containers, behind identity proxies, and as a controller for paired execution targets, but those deployment labels are not reproducible support contracts. Their intended posture is scattered across flags, environment, config, probes, and private checklists. A live Gateway can therefore claim readiness without satisfying the runtime facts its host expects. ## Standard Hosting Profiles Profiles are optional, named, release-tested presets over the readiness conditions from PR 104018. They do not create another evaluator. | Profile | Supported posture | Additional required evidence | | --- | --- | --- | | local | Explicit foreground/local Gateway | Writable workspace | | container | Directly reachable container listener | Non-loopback effective listener and writable workspace | | reverse-proxy | Gateway behind a trusted identity proxy | Trusted-proxy auth, identity header, trusted source, explicit loopback allowance when applicable, and writable workspace | | node-mode | Gateway controlling execution targets | Approved pairing, connected target, canonical command-policy approval, live control channel, and writable workspace | Selection precedence is gateway startup argument > environment > openclaw.json. Without a selection, OpenClaw preserves the legacy Gateway readiness decision and emits no profile or activation fields. Selecting a profile explicitly opts into canonical readiness even when no standalone gateway.readiness section exists. Machine-readable readiness then identifies the profile, its source, a logical runtime ID, and a unique incarnation ID. Invalid selected values fail before destructive reset/force behavior; shadowed lower-precedence values are ignored. Profiles observe effective runtime state. They do not generate or repair configuration, add Lobster/OCC concepts, encode scheduler policy, or replace direct criterion selection. ## Why This Helps Docker, Kubernetes, systemd, OCC, and downstream hosts consume ordinary /readyz: 200 means the selected posture can serve work; 503 carries named unmet conditions. Maintainers gain a bounded scenario matrix for reproducing issues against postures OpenClaw explicitly ships and exercises. The reverse-proxy profile validates sources with the same address matcher as authentication and rejects listener/source combinations that cannot connect; it remains a configuration observation rather than a synthetic ingress request. Node-mode uses OpenClaw's current pairing owner, pairing generations, and canonical command policy, so a stale or merely connected node cannot satisfy readiness. A timed-out pairing read permits one bounded replacement read, never more than two concurrent reads, and errors are redacted. Profile and activation identity remain present even when outer readiness evaluation fails. ## Implementation Exact profile head: baaaa1af50d, based on readiness head c21cf2903f4. Profile-only diff: 39 files, 2,074 insertions, 18 deletions, including tests and documentation. The profile-only comparison remains available in fork PR 94. ## Validation - The current changed-file run passes 361 assertions; its only failure is an archive-timestamp test that cannot spawn the missing local zip executable. The focused post-fix profile/readiness run passes 113 assertions. The broad Gateway file has the same three unrelated failures on the exact readiness base. - Type-aware lint, formatting, and git diff --check pass on the exact head. - Independent review confirms profile-only selection opts into canonical evaluation, failure metadata survives evaluator failure, and unprofiled/unconfigured mode remains legacy. - Three broad gateway.test.ts failures reproduce identically on the exact readiness base: one reload timing assertion and two stale agents.list fixtures. - Prior package-installed Docker proof covered all four profiles, expected listener/auth/node/workspace failures, recovery, and unprofiled compatibility. Exact-head remote proof remains a landing gate and is currently blocked by remote allocator authentication. ## Deliberate v1 Boundary RFC 0023 standardizes the four built-in profiles, optional selection, provenance, activation identity, readiness composition, and packaged scenario checks. Custom profile inheritance, host assertions, immutable conformance records, and attestation are future work rather than promises in this PR.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@giodl73-repo
giodl73-repo force-pushed the user/giodl/standard-hosting-profiles-upstream branch from 70bcdc6 to a416b9b Compare July 15, 2026 03:27
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Restacked exact head: a416b9b9192b55ed2be54ad1124c2bbf7b632d9a, directly on readiness PR #104018 head 89d8607aab9f9a942d45a6910cba1db3a210e239.

  • all seven profile commits are patch-identical by git range-diff
  • 310 changed-file assertions passed; the profile-added Gateway startup assertion also passes alone
  • two unrelated broad gateway.test.ts failures reproduce identically on the exact readiness base and are documented in the PR body
  • shell/JS syntax, Oxfmt, Oxlint, and diff checks pass
  • profile-only Codex review found no actionable correctness regression
  • exact-head package-installed Docker matrix exited 0 with Hosting profiles Docker E2E passed
  • image: sha256:e87c9e0651d60b6b58262b6ee271f89d0bee060fd2761d0da1525aca60fd6337
  • local, container, reverse-proxy, node-mode, workspace-full/recovery, and real node-approval scenarios all produced their expected canonical readiness result

HOSTING_PROFILES_EXACT_HEAD_PROOF=passed

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 15, 2026
@clawsweeper

clawsweeper Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 16, 2026, 7:50 PM ET / 23:50 UTC.

Summary
Adds canonical readiness infrastructure plus four opt-in standard Gateway hosting profiles, runtime activation identity, config/CLI/environment selection, plugin readiness registration, operator documentation, and Docker release conformance.

Reproducibility: not applicable. This PR proposes a new named hosting and readiness capability rather than fixing broken behavior with an existing contract. Its real scenarios are nevertheless reproducibly exercised by the supplied package-installed Docker matrix.

Review metrics: 3 noteworthy metrics.

  • Public selection surfaces: 3 config fields, 3 CLI flags, 3 environment variables added. These become operator-facing startup and upgrade contracts that require stable precedence and documentation.
  • Plugin SDK expansion: 1 registration method and 2 public readiness types added. External plugins may depend on this API after release, making its ownership and evolution compatibility-sensitive.
  • Release conformance: 1 Docker lane added to release checks. Every release would inherit runtime cost and maintenance responsibility for the approved hosting-profile matrix.

Stored data model
Persistent data-model change detected: migration/backfill/repair: .github/workflows/openclaw-release-checks.yml, migration/backfill/repair: src/gateway/server-methods-list.test.ts, migration/backfill/repair: test/scripts/package-acceptance-workflow.test.ts, serialized state: scripts/e2e/hosting-profiles-client.mjs, serialized state: src/commands/ready.test.ts, serialized state: src/gateway/server-http.probe.test.ts, and 3 more. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] Approving this PR commits core releases to supporting and testing four named deployment postures whose exact membership and semantics are a product/support policy choice.
  • [P1] The new config, CLI, environment, Gateway RPC, and plugin SDK surfaces become compatibility-sensitive contracts that cannot be casually renamed or removed after release.
  • [P1] A selected profile intentionally changes readiness to fail closed with HTTP 503, and invalid profile or runtime identity values stop startup; rollout and upgrade documentation must make that operator impact explicit.
  • [P1] The branch is stacked on the still-open readiness PR, so reviewing or merging the aggregate branch before the dependency lands risks combining two separate product/API decisions and complicating future rebases.

Maintainer options:

  1. Land readiness, then approve profiles (recommended)
    Merge feat: add readiness conditions and providers #104018 first, rebase to a profile-only diff, and obtain explicit maintainer approval for the four-profile public contract.
  2. Narrow the supported matrix
    Remove any profile whose support semantics are not yet accepted and keep the release lane limited to the approved postures.
  3. Pause the profile layer
    Keep direct readiness criteria as the only contract if maintainers do not want a named core hosting support matrix.

Next step before merge

  • [P2] No mechanical repair is identified; maintainers must first decide the core profile matrix and dispose of the open readiness dependency.

Maintainer decision needed

  • Question: Should OpenClaw commit to local, container, reverse-proxy, and node-mode as permanent core, release-tested hosting profiles with public config, CLI, environment, readiness, and support contracts?
  • Rationale: The implementation is coherent and proven, but code review cannot decide which deployment postures OpenClaw promises to support as named core products or whether that long-lived surface is worth the compatibility and release burden.
  • Likely owner: steipete — Their recent core/plugin boundary and Gateway policy history makes them the strongest available owner for the permanent product-contract choice.
  • Options:
    • Approve the four-profile matrix (recommended): Land the readiness dependency first, then accept all four opt-in profiles and their release conformance as the initial supported core matrix.
    • Narrow the initial matrix: Accept only the clearly bounded local, container, and reverse-proxy profiles while deferring node-mode until its control-plane support contract is separately approved.
    • Keep direct criteria only: Decline named core profiles and retain operator-selected readiness criteria as the supported low-level mechanism.

Security
Cleared: The diff adds no dependency source or secret-permission expansion, and trusted-proxy state is observed for readiness without weakening authentication enforcement.

Review details

Best possible solution:

Land and stabilize the canonical readiness foundation first, then rebase this PR and explicitly approve a documented core profile matrix that remains opt-in, preserves unprofiled upgrades, and keeps every profile condition covered by package-installed release conformance.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR proposes a new named hosting and readiness capability rather than fixing broken behavior with an existing contract. Its real scenarios are nevertheless reproducibly exercised by the supplied package-installed Docker matrix.

Is this the best way to solve the issue?

Yes for implementation shape: composing opt-in named presets over one canonical readiness evaluator is narrower and more maintainable than creating a second health system. Product acceptance of the exact core matrix and public API surface remains unresolved.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 334c182c2729.

Label changes

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P3: This is a speculative but well-developed hosting and operator ergonomics feature rather than a current user-facing regression.
  • merge-risk: 🚨 compatibility: The branch adds public config, CLI, environment, Gateway, and plugin SDK contracts that existing tooling and future plugins may depend on.
  • merge-risk: 🚨 availability: Selected profiles intentionally keep readiness at 503 or stop startup when required deployment facts or valid startup values are missing.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • feature: ✨ showcase: ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. A reproducible, release-tested deployment posture could substantially improve operator support and prevent hosts from mistaking process liveness for workload readiness.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR provides after-fix package-installed Docker output showing successful and fail-closed behavior across every profile, node approval, storage exhaustion, recovery, and the unprofiled upgrade-safe baseline.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR provides after-fix package-installed Docker output showing successful and fail-closed behavior across every profile, node approval, storage exhaustion, recovery, and the unprofiled upgrade-safe baseline.
Evidence reviewed

What I checked:

  • Profile implementation: The branch defines local, container, reverse-proxy, and node-mode as closed built-in profile IDs and composes their checks over the canonical readiness condition model. (src/hosting/profiles.ts:7, 672bc488cfdc)
  • Upgrade-safe opt-in behavior: Profile resolution remains unset by default, while explicit config, environment, or startup override selects a profile; the focused tests verify the unprofiled baseline remains unchanged. (src/hosting/profiles.test.ts:14, 672bc488cfdc)
  • Public configuration surface: The branch adds hosting.profile plus requiredCriteria and advisoryCriteria readiness selectors to the strict configuration schema. (src/config/zod-schema.ts:69, 672bc488cfdc)
  • Public plugin contract: The stacked readiness layer adds registerReadinessCriterion and exported readiness result/criterion types, making this a compatibility-sensitive external plugin API decision. (src/plugins/types.ts:2464, 17b34f792d87)
  • Real behavior proof: The PR body reports a package-installed Docker run that observed the expected 200/503 results for unprofiled, local, container, reverse-proxy, node-mode, command approval, ENOSPC, and recovery scenarios on runtime proof head f54affa3983. (scripts/e2e/hosting-profiles-docker.sh:1, f54affa3983b)
  • Current-main behavior: Current main documents the existing /readyz lifecycle probe but has no hosting-profile flags or named posture contract, so the requested capability is not already implemented or shipped. Public docs: docs/cli/gateway.md. (docs/cli/gateway.md:261, 334c182c2729)

Likely related people:

  • steipete: Recent history shows repeated ownership of plugin registry/API architecture, Gateway policy helpers, and core product-boundary refactors relevant to approving a permanent hosting-profile contract. (role: core and plugin contract contributor; confidence: high; commits: 629baf5, bbb0b57, ab96520; files: src/plugins/types.ts, src/plugins/registry-api.ts, src/gateway/server.impl.ts)
  • vincentkoc: Introduced the channel-backed Gateway readiness behavior and has recent work across Gateway runtime and documentation surfaces affected by this proposal. (role: Gateway readiness contributor; confidence: high; commits: ab5fcfc, 776e5d8, ba9eaf2; files: src/gateway/server.impl.ts, src/gateway/server/readiness.ts, docs/cli/gateway.md)
  • gumadeiras: Carried major recent Gateway startup, deferred-channel, and runtime-structure changes that intersect the proposed readiness evaluation lifecycle. (role: recent Gateway startup contributor; confidence: high; commits: 771fbea, 96ed010, 1b234b9; files: src/gateway/server.impl.ts, src/gateway/server/readiness.ts, src/gateway/server-methods/health.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (3 earlier review cycles)
  • reviewed 2026-07-15T10:27:29.285Z sha a416b9b9192b55ed2be54ad1124c2bbf7b632d9a :: found issues before merge. :: [P1] Preserve existing readiness when no profile is selected
  • reviewed 2026-07-16T02:35:21.622Z sha f54affa3983b4803e424e098cf1b359c42481704 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-16T03:37:35.919Z sha f54affa3983b4803e424e098cf1b359c42481704 :: needs maintainer review before merge. :: none

@giodl73-repo
giodl73-repo force-pushed the user/giodl/standard-hosting-profiles-upstream branch from a416b9b to f54affa Compare July 15, 2026 14:37
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

HOSTING_PROFILES_RESTACK_VALIDATION=passed

Addressed the review concern about implicit local activation:

  • rebased the profile stack onto readiness head 17b34f792d8
  • profiles are now explicitly opt-in through config, env, or the Gateway startup argument
  • no selected profile preserves the existing readiness baseline and adds neither ProfileSelected nor WorkspaceWritable
  • exact head f54affa3983b4803e424e098cf1b359c42481704

Exact-head package-installed Docker proof passed:

unprofiled                         200 (no profile-only conditions)
local                              200
container, non-loopback            200
container, loopback                503 ContainerGatewayLoopback
reverse proxy, trusted             200
reverse proxy, wrong auth          503 TrustedProxyAuthMissing
node-mode, no target               503
node-mode, connected unapproved    503 NodePairingPending
node-mode, approved                200
workspace writable/full/recovered  200 / 503 WorkspaceStorageFull / 200

The lane built and checked the package tarball, then ran against image sha256:20d507b613b346e1165add88234eb00390ea6d1b086970dd3589dd3f41654175. Focused changed-surface tests passed (273 assertions), as did Oxfmt, type-aware Oxlint, and git diff --check.

The unrelated sessions.abort Gateway E2E timeout reproduces on the exact readiness base. The other broad-file workspace-plugin count assertion passes when selected directly on both heads.

@clawsweeper re-review

@giodl73-repo
giodl73-repo force-pushed the user/giodl/standard-hosting-profiles-upstream branch from 4eda8e1 to baaaa1a Compare July 24, 2026 13:30
@clawsweeper

clawsweeper Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat: add standard hosting profiles This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Superseded by #113422, which restacks Hosting Profiles on the consolidated core-condition PR #113421 without force-pushing this review history. The corrected profile-only comparison is giodl73-repo#157.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android app: web-ui App: web-ui cli CLI command changes commands Command implementations docker Docker and sandbox tooling docs Improvements or additions to documentation feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant