Skip to content

fix: prepare native admin access on the first Agent deployment - #2259

Open
miguelbranco80 wants to merge 16 commits into
openclaw:mainfrom
raw-labs:codex/native-admin-first-deploy
Open

miguelbranco80 wants to merge 16 commits into
openclaw:mainfrom
raw-labs:codex/native-admin-first-deploy

Conversation

@miguelbranco80

@miguelbranco80 miguelbranco80 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Human merge required. Agents must not merge this RFC or enable automatic merging. A human must manually click Merge.

Problem

Closes #2257.

Standard OpenClaw and Standard Codex already enable native UI, but the first admitted revision lacks its Agent origin and device-approval policy. Operators must discover the origin, edit Configuration JSON and redeploy before using an already-enabled UI.

RFC coverage and contribution

Proposed RFC-0023: Native-admin deployment preparation covers the optional ComputeDriver.configureAgent contract, admission order, ownership, opt-outs, failure behavior and unchanged Configuration/history. Originally submitted for human review as RFC-0021, it is renumbered because current main occupies 0021 and 0022. The old-to-new lookup and flow link are updated; upstream's RFCs and index rows are preserved.

Decision status remains Proposed. Implementation status is now Implemented, recording the scoped candidate code and its verification in this PR. It does not claim owner acceptance, a merged release or installed-runtime qualification. The native-admin/Compute owner decision remains a hold.

This contributes first-deployment preparation discussed in the original scope-cut RFC #898, building on trusted-operator pilot #256. Broader scope cuts, execution boundaries, default enablement and the dedicated native terminal decision remain outside this PR. RFC-0023 records separate integration needed for #2596/#906 human identities; this refresh retains machine-only policy and does not broaden authority.

Corresponding PR: Fork PR #12. Both share raw-labs/openclaw-enterprise:codex/native-admin-first-deploy. This refresh does not change the fork's comparison base or other branches.

Change

  • Add optional side-effect-free Compute configuration preparation. OCC supplies a frozen Sandbox-adjusted deployment copy and exact trusted Installation-derived Agent origin. Kubernetes owns native policy and setting-specific conflict rejection; Agent-save checks remain unchanged.
  • Prepare publicOrigin, the exact allowed origin, the existing trusted-proxy identity, operator.admin scopes and device auto-approval before logging, Configuration validation and immutable admission. API and worker use matching inputs, including guided provisioning and both Helm worker placements.
  • Preserve reusable Configurations/generations, historical revisions, compatible settings and Secret bindings. Preserve Installation/routing/UI/device-approval opt-outs. Presets, IAM grants and defaults are unchanged. Existing Agents adopt policy only on their next explicit deployment.
  • Merge upstream main at 774b3d6760f9699506e41da34f7ce1ab751b8424 without rewriting published history. Preserve both native-admin origin preparation and upstream Driver-configuration registry imports in API composition and Kubernetes Compute. Preserve upstream RFC-0022's status and RFC-0023's owner hold. Consolidate repeated wording in the native-admin breaking-change notice after the combined page exceeded the word limit; keep all settings, readiness steps and the untested status. Native-admin flow history and Manual Notes remain unchanged.

Final head: f76001198bdaaef13fdb985ddccf81654e1bb432. Focused diff: 32 files changed, 1036 insertions(+), 265 deletions(-). Fork main and codex/raw-integration were not modified.

Verification

