Skip to content

fix(templates): use Gateway-owned Add from the CLI - #196431

Merged
Patrick-Erichsen merged 5 commits into
preserve-custom-bootstrap-onboardingfrom
retain-template-cli-cron-owner
Nov 11, 2026
Merged

Patrick-Erichsen merged 5 commits into
preserve-custom-bootstrap-onboardingfrom
retain-template-cli-cron-owner

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Route published CLI Add through the running state owner for exact-version review, separate consent and apply bound to the reviewed agent ID. Offline Add retains the owned local scheduler and conversation/setup adapters. Local paths keep precedence, online workspace overrides are rejected, and uncertain dispatched requests never fall back locally or replay.

Evidence

Current layer: db3969bece945c1bd54489c8c142071b6046d8f8. Full atomic candidate: db3969bece945c1bd54489c8c142071b6046d8f8. One fixture-only stability repair is carried at bottom; all seven upper patches and41commit subjects/order are unchanged. No full-main refresh.

  • Model-picker CI diagnosis and paired geometry proof: the test compared edges from different frames during the existing scale0.9→1 animation. Controlled actual-menu geometry reproduces exactCIright707.90625 while simultaneous gaps remain7.2px and8px. The ordinary local baseline passed and is not causal clearance. Move the existing trial-click stability check before both reads; preserve exact<=, long-email, both viewports, target height, keyboard/search/composition and sessions.patch assertions. All3cases pass19.50s; scoped lint/types/format/ratchets and fresh independent actual-diff review pass. Net1insertion/1deletion; no production change, new waits, timeout/tolerance changes, diagnostics or test-line growth.
  • Settings repair #197156 is merged as147d0414a3aacb4b17e38cb3e8dfde7b095493e9 with review, CI, postmerge CI/Workflow Sanity and native closeout complete. Its six stale assertions reproduce on main; corrected three-file suite passes29/29(45.92s), preserving pending admin request/recurrence/approval/navigation checks. It is already retained in this stack.
  • Actual stable11.3 existing-Claw upgrade proof preserves target agent configuration, four workspace files, consent digests and native cold-Gateway effective inventory agents_list only. Canonical schema22→39/row renames and old-authoring guidance are verified. Executed package4deeed is qualified for this tip: only four E2E files and one production comment differ, so Template/runtime behavior inputs are unchanged. Empty package/MCP/cron-reference tables and unrelated default heartbeat cleanup are explicitly qualified. The completed249b723 hosted review accepted this proof with Findings NONE/Before merge NONE.
  • Retained unchanged-input proof: real-Gateway lifecycle/channel7/7, Home route/dock26/26, guest onboarding plus real-Gateway Home7/7, Template schema/planning18/18, sidebar grouping21/21. Inspected guest setup before/after. These are contract-input qualifications, not whole-current-head CI.
  • Previous actual ready CI: all seven upper suites succeeded; bottom failed only the model-picker timing assertion above. All attempts finish before head replacement. Draft/passive SKIPPED suites remain excluded from product proof. Fresh exact-head CI/security and native admission must qualify this candidate. Root owns repairs; autofix is retired.

Landing and rollout

Land all eight layers atomically through the tip after exact-head gates permit. Preserve historical template-contract-194b7bea exactly. Seven unchanged upper patches retain their qualified reviews; bottom receives fresh review after final publication.

ClawHub #4502, Competitor Watch #22 and Activity #197058 are merged. Consumer release, manual backend cutover, new registry publication and live Gateway changes remain separate.

@clawsweeper

clawsweeper Bot commented Nov 10, 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes size: XL labels Nov 10, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Routes published Template Add commands through the running Gateway’s existing review, consent, and installation operations.

Example: Run openclaw templates add @openclaw/api-integration-engineer while the local Gateway is running.

  • Before: The CLI refuses because the Gateway owns the selected state directory.
  • After: The CLI obtains an exact-version review, collects required consent, and asks that Gateway to install into the reviewed agent.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-routed repair with retained production-entry-point evidence and no open findings; exact-head stack qualification remains pending.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Retained packaged CLI/WebSocket receipts exercise successful installation, missing trust and capability consent, owner replacement before apply, and restart readback; companion native evidence covers allowed provider/tool effects followed by creator-revocation refusal. The inspected screenshots show companion UI changes only and are not CLI proof; historical receipts do not establish current-head CI.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Published CLI Add cannot use the running Gateway that already owns installation state.
Reason: The maintainer-authored direction restores the command through existing owners while preserving local-path precedence and separate consent.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still refuses published CLI Add while a Gateway owns the state; this PR supplies a useful owner-routed path, resolves the previous documentation finding, and introduces no verified actionable defect.

Priority: P2
Reviewed head: d80010d69f1494350b19adaeaba8cec33631f017

Before merge

None.

Findings

None.

Agent review details

How this fits together

The CLI selects the state owner, translates package names and consent into Gateway RPCs, and presents the native installation result; the existing Gateway installer owns durable effects.

