Skip to content

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

fix(agent): complete profile removal cleanup

Steven Enamakel6b1209b27855
diff --git a/crates/openhuman-core/src/agent/harness/session/runtime/resume.rs b/crates/openhuman-core/src/agent/harness/session/runtime/resume.rs
index 11759d14f9..2c427317bb 100644
--- a/crates/openhuman-core/src/agent/harness/session/runtime/resume.rs
+++ b/crates/openhuman-core/src/agent/harness/session/runtime/resume.rs
@@ -137,7 +137,7 @@ impl Agent {
///
/// `agent_id: None` keeps the original unscoped behaviour, used by the
/// desktop orchestrator's web-channel resume, where a `thread_id` is
- /// driven by one logical agent even across a profile switch (#5351).
+ /// driven by one logical agent (#5351).
pub fn seed_resume_from_thread_transcript_scoped(
&mut self,
thread_id: &str,
@@ -153,21 +153,16 @@ impl Agent {
return false;
}
- // The thread's conversation belongs to the THREAD, not the active
- // profile: the locator resolves cross-dir, newest-wins across the
- // shared `session_raw/` and every canonical `session_raw-<id>/`
- // (#5351), so switching profile mid-thread continues the same
- // conversation. See `FileTranscriptLocator::root_for_thread` for why
- // this must not be own-dir-first. `agent_id` additionally narrows to
- // one agent's own transcripts — see
+ // The thread's conversation belongs to the thread. The locator reads
+ // the canonical `session_raw/` store, and `agent_id` additionally
+ // narrows to one agent's own transcripts — see
// `FileTranscriptLocator::root_for_thread_scoped`.
let Some(handle) = self
.session_locator()
.root_for_thread_scoped(thread_id, agent_id)
else {
log::debug!(
- "[web-channel] no root session_raw transcript for thread={thread_id} in any \
- (shared or canonical) session_raw dir — falling back to \
+ "[web-channel] no root session_raw transcript for thread={thread_id} — falling back to \
conversation-log prose seeding"
);
return false;
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript/thread_lookup.rs b/crates/openhuman-core/src/agent/harness/session/transcript/thread_lookup.rs
index dff816139c..dc8e9a4b62 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript/thread_lookup.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript/thread_lookup.rs
@@ -25,7 +25,7 @@ pub fn find_root_transcript_for_thread(workspace_dir: &Path, thread_id: &str) ->
/// Plain thread-id matching is ambiguous when several distinct agents can be
/// given the same caller-supplied `thread_id` — every runtime agent on one
/// [`Runtime`](openhuman_embed's library host) shares the same
-/// `session_raw*` stores, keyed only by thread id in `_meta.thread_id`. Two
+/// `session_raw/` store, keyed only by thread id in `_meta.thread_id`. Two
/// agents handed the same id would otherwise resolve to whichever one wrote
/// the newest matching transcript, splicing agent B's history (and its
/// caller's data) into agent A's turn. `agent_id` filters on
@@ -34,7 +34,7 @@ pub fn find_root_transcript_for_thread(workspace_dir: &Path, thread_id: &str) ->
///
/// `agent_id: None` is the pre-existing unscoped behaviour — used for the
/// desktop orchestrator, where a `thread_id` is only ever driven by one
-/// logical agent even across a Quick/Reasoning profile switch (#5351).
+/// logical agent (#5351).
pub fn find_root_transcript_for_thread_scoped(
workspace_dir: &Path,
thread_id: &str,
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript_roundtrip_and_paths_tests.rs b/crates/openhuman-core/src/agent/harness/session/transcript_roundtrip_and_paths_tests.rs
index b73e7dd717..251c49e65d 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript_roundtrip_and_paths_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript_roundtrip_and_paths_tests.rs
@@ -290,18 +290,18 @@ fn find_root_transcript_for_thread_skips_subagent_siblings() {
}
#[test]
-fn find_root_transcript_for_thread_scans_profile_scoped_raw_dirs() {
+fn find_root_transcript_for_thread_scans_canonical_raw_dir() {
let dir = TempDir::new().unwrap();
- let scoped_raw = dir.path().join("session_raw-alice");
+ let scoped_raw = raw_session_dir(dir.path());
fs::create_dir_all(&scoped_raw).unwrap();
let mut meta = sample_meta();
- meta.thread_id = Some("thread-scoped".into());
- let expected = scoped_raw.join("1714000000_orchestrator_thread-scoped.jsonl");
+ meta.thread_id = Some("thread-canonical".into());
+ let expected = scoped_raw.join("1714000000_orchestrator_thread-canonical.jsonl");
write_transcript(&expected, &sample_messages(), &meta, None).unwrap();
assert_eq!(
- find_root_transcript_for_thread(dir.path(), "thread-scoped"),
+ find_root_transcript_for_thread(dir.path(), "thread-canonical"),
Some(expected)
);
}
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript_thread_and_append_tests.rs b/crates/openhuman-core/src/agent/harness/session/transcript_thread_and_append_tests.rs
index 1b67a47604..eb551b8846 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript_thread_and_append_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript_thread_and_append_tests.rs
@@ -240,9 +240,9 @@ fn read_thread_usage_summary_sums_multiple_transcripts() {
}
#[test]
-fn read_thread_usage_summary_scans_profile_scoped_raw_dirs() {
+fn read_thread_usage_summary_scans_canonical_raw_dir() {
let ws = TempDir::new().unwrap();
- let raw = ws.path().join("session_raw-alice");
+ let raw = raw_session_dir(ws.path());
std::fs::create_dir_all(&raw).unwrap();
let mut meta = sample_meta();
meta.thread_id = Some("thr-scoped-usage".into());
@@ -258,7 +258,7 @@ fn read_thread_usage_summary_scans_profile_scoped_raw_dirs() {
.unwrap();
let summary = read_thread_usage_summary(ws.path(), "thr-scoped-usage")
- .expect("scoped usage summary present");
+ .expect("canonical usage summary present");
assert_eq!(summary.input_tokens, 321);
assert_eq!(summary.output_tokens, 45);
assert_eq!(summary.turn_count, 2);
diff --git a/crates/openhuman-core/src/skills/ops_create.rs b/crates/openhuman-core/src/skills/ops_create.rs
index a6ae8029c4..8b181194e5 100644
--- a/crates/openhuman-core/src/skills/ops_create.rs
+++ b/crates/openhuman-core/src/skills/ops_create.rs
@@ -155,6 +155,7 @@ fn legacy_workflow_dir(
// Flow entries are rows in `flows.db`, not bundle directories — there
// is no path to resolve. Creating one is `save_workflow`'s job.
WorkflowScope::Builtin | WorkflowScope::Legacy | WorkflowScope::Flow => return None,
+ _ => return None,
};
for root in roots {
let canonical_root = match std::fs::canonicalize(&root) {
@@ -235,6 +236,11 @@ pub(crate) fn create_workflow_inner(
.to_string(),
);
}
+ _ => {
+ return Err(
+ "cannot create skill in this scope; choose 'user' or 'project'".to_string(),
+ );
+ }
};
std::fs::create_dir_all(&scope_root)
diff --git a/crates/openhuman-core/src/skills/ops_discover/collision.rs b/crates/openhuman-core/src/skills/ops_discover/collision.rs
index ed4ef20325..a9668a4c52 100644
--- a/crates/openhuman-core/src/skills/ops_discover/collision.rs
+++ b/crates/openhuman-core/src/skills/ops_discover/collision.rs
@@ -6,6 +6,9 @@ use crate::skills::ops_types::{Workflow, WorkflowScope};
pub(super) fn absorb(by_name: &mut HashMap<String, Workflow>, incoming: Vec<Workflow>) {
for mut skill in incoming {
+ if !is_supported_scope(skill.scope) {
+ continue;
+ }
let key = skill.name.clone();
let collision_keys: Vec<String> = by_name
.iter()
@@ -66,5 +69,17 @@ pub(super) const fn precedence(scope: WorkflowScope) -> u8 {
WorkflowScope::User => 2,
WorkflowScope::Project => 3,
WorkflowScope::Flow => 4,
+ _ => 0,
}
}
+
+const fn is_supported_scope(scope: WorkflowScope) -> bool {
+ matches!(
+ scope,
+ WorkflowScope::Builtin
+ | WorkflowScope::Legacy
+ | WorkflowScope::User
+ | WorkflowScope::Project
+ | WorkflowScope::Flow
+ )
+}
diff --git a/crates/openhuman-core/src/threads/transcript_view/transcript_view_tests.rs b/crates/openhuman-core/src/threads/transcript_view/transcript_view_tests.rs
index 6d4d9354eb..b95cb2221b 100644
--- a/crates/openhuman-core/src/threads/transcript_view/transcript_view_tests.rs
+++ b/crates/openhuman-core/src/threads/transcript_view/transcript_view_tests.rs
@@ -289,12 +289,12 @@ fn subagent_file_projects_as_nested_item() {
}
#[test]
-fn profile_scoped_root_and_subagent_project_together() {
+fn canonical_root_and_subagent_project_together() {
let dir = TempDir::new().unwrap();
- let raw_dir = dir.path().join("session_raw-alice");
+ let raw_dir = dir.path().join("session_raw");
std::fs::create_dir_all(&raw_dir).unwrap();
let root_stem = "450_orchestrator";
- let thread_id = "thr_profile";
+ let thread_id = "thr_canonical";
write_raw_at(
&raw_dir.join(format!("{root_stem}.jsonl")),
diff --git a/crates/openhuman-embed/src/harness/builder.rs b/crates/openhuman-embed/src/harness/builder.rs
index 49d60b47a8..193f9fdc5f 100644
--- a/crates/openhuman-embed/src/harness/builder.rs
+++ b/crates/openhuman-embed/src/harness/builder.rs
@@ -229,7 +229,7 @@ impl HarnessBuilder {
// Refused before any runtime is built, so a bad input never claims
// the process slot. The new API allows skills on an inherited
- // workspace because it copies into the agent's own profile home; the
+ // workspace because it copies into the agent's own home; the
// harness keeps installing into `<workspace>/skills`, which under
// `Inherit` is the operator's, so it keeps refusing.
#[cfg(feature = "skills")]
diff --git a/crates/openhuman-embed/src/runtime/mod.rs b/crates/openhuman-embed/src/runtime/mod.rs
index 1a0c29a7e6..43c1df89aa 100644
--- a/crates/openhuman-embed/src/runtime/mod.rs
+++ b/crates/openhuman-embed/src/runtime/mod.rs
@@ -263,8 +263,8 @@ impl Runtime {
.unwrap_or_else(|| Path::new(""))
}
- /// The runtime-wide workspace: session database, shared memory, and every
- /// agent's `personalities/<id>/` home and `session_raw-<id>/` transcripts.
+ /// The runtime-wide workspace: session database, shared memory, every
+ /// agent's `agents/<id>/` home, and the canonical `session_raw/` transcripts.
pub fn workspace_dir(&self) -> &Path {
&self.base_config.workspace_dir
}
diff --git a/docs/TEST-COVERAGE-MATRIX.md b/docs/TEST-COVERAGE-MATRIX.md
index e7ae509e14..edb8ec451f 100644
--- a/docs/TEST-COVERAGE-MATRIX.md
+++ b/docs/TEST-COVERAGE-MATRIX.md
@@ -602,7 +602,7 @@ End-to-end coverage of the agent harness via the web-chat RPC surface against an
| ------ | -------------------------------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 13.6.1 | Command Palette (⌘K / ⌘P) | VU+WD | `app/src/lib/commands/__tests__/globalActions.test.tsx`, `app/src/components/commands/__tests__/CommandProvider.test.tsx`, `app/test/e2e/specs/command-palette.spec.ts` | ✅ | Opens via ⌘K, runs an action, lists seed nav actions, Esc closes |
| 13.6.2 | Keyboard Shortcuts help directory (? / ⌘/) | VU+WD | `app/src/components/shortcuts/__tests__/shortcutsView.test.tsx`, `app/src/components/commands/__tests__/CommandProvider.test.tsx`, `app/test/e2e/specs/command-palette.spec.ts` | ✅ | Registry-driven grouped list; opens via `?` and ⌘/ (mutually exclusive with palette); also reachable from the sidebar shortcut icon + Settings → Keyboard Shortcuts |
-| 13.6.3 | Global shortcut map (nav / chat / view / profiles) | VU | `app/src/lib/commands/__tests__/globalActions.test.tsx` | ✅ | Control-based nav (`ctrl`/`mod` per-OS), New Chat / Toggle Sidebar handlers, alias keys, and wired-but-hidden profile switches |
+| 13.6.3 | Global shortcut map (nav / chat / view) | VU | `app/src/lib/commands/__tests__/globalActions.test.tsx` | ✅ | Control-based nav (`ctrl`/`mod` per-OS), New Chat / Toggle Sidebar handlers, and alias keys |
---
diff --git a/docs/specs/agent-runtime-upstream-boundary.md b/docs/specs/agent-runtime-upstream-boundary.md
index 9df7775693..53f3a20c89 100644
--- a/docs/specs/agent-runtime-upstream-boundary.md
+++ b/docs/specs/agent-runtime-upstream-boundary.md
@@ -270,7 +270,7 @@ all consumers import the owner directly, not that behavior is dropped.
| `library/` | Keep | Product-facing safe definition projection/RPC DTO. |
| `orchestration/` | Split | Move generic graph lifecycle/delegation/selection; keep worktrees, workflow business rules, delivery, RPC, ledgers, and host tools. |
| `plan_review/` | Keep | OpenHuman interactive approval policy and RPC state. |
-| `profiles/` | Keep | Product persistence/prompts/connectors; project definitions into registry. |
+| `profiles/` | Delete | Removed in this migration; agent definitions come from the registry. |
| `progress_tracing.rs`, `progress_tracing/` | Keep | OpenHuman UI/Langfuse projection and transport. Generic observations/events remain upstream. |
| `prompts/` | Keep/Split | Keep bundled product prompts and section content. Move behavior-free render helpers/building blocks that name no product type to harness/prompt. |
| `registry/` | Split | Keep enablement, custom-agent persistence, product defaults and RPC; move definition parsing/validation/lookup to `tinyagents-registry`; delete thin `registry/tools.rs`. |