mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 18:44:30 -07:00
fix: properly use systemMessage for hooks in UI (#16250)
This commit is contained in:
@@ -68,11 +68,11 @@ const MAX_TURNS = 100;
|
||||
type BeforeAgentHookReturn =
|
||||
| {
|
||||
type: GeminiEventType.AgentExecutionStopped;
|
||||
value: { reason: string };
|
||||
value: { reason: string; systemMessage?: string };
|
||||
}
|
||||
| {
|
||||
type: GeminiEventType.AgentExecutionBlocked;
|
||||
value: { reason: string };
|
||||
value: { reason: string; systemMessage?: string };
|
||||
}
|
||||
| { additionalContext: string | undefined }
|
||||
| undefined;
|
||||
@@ -146,6 +146,7 @@ export class GeminiClient {
|
||||
type: GeminiEventType.AgentExecutionStopped,
|
||||
value: {
|
||||
reason: hookOutput.getEffectiveReason(),
|
||||
systemMessage: hookOutput.systemMessage,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -155,6 +156,7 @@ export class GeminiClient {
|
||||
type: GeminiEventType.AgentExecutionBlocked,
|
||||
value: {
|
||||
reason: hookOutput.getEffectiveReason(),
|
||||
systemMessage: hookOutput.systemMessage,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -811,6 +813,7 @@ export class GeminiClient {
|
||||
type: GeminiEventType.AgentExecutionStopped,
|
||||
value: {
|
||||
reason: hookOutput.getEffectiveReason(),
|
||||
systemMessage: hookOutput.systemMessage,
|
||||
},
|
||||
};
|
||||
return turn;
|
||||
@@ -822,6 +825,7 @@ export class GeminiClient {
|
||||
type: GeminiEventType.AgentExecutionBlocked,
|
||||
value: {
|
||||
reason: continueReason,
|
||||
systemMessage: hookOutput.systemMessage,
|
||||
},
|
||||
};
|
||||
const continueRequest = [{ text: continueReason }];
|
||||
|
||||
@@ -78,6 +78,7 @@ export type ServerGeminiAgentExecutionStoppedEvent = {
|
||||
type: GeminiEventType.AgentExecutionStopped;
|
||||
value: {
|
||||
reason: string;
|
||||
systemMessage?: string;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -85,6 +86,7 @@ export type ServerGeminiAgentExecutionBlockedEvent = {
|
||||
type: GeminiEventType.AgentExecutionBlocked;
|
||||
value: {
|
||||
reason: string;
|
||||
systemMessage?: string;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user