feat: add pre-dispatch hook for agent task middleware
Generic extension point in community codebase: PreDispatchHook type registered in AppState, checked before every agent_query dispatch. Enables Pro features like budget enforcement and branch policy.
This commit is contained in:
parent
19771237c9
commit
3798bedc4d
2 changed files with 10 additions and 0 deletions
|
|
@ -9,6 +9,10 @@ pub fn agent_query(
|
|||
state: State<'_, AppState>,
|
||||
options: AgentQueryOptions,
|
||||
) -> Result<(), String> {
|
||||
// Run pre-dispatch hooks (budget enforcement, branch policy, etc.)
|
||||
for hook in &state.pre_dispatch_hooks {
|
||||
hook(&options)?;
|
||||
}
|
||||
state.sidecar_manager.query(&options)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue