Skip to content

fix(setup): leave starter files to the first conversation - #206517

Merged
obviyus merged 2 commits into
mainfrom
fix/baseline-no-seed
Nov 27, 2026
Merged

obviyus merged 2 commits into
mainfrom
fix/baseline-no-seed

Conversation

@obviyus

@obviyus obviyus commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

openclaw setup --baseline wrote the starter workspace files (AGENTS.md, SOUL.md, IDENTITY.md, USER.md, BOOTSTRAP.md) and ran git init into whatever directory was named as the workspace. Scripted installs often name the task or project directory (--workspace .). They got persona files and a .git/ in the project, and every later run carried a "Bootstrap Pending" directive plus about 19 KB of persona text in its prompt. Baseline cannot finish the bootstrap ritual, because it has no conversation.

Solution

Baseline setup now creates config, the workspace directory and the session directory only. Seeding keeps its one owner (ensureAgentWorkspaceOwned) and one moment: the agent's first persistent conversation (Gateway or chat) or interactive onboarding. It follows the rule from #206477: seed only when a later turn can finish the ritual.

  • src/commands/setup.ts: the offline path creates the directory instead of calling ensureAgentWorkspace. A fresh install creates the first agent with skipBootstrap, through a new optional ensureOnboardingAgent({ skipBootstrap }). The Gateway-owned path never seeded; only its message changed.
  • Visible non-outcome: Workspace OK: <dir> (starter files are created by the first conversation); --json adds "starterFiles": "first-conversation", or "skipped" (with a matching text note) when agents.defaults.skipBootstrap is in effect.
  • --skip-bootstrap keeps its meaning: it persists agents.defaults.skipBootstrap: true, so the first conversation does not seed either. No config shape change, so no Doctor migration.

Impact

  • Starter files now appear at the first conversation, not at baseline. Existing workspaces are untouched.
  • Scripts that edit the generated templates right after baseline must ship their own files; seeding keeps existing files. This is noted in the changelog and docs/cli/setup.md.

Evidence

Real CLI, ocx build --dist (dist-nodts), env -i scratch HOME/state/config, fake OpenAI-compatible endpoint:

  • Task-directory shape (setup --baseline --workspace . --json on a fresh install, then the task config, then agent --local): the sha1 listing of the task directory is identical before and after, for both a non-empty directory (main.py, README.md) and an empty one. System prompt 30,888 B. Before this change, the same flow added AGENTS/SOUL/IDENTITY/USER/BOOTSTRAP.md and .git/ (21 files).
  • Gateway first chat after baseline: after setup --baseline the workspace is empty. Then gateway run and openclaw agent --message hello (through the Gateway). The workspace then holds AGENTS.md, BOOTSTRAP.md, IDENTITY.md, SOUL.md, USER.md and .git/, and the request carries ## Bootstrap Pending. The Linux app first run (apps/linux/src-tauri/src/runtime_action.rs) calls setup --baseline --json, checks only ok, then starts the Gateway, so this is the same path.
  • Upgrade from latest stable (2026.11.10): old setup --baseline seeded the workspace and I edited USER.md. Then the new setup --baseline, doctor --fix and agent --local ran. The workspace sha1 listing (23 files) stayed identical.
  • src/commands/setup.test.ts "initializes local setup": the workspace is empty after baseline and the JSON carries starterFiles. It fails on base fd681ab8786e (2 failures) and passes here.
  • pnpm check:changed green.

- setup --baseline creates config, workspace and session dirs only: no persona
  files and no git init, in any directory. The first persistent conversation seeds.
- Text and --json output state the non-outcome (starterFiles: first-conversation).
@clawsweeper

clawsweeper Bot commented Nov 27, 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 size: XS labels Nov 27, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. labels Nov 27, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Nov 27, 2026
@obviyus
obviyus merged commit 0015e3f into main Nov 27, 2026
125 of 126 checks passed
@obviyus
obviyus deleted the fix/baseline-no-seed branch November 27, 2026 09:13
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 27, 2026
@clawsweeper

clawsweeper Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR defers baseline setup’s starter files and Git initialization until the first persistent conversation.

Example: Run openclaw setup --baseline --workspace . --json in a project containing main.py and README.md.

  • Before: Setup adds persona Markdown files and initializes a Git repository.
  • After: Setup leaves project contents intact and reports starterFiles as first-conversation.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, worthwhile behavior change with production-entry-point and upgrade results, preserved configuration semantics, and no actionable defect found.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The body reports real shipped CLI and Gateway execution with an isolated environment and a fake OpenAI-compatible endpoint: baseline preserves project contents, first persistent chat seeds starter files, and a latest-stable upgrade preserves edited workspace files; these results were assessed against source rather than rerun.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Preference · Worth it: Yes · Fix scope: Complete