The committed tree is 0fd902878d4cb94b779df2f1ab613dd56c097678, identical to the locally verified candidate. Merge parents are published head cf2ee27610901516cea2c7337c3a62c14f88e73d and pinned main 774b3d6760f9699506e41da34f7ce1ab751b8424. This refresh installed no dependencies and changed no shared test infrastructure.

  • Typecheck, lint, formatting, workspace isolation, OpenAPI parity, suite-registration audit and whitespace checks passed. The managed pre-push formatting check passed too.
  • 440 passed, 2 failed, 87 skipped in the focused Compute/contracts/native-admin/configuration-startup/packaging run with existing Node 24.22.0 and OpenSSL 3.6.3. Native-admin access, WebSocket and upgrade-reset checks passed. The two failures occur before assertions in unchanged repository TLS fixtures: their fixed child-process PATH selects macOS LibreSSL, which lacks the required -addext option. No product or fixture code was changed to hide those failures. Eighty-five packaging cases skipped because yq is unavailable; two skips cover Linux-only contracts. The initial Node 24.3 run could not import the native-admin TLS API; the compatible installed Node resolved that import failure.
  • Docs length, links, RFC validation, full HTML build and Pagefind indexing passed: 270 pages, 4,295 links, 90 specification documents, 23 unique RFC numbers and 701 local spec link targets. Three preserved historical artifact links remain unverified. The combined breaking-changes page initially had 2,509 words; consolidating repeated wording in this PR's notice reduced it to 2,499, with required settings and caveats intact. Other longer pages retain their coherent contract/flow or notice history; no non-exempt page exceeds 2,500 words.
  • Docs checks used a task-private copy of the exact staged tree with its own Git index. The preexisting docs graph's manifest, lockfile, workspace policy and installed lockfile matched exactly before copying. No installation, reconciliation or source-graph changes were made. The Pagefind package entrypoint was invoked directly from that copy to avoid stale absolute paths in its preexisting shim.
  • Current PostgreSQL, browser, cluster, model-turn and release-image qualification were not rerun. Earlier verification and media remain historical evidence, not proof on this head. No material UI output changed in the refresh.
  • New-head CI and CodeQL have started for f76001198bdaaef13fdb985ddccf81654e1bb432; they are pending, not claimed green. Advisory QA was skipped by the existing selector. No workflow or scanner settings were changed.

Local review

The canonical AutoReview helper completed a PR-wide Codex GPT-6 Astra, medium, P0–P2 review against pinned main, with unchanged installation-configuration and registry source supplied as context. It reported scoped-clean, report_produced=true, and no actionable findings. It checked the combined admission path, registry integration, API/worker inputs, opt-outs and saved-Configuration boundary. The final wording-only length correction was reviewed manually and passed docs/format checks; product tests and model review were not repeated solely for prose. Source review does not resolve owner acceptance or installed-runtime qualification.

Commands:

node --test tests/conformance/kubernetes-compute.test.mjs tests/conformance/contracts.test.mjs tests/conformance/native-admin-websocket-relay.test.mjs tests/conformance/native-admin-upgrade-reset.test.mjs tests/integration/native-admin-access.test.mjs tests/integration/configuration-startup.test.mjs tests/integration/production-kubernetes-packaging.test.mjs
pnpm typecheck
pnpm lint
pnpm format:check
pnpm check:workspace
pnpm openapi:check
node scripts/ci/run-tests.mjs audit
# In the exact-tree private copy with the matching preexisting docs graph:
node scripts/docs-site/word-count.mjs
node scripts/docs-site/build.mjs --check
node scripts/check-specs.mjs
node scripts/docs-site/build.mjs
node scripts/docs-site/node_modules/pagefind/lib/runner/bin.cjs --site dist/docs

Previously accepted native-runtime evidence

The review response and uploaded traces/scripts were exercised at prior head eee339c22ceea4fa5213dd785047a810402e1675 and accepted as sufficient scoped proof by the automated review. They establish revision-1 UI access, persistent admin-device enrollment, actual native file writes, forbidden callers denied before Gateway effects, grant/session revocation within the existing 30-second bound, and unchanged persisted records after controller restart. They are historical runtime evidence, not a rerun on the refreshed head.

Real local Gateway/Chromium; controlled Compute activation/ingress and in-memory OCE State/auth policy storage. No model turn or Kubernetes deployment is claimed. First-revision screenshot and seven-second native UI walkthrough:

Native UI on revision 1 at the previously tested head
native-first-deployment.webm

HTTP denial after permission revocation. Console source and controls are unchanged in this feature diff.

Remaining proof and decisions

RFC-0023 is unique on pinned main, but #2518 also proposes RFC-0023. Coordinate these unmerged proposals before either lands. This refresh renumbers neither and merges neither PR.

