add systemMessage for jook

This commit is contained in:
DennisYu07 2026-03-23 19:48:08 +08:00
parent b87c731487
commit 7573e1b0bd

View file

@ -722,6 +722,14 @@ export class GeminiClient {
const stopOutput = hookOutput as StopHookOutput | undefined;
// This should happen regardless of the hook's decision
if (stopOutput?.systemMessage) {
yield {
type: GeminiEventType.HookSystemMessage,
value: stopOutput.systemMessage,
};
}
// For Stop hooks, blocking/stop execution should force continuation
if (
stopOutput?.isBlockingDecision() ||
@ -732,14 +740,6 @@ export class GeminiClient {
return turn;
}
// Emit system message if provided (e.g., "🔄 Ralph iteration 5")
if (stopOutput.systemMessage) {
yield {
type: GeminiEventType.HookSystemMessage,
value: stopOutput.systemMessage,
};
}
const continueReason = stopOutput.getEffectiveReason();
const continueRequest = [{ text: continueReason }];
return yield* this.sendMessageStream(