User problem: Scripted baseline setup places persona files and a Git repository into a project before any conversation can complete onboarding.
Reason: This deliberately changes previously documented behavior, with direction and the script compatibility tradeoff approved by the collaborator-authored PR.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a useful, deliberate change to baseline setup, and the reviewed diff introduces no concrete correctness or security defect.

Reviewed head: 2fa3f1bf78a29cb4a8b7c7b8dda48e07c0062fd3

Before merge

None.

Findings

None.

Agent review details

How this fits together

Baseline setup prepares configuration and workspace/session directories; the existing workspace owner later seeds starter files when a persistent agent conversation begins.

flowchart TD
  A[Baseline CLI] --> B[Setup config plan]
  B --> C[Config and directory preparation]
  C --> D[Setup result]
  E[First persistent conversation] --> F[Existing workspace owner]
  F --> G[Starter files and Git initialization]
Loading

Technical review

Best possible solution:

Keep baseline setup directory-only while retaining the existing conversation seeding owner and persistent skip-bootstrap setting.

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

Current-main source directly shows baseline seeding, and the author records the corresponding project-directory changes through the shipped CLI; this review ran no target code.

Is this the best way to solve the issue?

The patch is a small, coherent implementation of the approved behavior change: suppress both baseline seeding paths without persisting temporary suppression or duplicating the seeding owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Baseline workspace seeding changes intended behavior with a stated reason (fece42c: The original setup implementation prepared an embedded-agent workspace and session directories, including bootstrap files.)
  • Persistent skip-bootstrap preference keeps the original intent (fix(setup): honor baseline skip-bootstrap #115945: Baseline must persist explicit skip-bootstrap intent, preserve it when omitted, and respect included configuration.)
  • Gateway-owned setup keeps the original intent (fix(cli): let setup run while a Gateway owns state #185109: Allow setup while the Gateway owns state, leaving workspace seeding to the first agent run.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned introduction reviewed: The introduced diff suppresses creation-time bootstrap, replaces baseline workspace seeding with directory creation, and adds explicit starterFiles reporting. (src/commands/setup.ts:263, 2fa3f1bf78a2)
  • Current main still seeds during baseline: Fetched main still calls ensureAgentWorkspace with ensureBootstrapFiles enabled unless skipBootstrap is configured; this PR's central change remains necessary. (src/commands/setup.ts:297, f69c7281afc7)
  • Related merged work has a distinct boundary: fix(agents): skip the bootstrap ritual in one-shot runs #206477 suppresses one-shot command seeding and explicitly preserves baseline setup's previous contract. (src/agents/command/prepare.ts:451, ee8e86ba2eec)
  • Accepted automation tradeoff: The collaborator-authored body explicitly accepts that scripts editing templates immediately after baseline must provide their own files; the setup documentation explains the new timing. Public docs: docs/cli/setup.md. (docs/cli/setup.md:177, 2fa3f1bf78a2)
  • Shipped CLI and upgrade evidence: The body records isolated CLI runs preserving empty and populated task directories, Gateway first-chat seeding, and an upgrade from 2026.11.10 preserving an edited USER.md and the workspace file inventory. (2fa3f1bf78a2)
  • Desktop consumer remains compatible: Linux desktop baseline setup checks the JSON ok field before continuing Gateway installation; it does not require starter files to exist immediately. (apps/linux/src-tauri/src/runtime_action.rs:384, 2fa3f1bf78a2)

PR surface

Source +13, Tests +9, Docs +12. Total +34 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 27 14 +13
Tests 1 37 28 +9
Docs 2 13 1 +12
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 77 43 +34

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 merge-risk: 🚨 compatibility: Scripts expecting generated templates immediately after baseline must change; the maintainer-authored PR explicitly accepts and documents this behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • merge-risk: 🚨 compatibility: Scripts expecting generated templates immediately after baseline must change; the maintainer-authored PR explicitly accepts and documents this behavior change.
  • 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.

Reviewed November 27, 2026, 4:12 AM ET / 09:12 UTC.

tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
## Problem
`openclaw setup --baseline` wrote the starter workspace files (AGENTS.md, SOUL.md, IDENTITY.md, USER.md, BOOTSTRAP.md) and ran `git init` into whatever directory was named as the workspace. Scripted installs often name the task or project directory (`--workspace .`). They got persona files and a `.git/` in the project, and every later run carried a "Bootstrap Pending" directive plus about 19 KB of persona text in its prompt. Baseline cannot finish the bootstrap ritual, because it has no conversation.

## Solution
Baseline setup now creates config, the workspace directory and the session directory only. Seeding keeps its one owner (`ensureAgentWorkspaceOwned`) and one moment: the agent's first persistent conversation (Gateway or chat) or interactive onboarding. It follows the rule from #206477: seed only when a later turn can finish the ritual.
- `src/commands/setup.ts`: the offline path creates the directory instead of calling `ensureAgentWorkspace`. A fresh install creates the first agent with `skipBootstrap`, through a new optional `ensureOnboardingAgent({ skipBootstrap })`. The Gateway-owned path never seeded; only its message changed.
- Visible non-outcome: `Workspace OK: <dir> (starter files are created by the first conversation)`; `--json` adds `"starterFiles": "first-conversation"`, or `"skipped"` (with a matching text note) when `agents.defaults.skipBootstrap` is in effect.
- `--skip-bootstrap` keeps its meaning: it persists `agents.defaults.skipBootstrap: true`, so the first conversation does not seed either. No config shape change, so no Doctor migration.

## Impact
- Starter files now appear at the first conversation, not at baseline. Existing workspaces are untouched.
- Scripts that edit the generated templates right after baseline must ship their own files; seeding keeps existing files. This is noted in the changelog and `docs/cli/setup.md`.

## Evidence
Real CLI, `ocx build --dist` (dist-nodts), `env -i` scratch HOME/state/config, fake OpenAI-compatible endpoint:
- **Task-directory shape** (`setup --baseline --workspace . --json` on a fresh install, then the task config, then `agent --local`): the sha1 listing of the task directory is identical before and after, for both a non-empty directory (main.py, README.md) and an empty one. System prompt 30,888 B. Before this change, the same flow added AGENTS/SOUL/IDENTITY/USER/BOOTSTRAP.md and `.git/` (21 files).
- **Gateway first chat after baseline:** after `setup --baseline` the workspace is empty. Then `gateway run` and `openclaw agent --message hello` (through the Gateway). The workspace then holds AGENTS.md, BOOTSTRAP.md, IDENTITY.md, SOUL.md, USER.md and `.git/`, and the request carries `## Bootstrap Pending`. The Linux app first run (`apps/linux/src-tauri/src/runtime_action.rs`) calls `setup --baseline --json`, checks only `ok`, then starts the Gateway, so this is the same path.
- **Upgrade from latest stable (2026.11.10):** old `setup --baseline` seeded the workspace and I edited USER.md. Then the new `setup --baseline`, `doctor --fix` and `agent --local` ran. The workspace sha1 listing (23 files) stayed identical.
- `src/commands/setup.test.ts` "initializes local setup": the workspace is empty after baseline and the JSON carries `starterFiles`. It fails on base `fd681ab8786e` (2 failures) and passes here.
- `pnpm check:changed` green.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 0015e3f)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 28, 2026
…06517)

