Skip to content

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

refactor(agent): tighten prompt section wording

Steven Enamakel1437d9fc0b56
diff --git a/crates/openhuman-core/src/agent/learning/prompt_sections.rs b/crates/openhuman-core/src/agent/learning/prompt_sections.rs
index 13411fed1c..6bfd753a7b 100644
--- a/crates/openhuman-core/src/agent/learning/prompt_sections.rs
+++ b/crates/openhuman-core/src/agent/learning/prompt_sections.rs
@@ -129,10 +129,9 @@ pub struct MemoryAccessSection;
pub const MEMORY_ACCESS_INSTRUCTION: &str = "\
## Memory access\n\
\n\
-Before answering about named people, projects, prior decisions or anything from \
-past sessions, and for any question about the user themselves, call `memory_recall` \
-(or `memory_search` for keywords). Never say something is not stored unless a \
-retrieval you just ran came back empty. Skip it for purely procedural requests.";
+Before answering about named people, projects, past decisions or the user themselves, \
+call `memory_recall` (or `memory_search` for keywords). Never say something is not \
+stored unless a retrieval you just ran came back empty.";
impl PromptSection for MemoryAccessSection {
fn name(&self) -> &str {
@@ -208,9 +207,8 @@ pub fn memory_write_instruction(preferences: bool, facts: bool, delegate: bool)
};
format!(
"## Remembering\n\n\
- When the user asks you to remember, note or keep something, write it before \
- you confirm {route}. Never say saved, noted or remembered unless that write \
- succeeded in this turn; if it failed, say so."
+ Asked to remember, note or keep something? Write it before you confirm {route}. \
+ Never say saved unless that write succeeded this turn."
)
}
diff --git a/crates/openhuman-core/src/agent/prompts/sections.rs b/crates/openhuman-core/src/agent/prompts/sections.rs
index 46f9ba7fe5..edc0e3f7c1 100644
--- a/crates/openhuman-core/src/agent/prompts/sections.rs
+++ b/crates/openhuman-core/src/agent/prompts/sections.rs
@@ -489,10 +489,9 @@ impl PromptSection for WorkspaceSection {
// its real working directory at runtime and keep writes/reads there.
let mut out = String::from(
"## Workspace\n\n\
- `pwd` is your working directory: commands run there and every file tool resolves \
- relative paths against it. Read and write there; anything outside it and the \
- scratch space below is blocked by the sandbox. Prefer stdout, and write a file \
- only when output is too large for it.\n\n",
+ `pwd` is your working directory: commands and file tools resolve there, and \
+ anything outside it and the scratch space is blocked. Prefer stdout; write a \
+ file only when output is too large. ",
);
// Only advertise a concrete scratch path when the dir is actually present
// and safe (real dir, not a symlink) — matching the policy grant in
@@ -506,7 +505,7 @@ impl PromptSection for WorkspaceSection {
if scratch_granted {
let _ = write!(
out,
- "Scratch files go in `{}` or `$TMPDIR`, never a hardcoded `/tmp/<name>`.",
+ "Scratch: `{}` or `$TMPDIR`, never a hardcoded `/tmp/<name>`.",
scratch.display()
);
} else {
@@ -660,9 +659,8 @@ impl PromptSection for DateTimeSection {
// learned "good morning" regardless of the actual hour (#3602).
let mut out = String::from(
"## Current Date & Time\n\nThe `Current Date & Time:` line on the latest message \
- (local time, zone, weekday) is authoritative. Before a greeting like \"good \
- morning\" or a word like \"today\", read it and match the actual local hour; \
- never assume it is morning, and never call a tool just to know the time.",
+ is authoritative: before \"good morning\" or \"today\", read it and match the \
+ actual local hour. No tool call is needed for the time.",
);
// Tool-argument discipline, gated on the agent actually having the
// `resolve_time` tool. LLMs are unreliable at epoch arithmetic — a
@@ -673,8 +671,7 @@ impl PromptSection for DateTimeSection {
// tool never see the rule.
if ctx.tools.iter().any(|t| t.name == "resolve_time") {
out.push_str(
- " Any date or time you pass as a tool argument comes from `resolve_time`, \
- never hand-computed; for \"recent / last N\" lookups prefer newest-first.",
+ " Tool date/time arguments come from `resolve_time`, never hand-computed.",
);
}
Ok(out)
diff --git a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs
index d5adae7852..31086e0cfb 100644
--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs
@@ -188,9 +188,8 @@ fn render_withheld_specialists(ctx: &PromptContext<'_>) -> String {
);
let mut out = String::from(
- "## Capabilities not in your tool list\n\nReach these with `use_skill` \
- (`skill` alone lists a tool's arguments; `skill` + `tool` + `args` runs it). \
- They are available, not missing.\n\n",
+ "## Capabilities not in your tool list\n\nAvailable through `use_skill` (`skill` \
+ alone lists arguments; add `tool` + `args` to run):\n\n",
);
for (tool, intent, pack) in rows {
let _ = writeln!(out, "- `{pack}` / `{tool}`: {intent}");
@@ -307,7 +306,7 @@ fn resolve_definition<'r>(
/// once it has loaded the schema.
/// Longest routing intent a withheld-specialist row carries. One sentence is
/// the signal; the full `when_to_use` is on the tool once it is loaded.
-const WITHHELD_INTENT_MAX_CHARS: usize = 90;
+const WITHHELD_INTENT_MAX_CHARS: usize = 64;
fn first_sentence(text: &str) -> String {
let text = text.trim();