← Back to PRs

#19879: Feat/foropenclaw bootstrapfiles clean

by akyourowngames open 2026-02-18 08:09 View on GitHub →
docs app: macos gateway agents size: S
# 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