Commit 02b2b42
Hanson Mei
fix: Handle hook return values to enable context modification
The plugin hook system calls _hook('agent_before', locals()) but was
not handling the return value. This prevented plugins from modifying
the agent context (e.g., system_prompt).
This fix:
- Captures the hook return value
- Applies modifications when a dict is returned
- Maintains backward compatibility with hooks that don't return values
Fixes #5371 parent 071fb6e commit 02b2b42
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
0 commit comments