intercept and sanitize gemini schema

This commit is contained in:
Shawn Morreau
2025-12-03 14:28:08 -05:00
parent a73ddd378d
commit 9b4bdae8bd
4 changed files with 92 additions and 3 deletions
+7 -1
View File
@@ -173,8 +173,9 @@ export const gemini = agent({
args: [cliPath, "--yolo", "--output-format=stream-json", "-p", sessionPrompt],
env: createAgentEnv({
GEMINI_API_KEY: apiKey,
GEMINI_CLI_DISABLE_SCHEMA_VALIDATION:
process.env.GEMINI_CLI_DISABLE_SCHEMA_VALIDATION || "1",
}),
timeout: 600000, // 10 minutes
onStdout: async (chunk) => {
const text = chunk.toString();
finalOutput += text;
@@ -257,6 +258,11 @@ function configureGeminiMcpServers({ mcpServers, cliPath }: ConfigureMcpServersP
const addResult = spawnSync("node", [cliPath, ...addArgs], {
stdio: "pipe",
encoding: "utf-8",
env: {
...process.env,
GEMINI_CLI_DISABLE_SCHEMA_VALIDATION:
process.env.GEMINI_CLI_DISABLE_SCHEMA_VALIDATION || "1",
},
});
if (addResult.status !== 0) {