Repository navigation
fix(setup): leave starter files to the first conversation - #206517
Conversation
- 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).
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: passed. What this changesThis 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.
Review scores
ProductKind: Preference · Worth it: Yes · Fix scope: Complete 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: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherBaseline 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +13, Tests +9, Docs +12. Total +34 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
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 Reviewed November 27, 2026, 4:12 AM ET / 09:12 UTC. |
## 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)
…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]>
## 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]>
Problem
openclaw setup --baselinewrote the starter workspace files (AGENTS.md, SOUL.md, IDENTITY.md, USER.md, BOOTSTRAP.md) and rangit initinto 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 callingensureAgentWorkspace. A fresh install creates the first agent withskipBootstrap, through a new optionalensureOnboardingAgent({ skipBootstrap }). The Gateway-owned path never seeded; only its message changed.Workspace OK: <dir> (starter files are created by the first conversation);--jsonadds"starterFiles": "first-conversation", or"skipped"(with a matching text note) whenagents.defaults.skipBootstrapis in effect.--skip-bootstrapkeeps its meaning: it persistsagents.defaults.skipBootstrap: true, so the first conversation does not seed either. No config shape change, so no Doctor migration.Impact
docs/cli/setup.md.Evidence
Real CLI,
ocx build --dist(dist-nodts),env -iscratch HOME/state/config, fake OpenAI-compatible endpoint:setup --baseline --workspace . --jsonon a fresh install, then the task config, thenagent --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).setup --baselinethe workspace is empty. Thengateway runandopenclaw 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) callssetup --baseline --json, checks onlyok, then starts the Gateway, so this is the same path.setup --baselineseeded the workspace and I edited USER.md. Then the newsetup --baseline,doctor --fixandagent --localran. 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 carriesstarterFiles. It fails on basefd681ab8786e(2 failures) and passes here.pnpm check:changedgreen.