mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-13 03:20:33 -07:00
fix return type of fireSessionStartEvent to defaultHookOutput (#16833)
This commit is contained in:
+15
-11
@@ -648,18 +648,22 @@ export async function main() {
|
||||
const sessionStartSource = resumedSessionData
|
||||
? SessionStartSource.Resume
|
||||
: SessionStartSource.Startup;
|
||||
const result = await config
|
||||
.getHookSystem()
|
||||
?.fireSessionStartEvent(sessionStartSource);
|
||||
|
||||
if (result?.finalOutput) {
|
||||
if (result.finalOutput.systemMessage) {
|
||||
writeToStderr(result.finalOutput.systemMessage + '\n');
|
||||
}
|
||||
const additionalContext = result.finalOutput.getAdditionalContext();
|
||||
if (additionalContext) {
|
||||
// Prepend context to input (System Context -> Stdin -> Question)
|
||||
input = input ? `${additionalContext}\n\n${input}` : additionalContext;
|
||||
const hookSystem = config?.getHookSystem();
|
||||
if (hookSystem) {
|
||||
const result = await hookSystem.fireSessionStartEvent(sessionStartSource);
|
||||
|
||||
if (result) {
|
||||
if (result.systemMessage) {
|
||||
writeToStderr(result.systemMessage + '\n');
|
||||
}
|
||||
const additionalContext = result.getAdditionalContext();
|
||||
if (additionalContext) {
|
||||
// Prepend context to input (System Context -> Stdin -> Question)
|
||||
input = input
|
||||
? `${additionalContext}\n\n${input}`
|
||||
: additionalContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user