Native-admin-owner approval of automatic administrator preparation and the optional Compute contract remains pending. Documenting RFC-0023 does not resolve that hold. Final-head CI remains pending. The successful local independent review above does not replace native-admin/Compute owner acceptance or any existing hosted-review/product-acceptance holds. The historical native-runtime walkthrough was not rerun. Genuine current-image k3d/Envoy/model and release-image qualification are unrun. Native device authority remains full administrator authority behind exact-Agent OCE admission and its bounded authorization lease; cancellation of already accepted commands is not promised. Native edits remain gateway-local and outside immutable OCE Configurations.

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR prepares each enabled Agent's native administration policy during deployment without changing its reusable Configuration.

Example: Deploy revision 1 from Standard Codex with Installation native administration and private routing enabled.

  • Before: Native administration reports unsupported until the operator edits Configuration JSON and deploys again.
  • After: Revision 1 receives its exact browser origin and operator.admin device-approval policy.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Scoped runtime and stored-state proof is credible, and the prior finding is resolved; readiness remains capped by the unresolved product decision.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): Real Fastify/OCC/auth/IAM, Chromium, and a pinned local Gateway demonstrate first-revision UI access, persistent admin-device enrollment, actual native writes, forbidden callers denied before Gateway effects, and permission/session revocation within the existing 30-second bound. Evidence was captured at eee339c; the preparation and proxy behavior remains unchanged at the reviewed head. Compute activation and ingress were controlled, with no Kubernetes or model execution claimed. Separate PostgreSQL/filesystem controller-restart proof preserves existing records without migration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: An administrator must discover an Agent origin, edit JSON, and deploy again before opening an already-enabled native UI.
Reason: The usability benefit is concrete, but automatic full-admin device preparation changes the documented per-Agent opt-in contract and adds a public Driver hook.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open for the native-admin owner's direction decision. The previous provisioning finding is fixed, and no new actionable correctness defect was found.

Priority: P2
Reviewed head: 128433480bdc186f460312eece38a8ad486ecdeb
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should Installation native-admin enablement plus an enabled Agent UI authorize automatic administrator device approval through the optional Compute configureAgent contract?
  • Recommendation: Approve bounded automatic preparation: Accept deployment-only preparation with explicit opt-outs and conflict rejection, retaining the existing trusted-operator pilot.
  • Why: The existing guide requires explicit per-Agent preparation, and neither the proposed RFC nor this PR has an approving owner decision.

Before merge

  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

None.

Tests

  • Missing end-to-end proof: Genuine Kubernetes/Envoy/model and release-image qualification remain unrun; the supplied local Gateway proof establishes the scoped admission behavior.
Agent review details

How this fits together

OCC deployment admission passes an Agent identity and Configuration copy to Kubernetes Compute, which prepares native policy before the immutable revision reaches the worker and Gateway.

flowchart TB
  A[Deployment or provisioning] --> B[OCC admission]
  C[Trusted Installation settings] --> B
  B --> D[Kubernetes Compute policy]
  D --> E[Immutable Agent revision]
  E --> F[Worker and private Gateway]
  G[Authorized browser session] --> H[OCC native proxy]
  H --> F
Loading

Technical review

Best possible solution:

Prepare Agent-specific policy through Compute at deployment admission while preserving explicit opt-outs, reusable Configurations, and exact-Agent authorization.

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

Current-main presets enable the UI without the exact origin and device approval required by nativeAdminConfigurationSupported, establishing the unsupported first-revision path from source.

Is this the best way to solve the issue?

Deployment-time preparation uses the owning Compute primitive and avoids embedding Agent-specific origins in shared Configurations; its automatic approval semantics need an owner decision.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c1bd65749c85.

Provenance checked

  • Native-admin opt-in workflow changes intended behavior with a stated reason (feat: add trusted-operator Agent native admin UI pilot #256: The trusted-operator pilot requires explicit compatible native policy and retains full native authority behind exact-Agent admission.)
  • Deployment configuration pipeline keeps the original intent (4cfba92: Shared runtime configuration applies Sandbox transformation and logging before deployment validation while preserving the source Configuration.)
  • Provisioning integration handoff keeps the original intent (feat(kubernetes): run OAuth bootstrap as a bounded Job #1994: Provisioning completion follows initial deployment completion; revision admission alone remains queued.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Kevin Lin: Raw commit 08b1b8f adds apps/controller/src/gateway/native-admin.ts:20 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 08b1b8fe2481; files: apps/controller/src/gateway/native-admin.ts)
  • freeqaz: Raw commit 4a710cb adds apps/controller/src/http/native-admin.ts:882 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4a710cb72594; files: apps/controller/src/http/native-admin.ts)
  • Sebastien Tardif: Raw commit 16b5adb adds apps/controller/src/http/native-admin.ts:862 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 16b5adb028f7; files: apps/controller/src/http/native-admin.ts)

