Skip to content

fix(agents): preserve custom bootstrap onboarding - #196411

Merged
Patrick-Erichsen merged 5 commits into
fix-template-bundled-plugin-runtime-ownerfrom
preserve-custom-bootstrap-onboarding
Nov 11, 2026
Merged

Patrick-Erichsen merged 5 commits into
fix-template-bundled-plugin-runtime-ownerfrom
preserve-custom-bootstrap-onboarding

Conversation

@Patrick-Erichsen

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

Copy link
Copy Markdown
Contributor

What Problem This Solves

Preserve custom BOOTSTRAP.md until onboarding consumes it. Workspace and Doctor share stock-template recognition, including audited historical shipped bodies, so recovery does not mistake stock instructions for custom onboarding.

Evidence

Current layer: d7d09dcd161ddef09d37a1a1c37749be97479673. 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 docs Improvements or additions to documentation commands Command implementations agents Agent runtime and tooling size: S 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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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

Preserve custom BOOTSTRAP.md until explicit completion while retaining automatic recovery for current and historical stock templates.

Example: A workspace contains “Ask which competitors to monitor before starting research.” in BOOTSTRAP.md and a preconfigured Competitor Watch identity, without a Template receipt.

  • Before: Workspace preparation treats the identity as completed onboarding and deletes the custom instructions.
  • After: Preparation and restarts preserve the instructions and pending status; removing BOOTSTRAP.md records completion.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused repair with shipped-entry-point lifecycle evidence, historical compatibility coverage, and the prior regression-test request addressed.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The supplied packaged CLI/Gateway lifecycle receipt exercises the changed workspace owner with preseeded custom instructions, repeated agents.update preparation, native upgrade, cold restarts, and explicit removal; files remain exact while pending and completion persists afterward. Historical proof applies to the preserved custom-content branch, supplemented by reported current regression results; sibling UI screenshots establish no additional onboarding coverage.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Custom first-run instructions disappear before onboarding starts when the workspace already contains configured profiles.
Reason: The repair preserves user-authored input, retains stock-template recovery, and adds no configuration or public API; the author also has prior merged ownership of this lifecycle.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes premature deletion of custom onboarding instructions that current main still permits; no actionable patch defects remain.

Priority: P2
Reviewed head: 3b05a9ba0c148561910d50e9e0c64467c5b4bb52

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway workspace preparation reads onboarding files and canonical setup state, recognizes generated templates, and either preserves pending instructions or records completion; Doctor consumes the same template comparison.

flowchart TD
  A[Gateway workspace preparation] --> B[Workspace reconciliation]
  C[Workspace files and setup state] --> B
  B --> D[Shared template recognition]
  E[Doctor workspace repair] --> D
  B --> F[Pending instructions or completed setup]
Loading

Technical review

Best possible solution:

Land the existing focused repair through the coordinated stack once its current-head gates qualify.

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

Current-main reconciliation visibly deletes an unreceipted custom BOOTSTRAP.md when profiles look configured; the supplied red/green regression exercises that input, and this read-only review ran no target code.

Is this the best way to solve the issue?

The patch is the smallest complete repair: distinguish custom instructions in the existing completion owner, share existing template recognition, and preserve shipped stock recovery through exact historical fingerprints.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Profile-based bootstrap completion changes intended behavior with a stated reason (137f5c3: Repair stale bootstrap files after onboarding updated profiles but failed to remove BOOTSTRAP.md.)
  • Explicitly seeded bootstrap custody keeps the original intent (caa978c: Keep author-provided onboarding pending while Template setup provisions profiles and skills.)
  • Historical template and missing-template comparisons keeps the original intent (1a76be1: Keep provisioned workspaces usable when packaged templates are missing while preserving historical generated-file recognition and other I/O errors.)
  • Doctor shared comparison keeps the original intent (b40434e: Restore customized system-agent files without replacing customized destinations.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The introduced diff adds custom-content recognition to the existing reconciliation condition, moves existing comparison logic into the template loader, and updates both production consumers without retaining a parallel implementation. (src/agents/workspace.ts:284, 3b05a9ba0c14)
  • Current-main gap: Current main protects explicitly seeded instructions with a recorded BOOTSTRAP receipt, but otherwise still completes onboarding from profile evidence without checking whether BOOTSTRAP.md is custom. (src/agents/workspace.ts:327, 869bbccf8fb8)
  • Prior review request addressed: The replacement workspace regression manually preseeds custom instructions and profiles, verifies absence of a seed receipt, checks preservation across restarts, and verifies completion after removal; the body reports failure on the predecessor and passing workspace/Add coverage after repair. (src/agents/workspace.test.ts:334, 3b05a9ba0c14)
  • Historical compatibility repaired: All seven historical fixture hashes match the production recognition list, and the existing lifecycle matrix covers each distinct body plus the current template. This addresses the historical-cohort omissions identified in earlier reviews and Yigtwxx’s review. (src/agents/workspace-template-load.ts:26, 3b05a9ba0c14)
  • Packaged lifecycle evidence: The publicly inspectable upgrade receipt records stable-package agent creation, native package upgrade, real Gateway agents.update preparation, cold restarts, exact file preservation, and completion after explicit removal: fix(agents): preserve custom bootstrap onboarding #196411 (comment). The inspected screenshots depict sibling Template UI changes and are not onboarding proof.
  • Stable-version proof applicability: GitHub content identities match between v2026.11.2 and v2026.11.3 for workspace.ts (08001db1e7373dce7c09dc653fec8f8da1e0b144) and workspace-state-store.worker-contract.ts (b26576abcef43da211700f27d5b22efe205f1818), supporting reuse of the supplied upgrade scenario for this unchanged source contract. (src/agents/workspace-state-store.worker-contract.ts, 847611dcaa3b)

Likely related people:

  • Patrick Erichsen: Raw commit 137f5c3 adds src/agents/workspace.ts:311 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 137f5c3a8b3c; files: src/agents/workspace.ts)
  • Peter Steinberger: Raw commit 1a76be1 adds src/agents/workspace-template-load.ts:5 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1a76be13e13a; files: src/agents/workspace-template-load.ts)
  • Dreamer: Raw commit 7559fb2 adds src/agents/workspace.ts:284 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 7559fb21a570; files: src/agents/workspace.ts)

