Skip to content

feat(plugins): show deployment-specific supervisor guidance - #157679

Open
RomneyDa wants to merge 13 commits into
mainfrom
feat/plugin-supervisor-guidance
Open

RomneyDa wants to merge 13 commits into
mainfrom
feat/plugin-supervisor-guidance

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Externally supervised installations correctly refuse native service management and self-update, but their recovery copy cannot identify the deployment's actual supervisor or command. Deployment packages need static guidance without a new operator setting or runtime registration callback. Closes #157668; static-plugin alternative to openclaw/rfcs#75.

User Impact

People running OpenClaw under an external deployment manager see that package’s literal update or recovery command and can copy it from the dashboard. The package opts in through static plugin metadata; existing supervision refusals and manual control remain unchanged. No new operator setting or automatic command execution is introduced.

Why This Change Was Made

  • Add bounded literal supervisorGuidance metadata to openclaw.plugin.json, with a parser and types on the existing plugin-entry SDK surface.
  • Resolve metadata from exactly one enabled/allowed provider without activating plugin code. Missing actions, unavailable/malformed metadata, and ambiguous providers retain the built-in copy.
  • Keep OPENCLAW_SUPERVISOR_MODE=external and every existing refusal/control decision authoritative. Commands are display-only: never executed, stored in update history, or stamped into prompts.
  • Port to the current CLI/Doctor/setup owners and actual Gateway update.run pre-admission refusal, which has no durable run. Preserve the immutable release updater and retained legacy bridge.
  • Require an explicit includeSupervisorGuidance: true request on both RPCs; default responses retain their existing shape for released closed validators.
  • Repair the current result validator to recognize existing no-run refusals (runId: null, ok: false, skipped result); admitted runs still require a valid durable/OCM identity. This changes no emitted receipt or admission authority.
  • Show transient literal guidance and a copy button through the current Solid dialog and extracted Settings attempt component. Unrelated failures never acquire supervisor commands; disconnects, denied access, failed reads and absent current guidance clear it.

Current repair

Integrated main 1bc412fb747895bb7420bb8b02004103a2c607f8 for real conflicts. Removed obsolete setup recovery/type extraction and old UI restoration. Centralized repeated lookup in existing CLI/Doctor presentation owners; no new coordination, persistence or service authority. Generated Gateway predicates are mechanical output, separate from the authored port. Net test growth +698 includes independent parser, activation/discovery, current routed refusal and actual-bundle browser boundaries; allocation records the 298 lines above the default 400-line allowance.

The first local review identified unsolicited response extensions, observed config-read effects, a missing selected workspace, stale Retry copy, and an empty fallback row. All five were repaired together. New regressions reproduced four backend failures and the stale-command UI failure before the fixes; all now pass. Lookup uses isolated, unobserved config I/O, deferred shell fallback and the existing control-plane workspace selector. A fresh follow-up review found two additional issues: guidance now consumes the existing root-matched plugin quarantine decision before counting providers, and the unreachable legacy-handler guidance/test were removed. The real metadata-boundary quarantine regression was red before the fix and green afterward; a quarantined provider cannot suppress a healthy deployment package.

Evidence

  • Real static-manifest current update.run boundary: regression red on unmodified main, green with the port; current routed Gateway checks passed. No prepare/restart/broadcast or durable run is created by the current external refusal.
  • Isolated real pnpm openclaw gateway start --json: structured refusal includes the package-owned command, with throwing plugin runtime unexecuted. On the port head e1900bdf, a separate foreground Gateway and shipped CLI exercised actual WebSocket update.status and update.run: defaults omit guidance; explicit requests receive the exact static command. The Gateway was stopped and its isolated port verified closed afterward.
  • The actual compiled response validator from released tag v2026.11.10 accepts the real default update.status receipt; the explicitly opted-in extension is rejected by that old closed validator as expected. The old release still rejects its inherited no-run update.run shape; the candidate validator is now corrected and separately proven below.
  • Actual current update.run handler → generated result validator: the guidance refusal was red on the inherited string-only schema; all 13 owning handler cases pass after the correction, including accepted-ID and invalid-null-result guards. Current core and Gateway-method test types, type-aware lint, generated predicates, and native protocol contract/determinism checks pass.
  • The result-contract union initially omitted the generated public Swift admitted-receipt model. Real Swift callers failed to compile when the model was absent and when optional initializer arguments moved ahead of the required arguments; the admitted caller now compiles against the full canonical generated protocol. The admitted struct retains its original initializer argument order and source API. Swift pre-admission refusals remain untyped, as before; a proposed permissive refusal model was removed rather than introducing a second, weaker contract. Both owning native artifact tests and all 13 update handler cases pass.
  • Static parser/manifest/discovery suites: 36 passed. Current status-config/resolver/routed refusal suites after review repair: 47 passed.
  • All 15 affected update UI suites: 160 passed, including no-run refusal and withholding commands for unrelated failures.
  • Actual production Solid bundle, Chromium 1440×1100: 2 browser cases passed. Checked generic/custom refusal, literal HTML-looking command text, actual clipboard bytes, retained Settings guidance and no run/history/report requests.
  • Port validation at e1900bdf: core/UI and Gateway/services/Doctor/commands/update test type graphs all passed. The subsequent result-contract correction passes its current core and Gateway-method graphs.
  • Port full build at e1900bdf, targeted type-aware lint, format, generation and i18n verification: passed (including all 165 public SDK subpaths, shipped-API surface check and four touched MDX pages).
  • Local ClawSweeper: the full port review at e1900bdf cleared its seven repaired findings; subsequent committed correction reviews found the inherited result-contract mismatch and two Swift compatibility issues. All were repaired. The final 8249f0c9..c3a519ee review reports no correctness or security findings.

