#19879: Feat/foropenclaw bootstrapfiles clean
docs
app: macos
gateway
agents
size: S
Cluster:
Bootstrap and Plugin Fixes
# OpenClaw Contribution Summary
This document summarizes the recent changes implemented on branch `feat/foropenclaw-integration`.
## What Changed
### 1. New config option: `agents.defaults.bootstrapFiles`
Added support for a new agent default config field:
- `agents.defaults.bootstrapFiles: string[]`
This lets you provide extra workspace file paths/glob patterns that should be injected into bootstrap context during agent runs.
Implemented in:
- `src/config/types.agent-defaults.ts`
- `src/config/zod-schema.agent-defaults.ts`
- `src/agents/bootstrap-files.ts`
- `src/config/schema.help.ts`
- `src/config/schema.labels.ts`
- `docs/gateway/configuration-reference.md`
### 2. Tests added/updated
Added coverage for config-driven bootstrap file loading:
- `src/agents/bootstrap-files.e2e.test.ts`
### 3. Quality fixes after checks
After formatting/lint checks:
- formatted:
- `src/agents/tools/telegram-actions.ts`
- `src/telegram/send.ts`
- fixed one lint error (duplicate key) in:
- `src/agents/tools/message-tool.ts`
## Benefits
- Config-first customization of bootstrap context without writing custom hook code.
- Easier team/repo setup by injecting project-specific bootstrap files from subfolders.
- Keeps existing safety model:
- only recognized bootstrap filenames are loaded
- path traversal protections remain in place
- Better maintainability and onboarding for users with multi-folder workspace structures.
## Validation and Results
All relevant checks passed after fixes:
1. `pnpm vitest run src/agents/workspace.load-extra-bootstrap-files.test.ts`
2. `pnpm vitest run --config vitest.e2e.config.ts src/agents/bootstrap-files.e2e.test.ts`
3. `pnpm format:check`
4. `pnpm lint`
Status: all passed.
## Commits
- `593c590cb` - `feat(config): support agents.defaults.bootstrapFiles`
- `45a656d94` - `chore: fix lint and formatting issues`
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds a new config option `agents.defaults.bootstrapFiles` that allows specifying extra workspace file paths or glob patterns to inject into bootstrap context during agent runs. It also includes a second commit that regenerates Swift protocol models to add a `threadId` field to `SendParams`.
- The `bootstrapFiles` config option reuses the existing `loadExtraBootstrapFiles` infrastructure, with proper path traversal protection and bootstrap filename validation
- Type definitions, Zod schema, field help, field labels, and docs are all updated consistently
- An e2e test covers the new config-driven glob pattern loading
- The Swift model changes (`threadid` on `SendParams`) are a separate protocol regeneration, unrelated to the bootstrap feature
- The new config-driven approach overlaps with the existing `bootstrap-extra-files` bundled hook — both call `loadExtraBootstrapFiles` and there is no deduplication, so users with both configured could see duplicate bootstrap files in context
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with low risk; it adds a clean config-driven feature that follows existing patterns
- The changes are well-structured and follow existing patterns. The feature reuses battle-tested infrastructure (loadExtraBootstrapFiles with path traversal guards and filename validation). The main concern is the potential for duplicate file loading when used alongside the existing bootstrap-extra-files hook, but this is a design overlap rather than a correctness bug. The Swift model regeneration is straightforward.
- `src/agents/bootstrap-files.ts` — the unnecessary type assertion and potential duplicate loading with the bootstrap-extra-files hook
<sub>Last reviewed commit: 273fe81</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#19826: fix: add in-prompt warnings and doctor check for bootstrap file tru...
by akramcodez · 2026-02-18
78.9%
#19621: feat: shared-bootstrap hook for cross-agent bootstrap files
by Diaspar4u · 2026-02-18
78.2%
#15568: feat: configurable workspace context files (agents.defaults.context...
by koatora20 · 2026-02-13
77.9%
#9726: feat: add identityDir config for separate identity file location
by rickburn · 2026-02-05
77.8%
#15571: feat: infrastructure foundation — hooks, model failover, sessions, ...
by tangcruz · 2026-02-13
76.4%
#19560: docs: refactor agent workspace default location & bootstrap configu...
by ashinkuniyil · 2026-02-17
75.7%
#15619: fix: clean up orphan LaunchAgent plist on bootstrap failure
by superlowburn · 2026-02-13
75.6%
#13524: feat: conditional bootstrap file loading for heartbeat vs DM sessions
by tarun131313 · 2026-02-10
75.2%
#18616: agents: add bootstrap retrieval mode to reduce prompt overhead
by Duartemartins · 2026-02-16
75.0%
#16838: fix: include configured fallbacks in model allowlist
by taw0002 · 2026-02-15
74.8%