Repository navigation
feat(migrate): add native agent and cron import effects - #178768
Patrick-Erichsen wants to merge 3 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs real behavior proof before merge. What this changesAdds migration helpers that create agents and scheduled prompts through OpenClaw’s native owners. Example: Import agent imported-researcher and Morning summary at 09:15 on weekdays in America/Los_Angeles.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep open: this PR supplies a useful shared migration capability, fixes the prior recovery finding, and introduces no newly confirmed code defect. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherMigration providers pass portable definitions through an offline-owner admission check into the existing agent lifecycle and cron scheduler, producing native configuration and database records. flowchart TD
A[Migration provider] --> B[Offline owner admission]
B --> C[Native agent creation]
B --> D[Native cron service]
C --> E[Agent configuration and state]
D --> F[Stored scheduled prompts]
Technical reviewBest possible solution: Keep migration effects in the existing lifecycle and scheduler owners, preserving exact retries and existing user state. Do we have a high-confidence way to reproduce the issue? This is an additive capability; current-main source lacks the helpers, and the reported before-fix failure matches that absence. Is this the best way to solve the issue? The adapters reuse the correct native owners, and the optional reuse path preserves lifecycle gates without introducing a competing writer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4213136ceea7. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete bypass was confirmed, but the cron ownership boundary still needs final-effect qualification. EvidenceSecurity concerns:
What I checked:
Likely related people:
PR surfaceSource +298, Tests +286, Docs +17. Total +601 across 10 files. Added test files: 2. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 20, 2026, 7:51 PM ET / 23:51 UTC (Revision 2). |
|
Fixed the concrete recovery bypass in 73ca0a4: createMigrationAgent now passes restorePaths: [] so migration cannot implicitly restore a held agent store. The real regression fails before the fix (returns existing and clears the hold); after the fix both matching and conflicting definitions preserve config, held database bytes, and recovery holds. Added composed final-effect evidence: the real offline owner is released while native workspace preparation is paused. The SDK returns an error with unchanged config and no agent/session database or provenance; only the already-created empty directory remains. Three agent/cron SDK tests pass, along with SDK test types, scoped lint, and formatting. No new production authority abstraction or stored schema was added. The dependent provider's real-owner integration also proves existing-state preservation and retry/recovery. A direct late-revocation cron case and a published-driver upgrade were not newly run. The older Claw-package screenshots are not claimed as proof of these native effects. Local ownership continues coordinating the stack; the current bot contract reports repair lanes retired. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
What Problem This Solves
Migration providers need to create additional agents and scheduled prompts without bypassing native lifecycle or scheduler ownership. This adds lazy migration SDK operations that require the admitted offline state owner and reject onboarding staging.
Existing agents and changed jobs are preserved. Migration explicitly refuses held-store restoration; the exact agent reuse path runs after deletion/recovery gates; cron import does not start the scheduler. This is the lower capability layer for Grok configuration migration, tracked in CLAW-1180.
User Impact
Migration providers can preserve multi-agent setups and scheduled prompts through OpenClaw’s native owners. Existing agent creation behavior is unchanged unless the provider explicitly requests exact-state reuse.
Why This Change Was Made
Grok configuration migration needs agent creation and cron insertion after onboarding promotion, under the admitted offline state owner. These shared operations keep lifecycle and scheduler writes out of provider-specific code. The dependent provider is #178769.
Evidence
Before: the native migration boundary regression failed with
createMigrationAgent is not a function.After: targeted agent creation, native migration-agent and cron tests pass, including stale/cancelled ownership, staging refusal, retries, conflicts, and no scheduler execution. Core/SDK/agent test typegraphs, targeted lint, formatting and SDK export checks pass; full candidate build passes.
The dependent provider's real-owner integration additionally exercises existing-state preservation and saved-plan recovery; its confirmed-only scope excludes credential copying. No unrelated agent or cron writer was introduced.
The exact committed Plugin SDK API comparison passes: migration-runtime remains an existing host-local-only facade, so the published compatibility surface is unchanged. Broad local gates report inherited line-count, shard-budget and agentsapi unused-export failures; all affected paths are unchanged against the captured base. No unrelated baseline was relaxed.
Hosted CI exposed a type-only back-edge in the existing-agent result helper and duplicate cron helper export names. The native-layer correction removes the back-edge, gives implementation functions distinct names, and tests cron through the provider facade. Both exact failing guards now pass locally, with 26 affected native tests, core types, formatting and scoped type-aware lint.
Recovery review regression: before the fix, an imported definition returned
existingand cleared a recovery hold. WithrestorePaths: [], both matching and conflicting definitions preserve the hold, config, and held database bytes until explicit recovery. Agent/cron SDK tests pass (3 tests, 70.10s wrapper / 25.02s Vitest under host load), with SDK test types and two-file lint.Final-effect authority proof: releasing the real offline owner while native workspace preparation is paused returns an SDK error and leaves config unchanged, with no agent/session database or provenance. Only the already-created empty directory remains. This proves the composed agent boundary; no new direct late-revocation cron case or published-driver upgrade was run.
Final combined head
12dcad3075cbuilds successfully in 4m22s (existing UI gzip warning retained). Native head:73ca0a4d30b. The rebuilt CLI selects onlystalk-setupby name, emits all six curated integration paths, and plans no secret actions. Real Stalk repeat apply completes with 25 migrated, 12 skipped, no errors/conflicts, and a verified backup; all 19 skill bodies, 9 exported memories, and instructions remain intact, with one memory import block.Review coordination: the local stack owner handles repairs and propagation between these dependent branches. ClawSweeper's current contract says repair/merge execution lanes are retired. ClawSweeper review is requested on the updated heads; neither PR is claimed merge-ready while live-account qualification and hosted checks remain pending.
Merge Danger
Door: Two-way
Code can be reverted; completed migrations retain their created state and use the migration framework's backup for restoration.
Blast Radius: Migration
The new SDK operations admit effects only under the selected offline owner. Existing createAgent callers retain their current behavior; reuse is opt-in.