Skip to content

feat(agent): add skipBootstrap config option - #292

Merged
thewilloftheshadow merged 1 commit into
openclaw:mainfrom
onutc:feat/skip-bootstrap-config
Jan 6, 2026
Merged

thewilloftheshadow merged 1 commit into
openclaw:mainfrom
onutc:feat/skip-bootstrap-config

Conversation

@onutc

@onutc onutc commented Jan 6, 2026 •

Copy link
Copy Markdown

Summary

  • Adds agent.skipBootstrap config option to skip creation of default bootstrap files (BOOTSTRAP.md, AGENTS.md, SOUL.md, etc.)
  • Useful for pre-configured deployments where workspace files are already in place from a repo

Usage

{
  "agent": {
    "skipBootstrap": true
  }
}

Test plan

  • Build passes (pnpm build)
  • Workspace tests pass (pnpm test src/agents/workspace.test.ts)

@thewilloftheshadow
thewilloftheshadow merged commit 6cf3570 into openclaw:main Jan 6, 2026
@steipete

steipete commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

Thanks @onutc — merged this for pre-seeded deployments where workspace files come from a repo.

Context: workspace bootstrap creation happens outside onboarding too (agent/cron/auto-reply + sandbox workspace seeding), so this is a config-level knob.

Follow-up on main (separate changelog bullets):

  • Doctor: normalize default workspace path to ~/clawd (avoid ~/clawdbot mismatches).
  • Workspace: only create BOOTSTRAP.md for brand-new workspaces (don’t recreate after deletion).
  • Setup/onboard: honor agent.skipBootstrap too.

lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
saml212 added a commit to Rockielab/rockie-claw that referenced this pull request May 19, 2026
…13)

PR #9 (openclaw#234) closed the race where /chat poll spawns interfered with
an in-flight /login. But it did not cover the symmetric case where
the user "completed" a device-flow that silently failed: the token
exchange returned HTTP 400 (device code expired), auth.json was
never written, and every subsequent /chat invocation spawned codex
which hit HTTP 401 on wss://api.openai.com/v1/responses, retried
five times, and exited non-zero — surfacing in the UI as the generic
"codex exited with: exit status 1" that gave the user no actionable
guidance and ate ~8 seconds per send.

Verified live on tenant rockielab-tenant-t-99562d476fef 2026-05-18:
- /home/runtime/.codex/auth.json is absent
- /home/runtime/.codex/log/codex-login.log shows
  token_exchange_user_error / HTTP 400 at 16:59:42
- codex exec --skip-git-repo-check --json hangs ~10s retrying 401,
  then emits multiple error frames and exits 1
- frontend renders "codex exited with: exit status 1" via the
  existing broker_runner_failed translator

Fix shape:

- authFilePath(binary) returns ~/.codex/auth.json (codex) and
  ~/.claude/.credentials.json (claude); empty for bash so the gate
  is no-op on the PTY shell path.
- authFileExists(binary) checks presence AND non-zero size; a
  0-byte file is treated as missing (codex writes the file atomically
  at the END of device-code exchange, so 0-byte = mid-write or
  corrupt).
- writeAuthRequiredFrame emits a one-line ndjson
  {"type":"error","code":"auth_required","message":...} on the same
  wire shape as auth_in_progress, just a different code so the
  frontend can route to /settings/token-source instead of
  /settings/api-keys.
- Both /chat (chatHandler) and /chat-pty (chatPTYHandler) call the
  gate AFTER the existing login-in-flight gate. Order is important:
  if a login IS in flight, we still want auth_in_progress copy, not
  auth_required.

Tests:
- TestAuthFilePath: HOME-relative path resolution for codex/claude;
  bash returns "".
- TestAuthFileExistsMissing / Present / ZeroByteTreatedAsMissing.
- TestChatHandlerRefusesWhenAuthMissing: end-to-end gate fires with
  the actionable /settings/token-source pointer in the message.
- TestChatHandlerProceedsWhenAuthPresent: gate clears when the file
  exists (downstream spawn may fail in CI, but auth_required must not
  leak).
- Existing TestChatHandlerIsolatesBinariesDuringLogin updated to
  writeAuthFile() so it still exercises the per-binary isolation it
  was written to verify.
- Existing chat_pty end-to-end + concurrent-turn tests get the same
  treatment so the spawn-pool path is reachable.

go test ./apps/broker/... passes locally (1.438s).

Co-authored-by: Sam Larson <[email protected]>
Co-authored-by: NeverClaudeCode <[email protected]>
muneebhashone pushed a commit to muneebhashone/clawdbot that referenced this pull request Aug 25, 2026
zeekay pushed a commit to Dream-AI-4444/bot that referenced this pull request Sep 11, 2026
lhfer pushed a commit to lhfer/openclaw that referenced this pull request Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants