Commit 6fad084
Deimos-Agent
feat: add hook_context kwarg to save_plugin_config and get_plugin_config extensible calls
Adds hook_context: dict kwarg to both call_plugin_hook() call sites in
save_plugin_config() and get_plugin_config() in helpers/plugins.py.
Motivation:
Plugins intercepting these hooks have no way to distinguish the caller context
(UI display vs service layer vs agent). Without this, plugins that need to
behave differently per caller (e.g. a secrets manager that masks values for UI
but resolves them for services) cannot do so without fragile inspect.stack() hacks.
hook_context is a free-form dict. Existing plugin hooks receive it via **kwargs
and can ignore it — fully backwards compatible.
Callers pass e.g. {"caller": "ui"}, {"caller": "service"}, {"caller": "agent"}.
This is a universal utility, not specific to any one plugin.1 parent 9390ba9 commit 6fad084
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
| 632 | + | |
632 | 633 | | |
633 | 634 | | |
634 | 635 | | |
| |||
669 | 670 | | |
670 | 671 | | |
671 | 672 | | |
| 673 | + | |
672 | 674 | | |
673 | 675 | | |
674 | 676 | | |
| |||
0 commit comments