PR surface

Source +26, Tests +766, Docs +3, Other +4. Total +799 across 16 files. Added test files: 7.

View PR surface stats
Area Files Added Removed Net
Source 3 86 60 +26
Tests 9 778 12 +766
Docs 1 5 2 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 3 5 1 +4
Total 16 874 75 +799

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.

Review metrics

Metric Value Why it matters
Production versus regression code Production +86/-60; tests +48/-12, excluding historical fixtures. Production growth adds shipped-template fingerprints while reusing the existing loader; regression growth covers custom instructions without receipts and distinct historical recovery cohorts.

Labels

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:

  • P2: Premature completion affects custom onboarding in preconfigured workspaces, with a focused repair and limited blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • 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 (6 earlier review cycles)
  • reviewed 2026-11-10T03:28:28.596Z sha 4e759f15eecd336f7e0a9206c02fbc9ae6373af9 :: blocked before merge. :: [P2] Recognize historical stock bootstrap before bypassing recovery | [P2] Replace the moved assertion with the existing error-code guard
  • reviewed 2026-11-10T04:25:24.610Z sha eab1f914a4a35a7fdb508e2f6b44cb3f90e4b55f :: blocked before merge. :: [P2] Recognize the older shipped stock bootstrap before skipping recovery
  • reviewed 2026-11-10T06:22:19.720Z sha 9200774 :: blocked before merge. :: none
  • reviewed 2026-11-10T06:46:27.836Z sha 9200774 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-10T19:30:13.957Z sha 7bbdaf3 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-11T02:52:43.471Z sha d44223f :: needs maintainer review before merge. :: none

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

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug 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 added clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. 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

🦞👀
Exact review queued.

Re-review progress:

@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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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
@Patrick-Erichsen
Patrick-Erichsen force-pushed the preserve-custom-bootstrap-onboarding branch from 7bbdaf3 to 612eca6 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 10, 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:

@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:

Workspace setup treated a provisioned profile or skill as completed onboarding and removed custom BOOTSTRAP.md before the first turn. Restrict automatic profile-based completion to stock instructions so custom onboarding stays pending until consumed. Keep generated-template comparisons with the existing template loader.
The custom onboarding early return mistook the BOOTSTRAP.md seeded by
v2026.9.2 for custom content, preventing existing profile-based completion
recovery. Recognize its exact published seeded-body fingerprint in the
existing template-history owner. Extend the existing native recovery test
across current and historical stock content, restart and profile edits.

Use the existing error-code guard for the moved file comparison instead
of a production assertion. Shrink the original workspace assertion
allowance from three to two without adding a replacement allowance.

Allocate exactly 14 net regression-test LF lines in a separate record;
the shared scalar and inherited test-line debt are unchanged. Retain the
111-line historical stock body as an exact canonical fixture.

Validation: historical regression red before the fingerprint, current and
historical rows green after; workspace/missing-templates/Template Add
83 tests pass; Doctor caller 16 tests pass; assertion-safety and formatting
pass. Test-line check preserves the pre-existing 103-line stack deficit.
Recognize the exact BOOTSTRAP.md body seeded by shipped v2026.7.1 in the existing generated-template history owner. Preserve profile-based completion recovery after a restart and profile edit, while retaining explicit-removal behavior for custom onboarding.

Verify the 53-line seeded fixture against canonical tag 2d2ddc4 after canonical frontmatter removal. Extend the existing recovery parameterization with zero net regression-test LF growth and no budget changes.

Validation: July recovery row red before the hash and green after; workspace, missing-template, Template Add and Doctor caller suites pass 100/100. Production and agent-test types, scoped lint, formatting, source-size and exact test-line ratchets pass.

@Yigtwxx Yigtwxx 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.

Follow-up on my earlier review, checked at e263fe1c808.

The four missing cohorts are in, plus June. Each of the seven fixtures under test/fixtures/bootstrap/ hashes to its entry in RETIRED_GENERATED_TEMPLATE_SHA256[BOOTSTRAP.md], and those are the same values I got by hashing docs/reference/templates/BOOTSTRAP.md at the release tags with each release's own frontmatter stripping. The current row pins 0bcb8c91…, which is still the stock body on main (b22f35f7ed7), so the next template edit fails that row instead of quietly turning pending workspaces into custom onboarding. The reworded comment above the map now reads correctly for the BOOTSTRAP.md entry as well.

Nothing further from me on this.

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

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

2 participants