Inherited / unrun

Three lifecycle stale-cleanup test cases fail identically on unmodified pinned main: the fixture expects raw process.env, while the unchanged restart owner passes its service environment projection (OPENCLAW_PROFILE is undefined, not inherited default). These are recorded failures, not passing caller-suite evidence. The port's async policy callback assertion was separately corrected; its native policy regression passes. Initial affected-caller sweep: 195 passed/4 failed; after that correction, remaining failures are exactly those three inherited cases.

Pinned main independently returns runId: null for pre-admission update refusals while its result schema requires a string. The actual released validator rejects both default and opted-in no-run receipts on this inherited field mismatch. The candidate now fixes this mismatch with separate admitted/no-run result states; the earlier released validator is unchanged, and its rejection is not counted as passing upgrade proof.

Browser data is synthetic and supplied through the Gateway fixture; the screenshots are the actual production UI, not a recreated screen. Separately, the port-head production Control UI was connected to a real isolated foreground Gateway with an installed synthetic deployment plugin: clicking Update Gateway → Update and restart showed the exact package command, and the real clipboard matched its bytes. No existing live deployment/model or stable-upgrade acceptance is claimed. The old body's prior-head CI/upgrade claims and unavailable media have been replaced rather than treated as current evidence. No merge, closure, release or live deployment mutation.

Visual proof

Same synthetic no-run external refusal, en-US, Chromium 1440×1100. Before: current main 1bc412fb; after: repaired head e1900bdf54929a5e97a9bb1a5d6d33a21738dc94 (UI unchanged from the captured 8a0a58b bundle). Clean frames first, measured annotated copies second; wide captures are stacked for readability.

Clean before

Before: generic external-supervisor refusal

Clean after

After: deployment name, run location and literal copyable update command

Annotated before

Before: generic recovery copy highlighted

Annotated after

After: static deployment guidance highlighted

Retained Settings guidance

After: the current Settings attempt component retains the same literal guidance

Real isolated Gateway + production UI

Supplemental port-head capture (UI unchanged by later validator/native-generation-only corrections): actual production Control UI connected over WebSocket to a real isolated Gateway with an installed synthetic deployment plugin (not a Gateway browser fixture). Update refusal and copy action exercised end to end; no existing live deployment or model proof. Isolated Gateway stopped afterward.

Final head: actual isolated Gateway supplies the installed plugin command to the production UI, with successful copy

Current CI

Published candidate 8b06d8692e2fd83291ecb4644e0691c61accdabf; exact-head CI is pending. Earlier-head checks are not current-head proof.

The first current-head CI found an unchecked generated-artifact lookup in the new test. It now uses the existing named assertion helper; the actual owning root.scripts type graph and both native artifact cases pass. The earlier root.tooling graph did not cover this test and is not substituted for that proof. No production behavior changed in this correction.

CI follow-through: refreshed the exact UI request assertions for explicit supervisor-guidance opt-in without weakening session-key, authorization, refresh or timeout checks (four cases red before, all 66 cases across both files green after; 2.20 seconds locally). The status-schedule fixture now preserves real exports; its 22 owning cases, proper Gateway/UI test type graphs, typed lint and format pass. The mock-export ratchet was red and passes after removing two obsolete exact allowances (including the already-preserved daemon supervision mock). Five additional net test lines keep complete mock exports and exact wire assertions; allocation is 298 for net +698. No production or visual behavior changed.

Prior-head CI also timed out during plugin-SDK boundary artifact preparation after 420 seconds, after emitting the SDK and Discord declarations. No compiler diagnostic was reported at that boundary; this is not qualified as inherited or passing, and remains pending fresh-head CI.

@clawsweeper

clawsweeper Bot commented Sep 24, 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.

@RomneyDa
RomneyDa marked this pull request as ready for review September 24, 2026 23:19
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations size: XL labels Sep 24, 2026
@RomneyDa
RomneyDa force-pushed the feat/plugin-supervisor-guidance branch from 48f5ee0 to aa1108a Compare September 24, 2026 23:37
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Addressed the accepted P2 finding: supervisor guidance now clears as soon as the connected Gateway source changes. The regression fails before the fix and passes afterward; it covers same-client reconnection, a late retired response, and a failed current status read. All 28 owner tests pass with one worker (2.31 seconds wall).