Labels

Label changes:

  • remove status: ⏳ waiting on author: Current PR status no longer selects a status label.

Label justifications:

  • P2: This removes a Configuration-edit and redeployment burden within an advanced trusted-operator pilot.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-12T19:12:02.602Z sha eee339c :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-12T21:01:58.031Z sha eee339c :: blocked before merge. :: none
  • reviewed 2026-10-12T21:12:44.751Z sha eee339c :: blocked before merge. :: [P2] Align the handoff test with main's provisioning completion contract

Reviewed October 13, 2026, 8:15 AM ET / 12:15 UTC (Revision 4).

@miguelbranco80

miguelbranco80 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the proof requests in the upstream review at the unchanged head eee339c22ceea4fa5213dd785047a810402e1675. No product code, presets, database schema or migration changes were needed.

Native authority and denied effects

A fresh revision 1 opened the real local OpenClaw UI through OCC using an exact-Agent human administrator. The actual Gateway enrolled an operator.admin device. An authorized agents.files.set changed its real AGENTS.md, verified independently by reading the container file.

  • Read/operate-only and sibling-Agent administrators received HTTP 403 and failed WebSocket admission, with zero additional requests reaching the Gateway.
  • Removing the exact-Agent grant closed the enrolled device's connection after 21,575 ms. New requests and upgrades were denied before reaching the Gateway; a subsequent native write could not use the closed connection, and the actual file remained unchanged.
  • Signing out the originating OCE session closed the connection after 24,639 ms, again denying new requests/upgrades and leaving the file unchanged after a denied write.
  • Signing in again with the same browser identity confirmed that the original native device record and its approval timestamp remained unchanged. The proof therefore exercises OCE revocation while the persistent native grant still exists.

This uses the production default authorization lease, with the existing 30-second revocation bound. It does not claim immediate per-command revocation. There are no changes to the pilot's private-routing, exact-Agent authorization or full-native-authority boundary.

Environment: macOS arm64, Node 24.19.0, Chromium and immutable local Gateway image sha256:529e6e653ac051b04573951da7471f5517c77bbe88f9f2ed5275781de7a65f46, built from OpenClaw 11d3d04a1279781a770f6a6aa09e6322b064b80a. Fastify, OCC, Native IAM, human authentication and the Gateway were real. OCE State/auth policy storage was in memory; Compute effects, activation and ingress/Envoy were controlled. No model credentials or model turns, real Kubernetes deployment, or release-image qualification are claimed.

First-deployment screenshot and seven-second native UI walkthrough (the RPC and revocation assertions are in the trace below):

Native UI available on the first revision
native-first-deployment.webm

HTTP denial after exact-Agent permission revocation:

OCE denies the native origin after permission revocation

Existing stored state

An upstream main archive at b195e54e9b0ce98ead2b2306015a5209325e837b created three Agents through HTTP/OCC using disposable PostgreSQL and persistent Filesystem Configuration storage. Scenarios included ordinary settings, controlUi.enabled: false and deviceAutoApprove.enabled: false. Each retained a generation-2 Configuration and two immutable revisions.

After stopping that controller process and starting the PR candidate against the same database and Configuration directory, all three Agents, Configuration values/generations, settings/opt-outs and six revisions loaded through the API unchanged. Compute and Secret effects remained existing test Drivers; this is persisted-data/controller restart proof, not an installed runtime upgrade. This diff changes no persisted schema or migration files. Existing native-admission integration coverage also checks template/generation preservation, redeployment, historical revisions and explicit opt-outs.

The existing native-admin-session-postgres.test.mjs suite additionally passed 8 tests, 0 failures, 0 skips, covering shared sessions across two API replicas, logout/expiry, IAM restriction/outage, stop, revision replacement and shutdown. Its native upstream is controlled and its lease interval shortened; it complements the separate real Gateway/default-lease proof above. Owned containers, network and PostgreSQL resources were cleaned up.

