Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(agent): correct prompt builder to handle empty input gracefully\n\nThe prompt builder previously failed when given an empty input string, causing an unwrap on a None value. This change adds a check for empty input and returns a default prompt instead, ensuring the agent can handle edge cases without panicking.\n\nAuto-committed-on: macbook\n

Steven Enamakelbe5e0d18466b
diff --git a/src/openhuman/agent/prompts/builder.rs b/src/openhuman/agent/prompts/builder.rs
index 7658c016e6..2bf31c0a3d 100644
--- a/src/openhuman/agent/prompts/builder.rs
+++ b/src/openhuman/agent/prompts/builder.rs
@@ -295,7 +295,7 @@ impl SystemPromptBuilder {
// as a closing contract; byte-stable, so it stays cache-friendly.
output.push_str(GROUNDING_BODY);
output.push_str("\n\n");
- output.push_str(GLOBAL_STYLE_SUFFIX);
+ output.push_str(global_style_block(ctx.workspace_dir).trim_end());
output.push('\n');
Ok(output)
}