Also fixed the parser's duplicate record helper, PR-wrapper dependency inventory, fixture type errors, and test lint. Rebased onto main's fix for the previous UpdateStepResult declaration failure (#157659). Fresh CI is running.

Maintainer scope is explicit: this PR implements the requested plugin SDK approach, including its config selector and display plumbing. RFC #75 is design context, not a second guidance producer. The existing external-supervisor environment mode retains lifecycle authority; no update execution or migration semantics change. No merge is requested.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@paulcam206 paulcam206 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Published the final CI correction in 974332eeda2: moved the unchanged shared setup outcome type into the existing setup.types.ts leaf and updated its three imports, removing the Madge cycle. Madge now reports zero cycles, and all 133 focused wizard/system-agent setup tests pass. The full build and plugin typecheck pass as well.

The preceding exact-head review was platinum hermit with no findings. Please review the new head; this request does not authorize merging.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head d828f683c48b54ab11f1644a03dba2fd6ecf3876, but the PR head is now 5120627c92e0014a57df1ea04d1a95d32b186376. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (34 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-30T05:17:23.145Z sha 55795caeaf19f74f52e1f01f313fbe88374d28b0 :: blocked before merge. :: none
  • reviewed 2026-09-30T05:36:28.256Z sha b86964b :: blocked before merge. :: none
  • reviewed 2026-10-09T05:37:56.451Z sha b86964b :: needs changes before merge. :: none
  • reviewed 2026-10-10T00:50:26.547Z sha 9c37d92 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-11T06:16:57.279Z sha 093dc8f :: needs maintainer review before merge. :: none
  • reviewed 2026-10-11T15:25:23.985Z sha a98f20d :: needs changes before merge. :: none
  • reviewed 2026-10-11T18:29:24.118Z sha 93173ff :: needs changes before merge. :: none
  • reviewed 2026-10-11T19:29:01.141Z sha d828f68 :: needs changes before merge. :: none

@RomneyDa

Copy link
Copy Markdown
Member Author

Ready for maintainer review; not merged and auto-merge is disabled.

  • Final head: 974332eeda2a3feb0f9378acb7e582cc31a28d48. Non-draft and conflict-free.
  • ClawSweeper: platinum hermit for overall, proof, and patch; no code or security findings. Accepted stale-guidance finding is fixed with a regression test.
  • Fixed PR-related CI failures and rebased onto the main declaration-build fix. Full build, all TypeScript lanes, focused regression tests, Madge, and changed-file lint pass.
  • Full CI is deferred by repository release priority for Full Release Validation 36073359097. The workflow says priority restoration reruns deferred PRs.
  • Local broad lint has four unrelated max-lines failures, documented in the PR body. The failing files and lint inputs are identical on main 36abfd8797a; another rebase would not resolve them. The full local check stopped there, so later steps are not claimed passed.
  • Compatibility evidence is in the PR body, including optional/default behavior and the need to remove the new selector before downgrading to an older strict config schema. Ordinary maintainer compatibility review remains before merge.

Holding on the unrelated main/CI issues as requested. No merge requested or performed.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 25, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

The unrelated main lint failures are now addressed separately in #157749, as requested. That test-only PR preserves all existing cases and assertions; all 137 affected tests and focused lint pass.

This PR's current failed CI gate is the repository-wide Full Release Validation priority deferral (run 36073359097), not a new supervisor-guidance failure. Leaving both PRs unmerged.

@RomneyDa
RomneyDa force-pushed the feat/plugin-supervisor-guidance branch from 974332e to ac4f1cd Compare September 25, 2026 01:13
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Rebased onto main ef2dd323512 to incorporate the guest-question E2E authority fix (229ab8a1fe9). The feature patch is unchanged; new head is ac4f1cd9a2857e467ee6360272aa0c46ae2d962b, and fresh full CI is running after the release-priority hold cleared.

The previous Shared OpenClawKit scan reported GatewayExternalAuthorizationError, introduced independently by #157454. Its source is identical on current main and this branch; the supervisor change only regenerates protocol models. No lint exceptions or unrelated Swift changes were added. The separate test-lint repair is #157749.

No merge requested.

@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Maintainer refresh at exact head 55795caeaf19f74f52e1f01f313fbe88374d28b0:

  • Preserved the earlier UI copy-feedback repair and focused 3/3 Control UI E2E proof.
  • The only subsequent failing shard was the unrelated current-main Codex settlement timeout. The shared test now drains the timed-out transcript writer before its successor queues durable prompt work, keeps the successor on the existing lifecycle owner, and still proves the stale answer is fenced.

Proof:

  • focused formerly hanging settlement case on this branch: 1 passed
  • full settlement file on the identical repair: 7 passed
  • changed-file extension gate: passed
  • fresh autoreview of this commit: scoped-clean, 0 actionable findings

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Second maintainer refresh at exact head b86964b1c63f4deaa38b76f07e0cc65d339d4e05:

  • Rebased onto current main (bcd3cace191) after main advanced and made the prior head conflicting.
  • Main now contains its own repair for the unrelated Codex settlement timeout, so the redundant test-only commit from the prior head was dropped.
  • Post-rebase Control UI external-supervisor E2E remains green: 3 passed.
  • The accepted clipboard-read feedback repair remains intact.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

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

app: web-ui App: web-ui cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin SDK: supply deployment-specific external supervisor guidance

2 participants