flowchart TD
  A[Template Add CLI] --> B[State owner selection]
  B --> C[Exclusive offline installer]
  B --> D[Gateway catalog and review]
  D --> E[Trust and capability consent]
  E --> F[Gateway Add installer]
  F --> G[Agent workspace and automations]
Loading

Technical review

Best possible solution:

Retain the focused CLI adapter over the existing Gateway installer and qualify the atomic stack before landing.

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

Current-main source deterministically refuses Add under a foreign Gateway owner, consistent with the supplied real CLI baseline receipts; no target code was executed during this review.

Is this the best way to solve the issue?

The adapter uses the existing catalog, plan/apply, consent, and state-owner contracts without creating a competing installer; the type extraction preserves the transport contract.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • CLI offline custody refusal changes intended behavior with a stated reason (b794062: Prevent local configuration, workspace, and database writes while a Gateway owns the state; later consolidation carried this policy into the runtime module.)
  • Gateway call option types keeps the original intent (d21bef3: Preserve selected authentication, scopes, and dispatch checks while avoiding unnecessary shared-state access; the patch mechanically relocates the same types and retains existing exports.)
  • Template CLI ownership documentation changes intended behavior with a stated reason (a63f4df: Document published-package acquisition and exclusive local mutation ownership; the updated wording distinguishes the newly supported Gateway route.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Patrick Erichsen: Raw commit a63f4df adds src/cli/templates-cli.runtime.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a63f4df9ca00; files: src/cli/templates-cli.runtime.ts)

PR surface

Source +197, Tests +347, Docs +14, Other +4. Total +562 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 266 69 +197
Tests 1 347 0 +347
Docs 1 20 6 +14
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 0 +4
Total 7 637 75 +562

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Repairs a limited Template CLI workflow while preserving the existing Control UI and offline alternatives.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • 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 (5 earlier review cycles)
  • reviewed 2026-11-10T04:32:02.153Z sha 2273f04515ae77b737dea96813b4af76aa6277b9 :: needs real behavior proof before merge. :: [P2] Place the isolation marker immediately above the mock | [P2] Handle older Gateways before sending the null precondition
  • reviewed 2026-11-10T06:24:06.951Z sha 040ac0b :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-10T07:44:03.883Z sha 632abea :: needs maintainer review before merge. :: none
  • reviewed 2026-11-10T07:51:09.288Z sha 632abea :: needs maintainer review before merge. :: none
  • reviewed 2026-11-11T02:51:22.214Z sha 9a7dc72 :: needs changes before merge. :: [P3] Restrict the retained offline-only guidance to local sources

Reviewed November 10, 2026, 11:00 PM ET / November 11, 2026, 04:00 UTC (Revision 6).

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@Patrick-Erichsen
Patrick-Erichsen force-pushed the retain-template-cli-cron-owner branch from 4681898 to 194b7be Compare November 10, 2026 19:17
@Patrick-Erichsen
Patrick-Erichsen force-pushed the retain-template-cli-cron-owner branch from 194b7be to f931522 Compare November 10, 2026 19:47
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Nov 11, 2026
@Patrick-Erichsen
Patrick-Erichsen marked this pull request as draft November 11, 2026 00:51
@Patrick-Erichsen
Patrick-Erichsen force-pushed the retain-template-cli-cron-owner branch 2 times, most recently from cd346bc to 9a7dc72 Compare November 11, 2026 02:14
@Patrick-Erichsen
Patrick-Erichsen marked this pull request as ready for review November 11, 2026 02:44
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Nov 11, 2026
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

An older Gateway rejects the explicit absence precondition before cron.add dispatch. Translate only captured null plus a correlated INVALID_REQUEST with the exact string-field rejection into actionable update-on-Gateway-host and restart guidance. Preserve the null guard and original error cause without retry, fallback, negotiation, or schema changes.

Extend the existing native CLI fixture with rejected unprofiled absence and the supported profiled path. Verify no job is committed and only one add is attempted. The older response is contract-derived and fixed at RPC delivery; this is not physical old-Gateway wire proof.

Allocate exactly 21 net regression-test LF lines in a separate record, with no shared scalar or unused headroom. Validation: guidance regression red before the repair; all 39 focused tests, production and CLI test types, scoped lint, formatting, mock-export, source-size and exact test-line gates pass.
Use the existing owner-routed catalog, pinned Add plan and apply flow for online ClawHub sources. Preserve separate trust and per-plugin capability consent, native partial results and uncertain outcomes. Refuse offline automation plans before durable effects while retaining plain local Add and read-only previews.

Remove the superseded CLI cron adapter and its unused authenticated-preparation and nullable-profile wire expansion. Restore native string-profile behavior and generated protocol output; retain the mechanical type extraction required by the native line-cap gate. Regression coverage includes sibling capability refusal, offline paused jobs and heartbeat, and no replay after an uncertain owner response.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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