Skip to content

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

fix(agent): correct section ordering in context composer

Steven Enamakel80cd1ef7b3ef
diff --git a/crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rs b/crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rs
index 980fd90f01..cb06568491 100644
--- a/crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rs
+++ b/crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rs
@@ -156,8 +156,8 @@ fn identity_section_creates_missing_workspace_files() {
"expected workspace file to be created: {file}"
);
}
- // HEARTBEAT.md and MEMORY_GOALS.md are no longer seeded (#5701). The
- // subconscious engine that read HEARTBEAT.md is gone, and the goals store
+ // HEARTBEAT.md and MEMORY_GOALS.md are no longer seeded (#5701). Nothing
+ // reads HEARTBEAT.md any more, and the goals store
// returns an empty `GoalsDoc` for a missing file and creates it on first
// write, so seeding either bought a file nothing needed.
for file in ["HEARTBEAT.md", "MEMORY_GOALS.md"] {
diff --git a/crates/openhuman-core/src/agent/prompts/sections.rs b/crates/openhuman-core/src/agent/prompts/sections.rs
index 9efebf7535..086230a14f 100644
--- a/crates/openhuman-core/src/agent/prompts/sections.rs
+++ b/crates/openhuman-core/src/agent/prompts/sections.rs
@@ -244,10 +244,10 @@ impl PromptSection for IdentitySection {
// orchestrator: a specialist sub-agent has its own role prompt and
// must not be told it is the Master Agent.
//
- // HEARTBEAT.md used to ride along here. It was the periodic-task list
- // the subconscious engine read, and that domain was deleted — nothing
- // consumed the file any more, so every agent but the orchestrator was
- // paying for an empty template. Its `WORKSPACE_INTERNAL_FILES` entry
+ // HEARTBEAT.md used to ride along here. It was a periodic-task list
+ // for a background loop that has since been removed — nothing consumed
+ // the file any more, so every agent but the orchestrator was paying
+ // for an empty template. Its `WORKSPACE_INTERNAL_FILES` entry
// deliberately stays, so a file a user still has on disk keeps its
// not-agent-writable protection.
let is_orchestrator = !ctx.visible_tool_names.is_empty();
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs b/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs
index f9813a6f02..9c276390ea 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs
@@ -7,7 +7,7 @@
//! `crate::agent::prompts`) — `SystemPromptBuilder`,
//! `PromptContext`, `LearnedContextData`, `ConnectedIntegration`,
//! `ToolCallFormat`, `load_agents_md_layers`, `render_connected_identities`.
-//! The `SOUL.md` / `IDENTITY.md` / `HEARTBEAT.md` bootstrap files under
+//! The `SOUL.md` / `IDENTITY.md` / `ROLE.md` bootstrap files under
//! `crates/openhuman-core/src/agent/prompts/` are loaded (and synced to the workspace)
//! by `IdentitySection` inside `SystemPromptBuilder::build`, so this adapter
//! never reads them itself.
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/context_composer_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/context_composer_tests.rs
index 5672d0dc4b..7b6fdb897d 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/context_composer_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/context_composer_tests.rs
@@ -4,7 +4,7 @@ use super::*;
///
/// Non-negotiable for these tests: `IdentitySection` calls
/// `sync_workspace_file`, which **writes** `SOUL.md` / `IDENTITY.md` /
-/// `HEARTBEAT.md` into `workspace_dir`. Composing against
+/// `ROLE.md` into `workspace_dir`. Composing against
/// `Config::default()` would scribble into the developer's real
/// `~/.openhuman` workspace.
fn config_in(dir: &std::path::Path) -> Arc<Config> {
diff --git a/crates/openhuman-core/src/channels/tests/common.rs b/crates/openhuman-core/src/channels/tests/common.rs
index 67fb5d3b5d..aea1adb68a 100644
--- a/crates/openhuman-core/src/channels/tests/common.rs
+++ b/crates/openhuman-core/src/channels/tests/common.rs
@@ -80,11 +80,6 @@ pub(super) fn make_workspace() -> TempDir {
"# User Profile\nName: Test User",
)
.unwrap();
- std::fs::write(
- tmp.path().join("HEARTBEAT.md"),
- "# Heartbeat\nCheck status.",
- )
- .unwrap();
std::fs::write(tmp.path().join("MEMORY.md"), "# Memory\nUser likes Rust.").unwrap();
tmp
}
diff --git a/crates/openhuman-core/src/channels/tests/prompt.rs b/crates/openhuman-core/src/channels/tests/prompt.rs
index bae9cdc9cc..0fa3767a9b 100644
--- a/crates/openhuman-core/src/channels/tests/prompt.rs
+++ b/crates/openhuman-core/src/channels/tests/prompt.rs
@@ -60,13 +60,6 @@ fn prompt_injects_workspace_files() {
"missing IDENTITY content"
);
assert!(prompt.contains("### PROFILE.md"), "missing PROFILE.md");
- // HEARTBEAT.md is intentionally excluded from channel prompts — it's only
- // relevant to the heartbeat worker and causes LLMs to emit spurious
- // "HEARTBEAT_OK" acknowledgments in channel conversations.
- assert!(
- !prompt.contains("### HEARTBEAT.md"),
- "HEARTBEAT.md should not be in channel prompt"
- );
// MEMORY.md is optional — the archivist writes it over time. When present
// in the workspace it should be inlined.
assert!(prompt.contains("### MEMORY.md"), "missing MEMORY.md");
diff --git a/crates/openhuman-core/src/config/workspace/tools.rs b/crates/openhuman-core/src/config/workspace/tools.rs
index 17651e3358..91e6d2ce79 100644
--- a/crates/openhuman-core/src/config/workspace/tools.rs
+++ b/crates/openhuman-core/src/config/workspace/tools.rs
@@ -154,8 +154,8 @@ impl Tool for WorkspaceInitTool {
"workspace_init"
}
fn description(&self) -> &str {
- "Scaffold the workspace (memory/sessions/state dirs, bundled prompts, \
- HEARTBEAT.md). `force` re-initializes existing files. Default-OFF \
+ "Scaffold the workspace (memory/sessions/state dirs, bundled prompts). \
+ `force` re-initializes existing files. Default-OFF \
(opt-in)."
}
fn parameters_schema(&self) -> serde_json::Value {
diff --git a/crates/openhuman-core/src/security/policy/types.rs b/crates/openhuman-core/src/security/policy/types.rs
index 0b773c79ef..ed99a16dd9 100644
--- a/crates/openhuman-core/src/security/policy/types.rs
+++ b/crates/openhuman-core/src/security/policy/types.rs
@@ -219,6 +219,8 @@ pub(super) const WORKSPACE_INTERNAL_FILES: &[&str] = &[
".env",
"SOUL.md",
"IDENTITY.md",
+ // No longer seeded or read (#5701), but an upgraded workspace can still
+ // hold one; keep it out of the agent-writable surface.
"HEARTBEAT.md",
"PROFILE.md",
];