#6825: fix(plugins): add config to PluginHookAgentContext
Cluster:
Bootstrap and Plugin Fixes
## Summary
Adds the OpenClawConfig to PluginHookAgentContext so that plugin hooks can access configuration settings.
## Changes
- Added `config?: OpenClawConfig` to PluginHookAgentContext type in `src/plugins/types.ts`
## Use Case
Plugin hooks need access to configuration for features like:
- Reading workspace paths
- Checking enabled features
- Accessing provider settings
## Testing
- Verified lint passes (0 errors)
- Single line addition, low risk change
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR extends the plugin hook agent context type by adding an optional `config?: OpenClawConfig` field in `src/plugins/types.ts`. This aligns hook contexts with other plugin contexts (e.g., tool and command contexts) that already expose the current OpenClaw configuration, enabling hook handlers to read settings like workspace paths, feature flags, and provider configuration.
Change is a single type-level addition and doesn’t alter runtime behavior on its own; follow-up callers will need to populate `ctx.config` when invoking hooks.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The change is a single additive, optional field on a TypeScript type and does not change runtime logic; it should be backwards-compatible for existing plugins and internal callers.
- No files require special attention
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#19879: Feat/foropenclaw bootstrapfiles clean
by akyourowngames · 2026-02-18
72.5%
#10680: docs: clarify api.on() vs api.registerHook() for plugin hooks
by yassinebkr · 2026-02-06
72.0%
#18911: feat(plugins): Add registerStreamFnWrapper and updatePluginConfig APIs
by John-Rood · 2026-02-17
71.8%
#14873: [Feature]: Extend before_agent_start hook context with Model, Tools...
by akv2011 · 2026-02-12
71.6%
#6405: feat(security): Add HTTP API security hooks for plugin scanning
by masterfung · 2026-02-01
71.5%
#11817: fix(build): compile bundled hook handlers into dist
by AnonO6 · 2026-02-08
71.3%
#14544: feat: add before_context_send plugin hook
by Windelly · 2026-02-12
71.3%
#2556: fix(plugin-install): handle existing plugins and filter workspace deps
by longmaba · 2026-01-27
71.1%
#9914: fix(hooks): resolve bundled hook dist paths and packaging checks
by zimmra · 2026-02-05
71.0%
#7090: fix: plugin install uses manifest ID for folder name (#2796)
by dial481 · 2026-02-02
70.8%