Record model responses with --record-responses (for use in testing) (#11894)

This commit is contained in:
Jacob MacDonald
2025-10-28 12:13:45 -07:00
committed by GitHub
parent ab1f195508
commit 44bdd3ad11
19 changed files with 549 additions and 326 deletions

View File

@@ -74,6 +74,7 @@ export interface CliArgs {
useWriteTodos: boolean | undefined;
outputFormat: string | undefined;
fakeResponses: string | undefined;
recordResponses: string | undefined;
}
export async function parseArguments(settings: Settings): Promise<CliArgs> {
@@ -202,6 +203,12 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
.option('fake-responses', {
type: 'string',
description: 'Path to a file with fake model responses for testing.',
hidden: true,
})
.option('record-responses', {
type: 'string',
description: 'Path to a file to record model responses for testing.',
hidden: true,
})
.deprecateOption(
'prompt',
@@ -700,6 +707,7 @@ export async function loadCliConfig(
codebaseInvestigatorSettings:
settings.experimental?.codebaseInvestigatorSettings,
fakeResponses: argv.fakeResponses,
recordResponses: argv.recordResponses,
retryFetchErrors: settings.general?.retryFetchErrors ?? false,
ptyInfo: ptyInfo?.name,
});

View File

@@ -364,6 +364,7 @@ describe('gemini.tsx main function kitty protocol', () => {
useWriteTodos: undefined,
outputFormat: undefined,
fakeResponses: undefined,
recordResponses: undefined,
});
await main();