mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-25 20:44:46 -07:00
fix(cli): filter subagent sessions from resume history (#19698)
This commit is contained in:
@@ -33,8 +33,8 @@ import {
|
||||
import {
|
||||
AgentStartEvent,
|
||||
AgentFinishEvent,
|
||||
RecoveryAttemptEvent,
|
||||
LlmRole,
|
||||
RecoveryAttemptEvent,
|
||||
} from '../telemetry/types.js';
|
||||
import type {
|
||||
LocalAgentDefinition,
|
||||
@@ -48,6 +48,7 @@ import {
|
||||
DEFAULT_MAX_TURNS,
|
||||
DEFAULT_MAX_TIME_MINUTES,
|
||||
} from './types.js';
|
||||
import { getErrorMessage } from '../utils/errors.js';
|
||||
import { templateString } from './utils.js';
|
||||
import { DEFAULT_GEMINI_MODEL, isAutoModel } from '../config/models.js';
|
||||
import type { RoutingContext } from '../routing/routingStrategy.js';
|
||||
@@ -826,16 +827,19 @@ export class LocalAgentExecutor<TOutput extends z.ZodTypeAny> {
|
||||
systemInstruction,
|
||||
[{ functionDeclarations: tools }],
|
||||
startHistory,
|
||||
undefined,
|
||||
undefined,
|
||||
'subagent',
|
||||
);
|
||||
} catch (error) {
|
||||
} catch (e: unknown) {
|
||||
await reportError(
|
||||
error,
|
||||
e,
|
||||
`Error initializing Gemini chat for agent ${this.definition.name}.`,
|
||||
startHistory,
|
||||
'startChat',
|
||||
);
|
||||
// Re-throw as a more specific error after reporting.
|
||||
throw new Error(`Failed to create chat object: ${error}`);
|
||||
throw new Error(`Failed to create chat object: ${getErrorMessage(e)}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user