Expose execution mode in hook listings (#37538)

## What changed

- Add `executionMode` to `HookMetadata` returned by `hooks/list`, with `sync` as the default for compatibility.
- Propagate each discovered hook's `sync` or `async` mode through the app-server protocol and generated schemas.
- Show the execution mode in the TUI hooks browser.

## Testing

- Cover async and default-sync modes in `hooks/list` tests and TUI snapshots.

GitOrigin-RevId: 9c9f2890798fe417face76c15847616b2dea9db4
This commit is contained in:
Abhinav authored and copyberry committed 2026-08-08 04:57:06 +00:00
1 parent 6f647caa9b
commit 3aae5d885b
23 files changed
+75 -3

No files matched your search

@@ -28,8 +28,11 @@ v2_enum_from_core!(
);
v2_enum_from_core!(
#[derive(Default)]
pub enum HookExecutionMode from CoreHookExecutionMode {
Sync, Async
#[default]
Sync,
Async
}
);
@@ -1,5 +1,6 @@
use super::AppSummary;
use super::HookEventName;
use super::HookExecutionMode;
use super::HookHandlerType;
use super::HookSource;
use super::HookTrustStatus;
@@ -524,6 +525,8 @@ pub struct HookMetadata {
pub key: String,
pub event_name: HookEventName,
pub handler_type: HookHandlerType,
#[serde(default)]
pub execution_mode: HookExecutionMode,
pub matcher: Option<String>,
pub command: Option<String>,
pub timeout_sec: u64,