Redacted results and scope · Native authority reproduction script · Stored-state restart reproduction script. The scripts are attachments, not additions to the product or test suite; remove the final .txt extension to run them with the documented prerequisites.

Remaining upstream decision

Maintainer approval is still needed for scoped automatic preparation within the already-enabled trusted-operator pilot and the optional Compute contract. RFC #898, candidate 5/D69, remains proposed; this contribution builds on the original pilot #256 without adopting its broader scope cuts or changing defaults. Upstream CI workflows await maintainer approval; genuine k3d/Envoy/model/release-image qualification remains unrun.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. 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. and removed merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 12, 2026
@miguelbranco80

Copy link
Copy Markdown
Contributor Author

Addressed the P2 provisioning-test finding in 128433480bdc186f460312eece38a8ad486ecdeb after merging latest upstream main (c1bd65749c853104e7d0cd6ff13002ebe7000664). Published history is preserved.

The existing native-admin worker integration now waits for durable queued status with revisionId and verifies that replay while deployment is pending returns the same work ID and revision without creating a second revision. The former succeeded expectation reproduces the reported timeout on the refreshed source; the corrected full PostgreSQL provisioning suite passes 39 tests, no skips.

Also passed 367 Compute/native-admin/WebSocket tests (one Linux-only skip), 91 Helm/yq packaging tests, typecheck, lint, formatting, workspace, OpenAPI, suite-registration and docs checks. No new test-only production seam or compatibility shim was added. The two merge conflicts preserve current-main CA handling, shared API/worker native-origin settings and both required test imports.

The PR description now records final-head verification and labels the uploaded browser/native-runtime evidence as historical proof at the preceding revision. Marking this upstream PR ready for review as requested; the fork PR remains draft. Maintainer policy approval, CI and genuine k3d/model/release-image qualification remain pending. Neither PR was merged; fork main and the integration branch were not modified.

@miguelbranco80
miguelbranco80 marked this pull request as ready for review October 13, 2026 12:06
@miguelbranco80
miguelbranco80 requested a review from a team as a code owner October 13, 2026 12:06
@clawsweeper clawsweeper Bot removed the status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. label Oct 13, 2026
@freeqaz

freeqaz commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Free's clanker here (an AI agent working on Free's behalf). Review-only pass at 1284334. The admission hook, the frozen-copy path (agentRuntimeConfiguration receives an Agent only at deployment, packages/occ/src/index.ts:6874; the save-time call at :10358 stays Agent-less), redeploy idempotence (the gateway baseline re-applies cleanly to its own output, and allowedOrigins only appends the missing exact origin) and the opt-outs look right. Locally tests/integration/native-admin-access.test.mjs passes 12/12, and with the two product files reverted to the merge-base the two first-deployment cases fail with unsupported, so the regression is real. Two small items and one note:

  1. The sibling-origin refusal also refuses the console origin when the Agent suffix equals the cookie domain. apps/controller/src/drivers/compute/kubernetes/native-admin.ts:67 derives the "isolated Agent domain" by dropping one label from the derived host. With agentNativeAdmin.domain: oce.example.com (allowed per docs/reference/agent-native-admin.md:17, "The Agent suffix may equal the cookie domain") and the console at https://console.oce.example.com, a Configuration whose gateway.controlUi.allowedOrigins lists the console origin is refused at :89-94 with "cannot trust another origin inside the Installation's isolated Agent domain". Low: nothing needs the console origin there, but the message names the wrong cause. Either exempt the configured public origin (the resolver already holds publicUrl.origin) or say so under "First-deployment configuration".

  2. Worker startup now hard-fails on a partial environment. apps/controller/src/worker.mjs:174-180 resolves the origin at startup, and apps/controller/src/gateway/native-admin-origin.ts:17-24 throws when OCC_AGENT_NATIVE_ADMIN_ENABLED=true but OCC_AGENT_NATIVE_ADMIN_DOMAIN or OCC_AUTH_BASE_URL is missing, or the latter is not HTTPS. The chart now passes all three to the worker, so Helm users are fine; a non-chart deployment that already mirrors the API's OCC_AGENT_NATIVE_ADMIN_ENABLED=true on the worker will crashloop after upgrade. Worth a line in docs/guides/deploy/breaking-changes.md.

  3. Note rather than a defect: with this change every UI-enabled Configuration (both Standard presets ship controlUi.enabled: true) in a pilot Installation receives operator.admin device auto-approval on its first deployment, so any principal holding exact-Agent administer reaches the full native surface without a per-Agent opt-in. The proxy still gates on administer and no OCE grants change, so this is not an escalation; it is the default-on decision your PR body leaves to the owner. The revoke path is deviceAutoApprove.enabled: false (or controlUi.enabled: false) plus a redeploy, or dropping administer.

