From d3fba9b40faab97e51e1f3886383342b097cea80 Mon Sep 17 00:00:00 2001 From: Shridhar Sukhani <25730420+shrisukhani@users.noreply.github.com> Date: Tue, 2 Dec 2025 17:51:31 -0800 Subject: [PATCH 1/2] fix: add missing config to Gemini client invoke method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The invoke() method was not passing temperature and maxOutputTokens to the Gemini API, unlike invokeStructured() which correctly included these parameters. This meant users' temperature settings were silently ignored for regular (non-structured) Gemini calls. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/llm/providers/gemini.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/llm/providers/gemini.ts b/src/llm/providers/gemini.ts index 8b591f7..86cad5c 100644 --- a/src/llm/providers/gemini.ts +++ b/src/llm/providers/gemini.ts @@ -53,6 +53,10 @@ export class GeminiClient implements HyperAgentLLM { const response = await this.client.models.generateContent({ model: this.model, contents: geminiMessages as any, + config: { + temperature: options?.temperature ?? this.temperature, + maxOutputTokens: options?.maxTokens ?? this.maxTokens, + }, }); const text = response.text; From 9435909a8fb5a4572bb13e8688c21b57728c0d72 Mon Sep 17 00:00:00 2001 From: Shridhar Sukhani <25730420+shrisukhani@users.noreply.github.com> Date: Tue, 2 Dec 2025 17:54:22 -0800 Subject: [PATCH 2/2] Guard CLI raw mode in non-TTY environments --- src/cli/index.ts | 93 ++++++++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 42 deletions(-) diff --git a/src/cli/index.ts b/src/cli/index.ts index d7f73ec..a97d0ff 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -139,48 +139,51 @@ program let task: Task; - readline.emitKeypressEvents(process.stdin); + const canUseRawMode = process.stdin.isTTY; + if (canUseRawMode) { + readline.emitKeypressEvents(process.stdin); - process.stdin.on("keypress", async (ch, key) => { - if (key && key.ctrl && key.name == "p") { - if (currentSpinner.isSpinning) { + process.stdin.on("keypress", async (ch, key) => { + if (key && key.ctrl && key.name == "p") { + if (currentSpinner.isSpinning) { + currentSpinner.stopAndPersist({ symbol: "⏸" }); + } + currentSpinner.start( + chalk.blue( + "Hyperagent will pause after completing this operation. Press Ctrl+r again to resume." + ) + ); currentSpinner.stopAndPersist({ symbol: "⏸" }); - } - currentSpinner.start( - chalk.blue( - "Hyperagent will pause after completing this operation. Press Ctrl+r again to resume." - ) - ); - currentSpinner.stopAndPersist({ symbol: "⏸" }); - currentSpinner = ora(); - - if (task.getStatus() == TaskStatus.RUNNING) { - task.pause(); - } - } else if (key && key.ctrl && key.name == "r") { - if (task.getStatus() == TaskStatus.PAUSED) { - currentSpinner.start(chalk.blue("Hyperagent will resume")); - currentSpinner.stopAndPersist({ symbol: "⏵" }); currentSpinner = ora(); - task.resume(); - } - } else if (key && key.ctrl && key.name == "c") { - if (currentSpinner.isSpinning) { - currentSpinner.stopAndPersist(); - } - console.log("\nShutting down HyperAgent"); - try { - await agent.closeAgent(); - process.exit(0); - } catch (err) { - console.error("Error during shutdown:", err); - process.exit(1); + if (task.getStatus() == TaskStatus.RUNNING) { + task.pause(); + } + } else if (key && key.ctrl && key.name == "r") { + if (task.getStatus() == TaskStatus.PAUSED) { + currentSpinner.start(chalk.blue("Hyperagent will resume")); + currentSpinner.stopAndPersist({ symbol: "⏵" }); + currentSpinner = ora(); + + task.resume(); + } + } else if (key && key.ctrl && key.name == "c") { + if (currentSpinner.isSpinning) { + currentSpinner.stopAndPersist(); + } + console.log("\nShutting down HyperAgent"); + try { + await agent.closeAgent(); + process.exit(0); + } catch (err) { + console.error("Error during shutdown:", err); + process.exit(1); + } } - } - }); + }); - process.stdin.setRawMode(true); + process.stdin.setRawMode(true); + } const onStep = (params: AgentStep) => { const action = params.agentOutput.action; @@ -194,8 +197,10 @@ program `[${chalk.yellow("step")}]: ${params.agentOutput.thoughts}\n${actionDisplay}` ); currentSpinner = ora(); - process.stdin.setRawMode(true); - process.stdin.resume(); + if (canUseRawMode) { + process.stdin.setRawMode(true); + process.stdin.resume(); + } }; const debugAgentOutput = (params: AgentOutput) => { @@ -205,8 +210,10 @@ program currentSpinner.start( `[${chalk.yellow("planning")}]: ${params.thoughts}\n${actionDisplay}` ); - process.stdin.setRawMode(true); - process.stdin.resume(); + if (canUseRawMode) { + process.stdin.setRawMode(true); + process.stdin.resume(); + } }; const onComplete = async (params: TaskOutput) => { @@ -233,8 +240,10 @@ program required: true, }); - process.stdin.setRawMode(true); - process.stdin.resume(); + if (canUseRawMode) { + process.stdin.setRawMode(true); + process.stdin.resume(); + } task = await agent.executeTaskAsync(taskDescription, { onStep: onStep,