fireUserPromptSubmitHook publishes the UserPromptSubmit event when the hook manager is enabled. Best-effort: hooks run asynchronously and any failure logs internally without blocking the turn.
(ctx context.Context, in string)
| 166 | // hook manager is enabled. Best-effort: hooks run asynchronously and any |
| 167 | // failure logs internally without blocking the turn. |
| 168 | func (cli *ChatCLI) fireUserPromptSubmitHook(ctx context.Context, in string) { |
| 169 | if cli.hookManager == nil { |
| 170 | return |
| 171 | } |
| 172 | wd, _ := os.Getwd() |
| 173 | cli.hookManager.FireAsync(ctx, hooks.HookEvent{ |
| 174 | Type: hooks.EventUserPromptSubmit, |
| 175 | Timestamp: time.Now(), |
| 176 | UserPrompt: in, |
| 177 | SessionID: cli.currentSessionName, |
| 178 | WorkingDir: wd, |
| 179 | }) |
| 180 | } |
| 181 | |
| 182 | // compactHistoryIfNeeded runs the proxy-payload pre-flight warning and |
| 183 | // triggers history compaction when the current chat history exceeds the |