Merge-tree: clean against main, #2311, #2253 and #2255; textual conflicts only with the stale #906 (native-admin docs and tests) and #1559 (tests/helpers/kubernetes-compute.mjs). CI has not run on this head yet (the fork workflows await approval).

@freeqaz-openai

Copy link
Copy Markdown
Collaborator

Both documentation requests from my earlier review are addressed at 9798d55e. No further wording change requested.

  • Origin: with Console console.oce.example.com inside Agent suffix oce.example.com, the actual resolver/policy rejects that Console origin and a sibling, and accepts the managed Agent origin. With the narrower suffix agents.oce.example.com, it accepts the exact Console origin outside that suffix. The reference now explains the easily missed first case without widening trust.
  • Upgrade: the notice names the new worker inputs, tells custom installations to match the API’s Agent suffix and public HTTPS URL, explicitly says not to copy the shared-cookie domain to the worker, and labels the live upgrade untested. The actual resolver rejected missing suffix, missing public origin and an HTTP public origin; disabled remained disabled. I did not perform a live worker upgrade.

CI Required passed on the published head. In an additional private clean merge with current main, including #2311, all 18 native-admin access tests passed, as did the 448-file docs word gate and formatting of these two pages. These are application/fixture and source checks, not production, a browser walkthrough, or a claim that an old Claw review applies to new bytes.

The remaining question belongs to the native-admin owner: should Installation enablement plus an enabled Agent UI prepare a full administrator device on the first deployment, under this optional Compute contract? This comment closes my documentation feedback, not that decision. No push, live activation, merge or bot rerun from me.

@miguelbranco80

Copy link
Copy Markdown
Contributor Author

RFC coverage is now explicit in RFC-0021: Prepare enabled native administration at deployment admission, submitted in the documentation-only commit 54614e31d before this refresh changes implementation.

It specifies the optional ComputeDriver.configureAgent contract, admission order, unchanged Configurations/history, opt-outs and failure behavior. It links the original scope-cut RFC #898 and pilot #256 without editing another contributor's proposal or implying acceptance. It also records the separate integration needed for #2596/#906 human identities.

Native-admin and Compute owners: please review whether automatic full-administrator preparation within the enabled pilot and this optional Driver contract are acceptable. That owner decision remains a hold. Documentation checks passed; no product tests were run for this RFC-only commit. The main refresh and its verification follow separately.

@freeqaz

freeqaz commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

Free's clanker here (an AI agent working on Free's behalf). Review-only delta pass at 04f5fc63a (since 9798d55e2); nothing pushed or approved.

Delta: one documentation commit, 54614e31d, adding specs/rfcs/0021-native-admin-deployment-preparation.md and a specs/README.md row, plus two merges of main. The merge resolutions read correctly (tests/helpers/kubernetes-compute.mjs keeps both gatewayRouting and the new sandboxDriver/credentialGatewayDriver options; the createHarnessConfiguration import removal matches main). CI Required and First Agent Smoke are green on this head. git merge-tree is clean against main 3bdfcb10f.

Earlier items

New (low): your #2518 also adds an RFC numbered 0021 (specs/rfcs/0021-gateway-outbound.md) and its own specs/README.md row; the two heads conflict in specs/README.md, apps/controller/src/worker.ts and tests/helpers/kubernetes-compute.mjs. Whichever lands second should renumber to 0022.

Since this PR now carries an RFC, it is merged by hand by maintainers; no landing from me.

freeqaz-openai pushed a commit that referenced this pull request Oct 17, 2026
* test: run real-cluster cleanups newest-first and bounded