## Problem
`openclaw setup --baseline` wrote the starter workspace files (AGENTS.md, SOUL.md, IDENTITY.md, USER.md, BOOTSTRAP.md) and ran `git init` into whatever directory was named as the workspace. Scripted installs often name the task or project directory (`--workspace .`). They got persona files and a `.git/` in the project, and every later run carried a "Bootstrap Pending" directive plus about 19 KB of persona text in its prompt. Baseline cannot finish the bootstrap ritual, because it has no conversation.

## Solution
Baseline setup now creates config, the workspace directory and the session directory only. Seeding keeps its one owner (`ensureAgentWorkspaceOwned`) and one moment: the agent's first persistent conversation (Gateway or chat) or interactive onboarding. It follows the rule from openclaw#206477: seed only when a later turn can finish the ritual.
- `src/commands/setup.ts`: the offline path creates the directory instead of calling `ensureAgentWorkspace`. A fresh install creates the first agent with `skipBootstrap`, through a new optional `ensureOnboardingAgent({ skipBootstrap })`. The Gateway-owned path never seeded; only its message changed.
- Visible non-outcome: `Workspace OK: <dir> (starter files are created by the first conversation)`; `--json` adds `"starterFiles": "first-conversation"`, or `"skipped"` (with a matching text note) when `agents.defaults.skipBootstrap` is in effect.
- `--skip-bootstrap` keeps its meaning: it persists `agents.defaults.skipBootstrap: true`, so the first conversation does not seed either. No config shape change, so no Doctor migration.

## Impact
- Starter files now appear at the first conversation, not at baseline. Existing workspaces are untouched.
- Scripts that edit the generated templates right after baseline must ship their own files; seeding keeps existing files. This is noted in the changelog and `docs/cli/setup.md`.

## Evidence
Real CLI, `ocx build --dist` (dist-nodts), `env -i` scratch HOME/state/config, fake OpenAI-compatible endpoint:
- **Task-directory shape** (`setup --baseline --workspace . --json` on a fresh install, then the task config, then `agent --local`): the sha1 listing of the task directory is identical before and after, for both a non-empty directory (main.py, README.md) and an empty one. System prompt 30,888 B. Before this change, the same flow added AGENTS/SOUL/IDENTITY/USER/BOOTSTRAP.md and `.git/` (21 files).
- **Gateway first chat after baseline:** after `setup --baseline` the workspace is empty. Then `gateway run` and `openclaw agent --message hello` (through the Gateway). The workspace then holds AGENTS.md, BOOTSTRAP.md, IDENTITY.md, SOUL.md, USER.md and `.git/`, and the request carries `## Bootstrap Pending`. The Linux app first run (`apps/linux/src-tauri/src/runtime_action.rs`) calls `setup --baseline --json`, checks only `ok`, then starts the Gateway, so this is the same path.
- **Upgrade from latest stable (2026.11.10):** old `setup --baseline` seeded the workspace and I edited USER.md. Then the new `setup --baseline`, `doctor --fix` and `agent --local` ran. The workspace sha1 listing (23 files) stayed identical.
- `src/commands/setup.test.ts` "initializes local setup": the workspace is empty after baseline and the JSON carries `starterFiles`. It fails on base `db5872998c11` (2 failures) and passes here.
- `pnpm check:changed` green.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
## Problem
`openclaw setup --baseline` wrote the starter workspace files (AGENTS.md, SOUL.md, IDENTITY.md, USER.md, BOOTSTRAP.md) and ran `git init` into whatever directory was named as the workspace. Scripted installs often name the task or project directory (`--workspace .`). They got persona files and a `.git/` in the project, and every later run carried a "Bootstrap Pending" directive plus about 19 KB of persona text in its prompt. Baseline cannot finish the bootstrap ritual, because it has no conversation.

## Solution
Baseline setup now creates config, the workspace directory and the session directory only. Seeding keeps its one owner (`ensureAgentWorkspaceOwned`) and one moment: the agent's first persistent conversation (Gateway or chat) or interactive onboarding. It follows the rule from #206477: seed only when a later turn can finish the ritual.
- `src/commands/setup.ts`: the offline path creates the directory instead of calling `ensureAgentWorkspace`. A fresh install creates the first agent with `skipBootstrap`, through a new optional `ensureOnboardingAgent({ skipBootstrap })`. The Gateway-owned path never seeded; only its message changed.
- Visible non-outcome: `Workspace OK: <dir> (starter files are created by the first conversation)`; `--json` adds `"starterFiles": "first-conversation"`, or `"skipped"` (with a matching text note) when `agents.defaults.skipBootstrap` is in effect.
- `--skip-bootstrap` keeps its meaning: it persists `agents.defaults.skipBootstrap: true`, so the first conversation does not seed either. No config shape change, so no Doctor migration.

## Impact
- Starter files now appear at the first conversation, not at baseline. Existing workspaces are untouched.
- Scripts that edit the generated templates right after baseline must ship their own files; seeding keeps existing files. This is noted in the changelog and `docs/cli/setup.md`.

## Evidence
Real CLI, `ocx build --dist` (dist-nodts), `env -i` scratch HOME/state/config, fake OpenAI-compatible endpoint:
- **Task-directory shape** (`setup --baseline --workspace . --json` on a fresh install, then the task config, then `agent --local`): the sha1 listing of the task directory is identical before and after, for both a non-empty directory (main.py, README.md) and an empty one. System prompt 30,888 B. Before this change, the same flow added AGENTS/SOUL/IDENTITY/USER/BOOTSTRAP.md and `.git/` (21 files).
- **Gateway first chat after baseline:** after `setup --baseline` the workspace is empty. Then `gateway run` and `openclaw agent --message hello` (through the Gateway). The workspace then holds AGENTS.md, BOOTSTRAP.md, IDENTITY.md, SOUL.md, USER.md and `.git/`, and the request carries `## Bootstrap Pending`. The Linux app first run (`apps/linux/src-tauri/src/runtime_action.rs`) calls `setup --baseline --json`, checks only `ok`, then starts the Gateway, so this is the same path.
- **Upgrade from latest stable (2026.11.10):** old `setup --baseline` seeded the workspace and I edited USER.md. Then the new `setup --baseline`, `doctor --fix` and `agent --local` ran. The workspace sha1 listing (23 files) stayed identical.
- `src/commands/setup.test.ts` "initializes local setup": the workspace is empty after baseline and the JSON carries `starterFiles`. It fails on base `fd681ab8786e` (2 failures) and passes here.
- `pnpm check:changed` green.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 0015e3f)

Companion audit: 2a03308, 410fe6b, ac3a457 and cafab68 add unrelated endpoint, tool-strictness or Ask OpenClaw behavior; none is needed for deferred starter-file initialization.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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: S 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