arrangeProductionTopology registers the platform Namespace delete (the
worker's ServiceAccount) first and the host worker, port-forward and pool
stops later. node:test runs a test's after hooks in registration order and
skips the rest once one throws (finding 1711), so the topology tests
deleted the ServiceAccount under a running worker, and a failed or timed
out Namespace delete skipped every stop and held the file to the runner's
file timeout.

The production topology, OTLP and live Slack tests now hand the topology
a boundedTeardown context: cleanups run newest-first, each within 180 s,
all attempted, and the file exits after an abandoned step.

A conformance test runs each of the three files with the topology helper
replaced by a stand-in that registers the helper's order, fails the
Namespace delete and keeps a worker poll alive until its stop. It fails
(and the file hangs) if any of the nine tests passes its own node:test
context to arrangeProductionTopology.

* test: settle every topology file before asserting its teardown order

Review follow-ups on the stand-in regression: assert after all children
settle, show stdout with stderr when a count is off, drop the resolve
hook's format, explain the per-file test counts, and name the helper's
export list when the parse fails.

harness-topology-k3d-routing-real and native-admin-k3d-real still pass
their own context to arrangeProductionTopology. Both files are in open
PRs (#906, #2259, #2596), so they are left for a follow-up.

* test: register each production topology cleanup on its own

The topology registered its forward, worker, app, pool, Postgres network,
Namespace and directory cleanups as one callback, so a worker stop that
rejected skipped the rest of it even under a bounded teardown.

They are now separate registrations through registerProductionTopologyCleanups,
in dependency order (the forward and worker stop first, the directory last).
arrangeProductionTopology takes withBoundedTeardown of its context: a raw
node:test context, as the routing and native admin tests still pass, gets
its own bounded teardown, and one from boundedTeardown is reused rather
than nested.

A conformance test runs that registration in its own node:test process
with a raw context and a worker stop that rejects at once: every later
cleanup is attempted in order, the worker's error fails the test, and the
file exits once the app close releases what held it. Regrouping the
cleanups into one callback makes it hang and fail.
@freeqaz-openai

freeqaz-openai commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Free’s clanker here. Update for cf2ee276: Required CI passed, and the documentation conflict below is resolved. The flow keeps main’s October 19 session-expiry entry, then your October 17 and 16 entries, plus Manual Notes.

I verified the PostgreSQL result artifact against GitHub’s digest and bound it to tested merge bdd37439 (base a7aa9219 + your head). All 56 provisioning tests passed, none skipped; cleanup passed. The first-handoff case starts with a new Agent, observes exactly one revision with the derived origin, leaves the saved Configuration at generation 1 unchanged, and verifies that retry while pending returns the same work and revision IDs. It deliberately stops at queued, with controlled Compute effects. This is admission and replay evidence, not a claim that the Gateway was serving or a live administrator device was approved.

No rerun requested. Whether an installation with native admin enabled should automatically prepare full administrator access on first deployment remains the RFC owner decision. The human-merge notice is correct and auto-merge is off.


Free's clanker here. On ef1e78f1, required CI passed, and the conflict against main@bfe382cb is small. The important remaining decision is still whether native-admin-enabled installations should prepare administrator device approval on the first deployment. That belongs to the native-admin and Compute owners; the RFC’s human-merge notice is correct.

  • What actually ran: PostgreSQL Platform, 379 passed, including the new first-worker-handoff and pending-replay case. I verified the artifact digest and tested merge dc94e8af (base a77594a9 + this head). The case uses real HTTP, PostgreSQL, IAM, queue and worker; it proves one revision, the same work ID on replay, and unchanged saved Configuration. It deliberately stops at queued, not serving. The separate Gateway Routing suite wasn’t in that run; the earlier walkthrough remains evidence on its stated revision.
  • How to sync: A trial three-way merge found only docs/flows/agent-native-admin.md conflicted, in front matter and history. Keep main’s Oct 19 session-expiry entry followed by your Oct 17 and 16 entries; the substantive flow text and main’s root-navigation recovery change combine cleanly. RFC 0023 is still available on that main. No branch push or rerun from me.

This branch has not been deployed

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

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native admin UI needs manual Configuration repair after the first Agent deployment

3 participants