Skip to content

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

chore(cron): add session_identity field to job origin

Steven Enamakele24cfa48ba9f
diff --git a/crates/openhuman-core/src/cron/job_builder_tests.rs b/crates/openhuman-core/src/cron/job_builder_tests.rs
index 93cdfde6da..b9209fef6a 100644
--- a/crates/openhuman-core/src/cron/job_builder_tests.rs
+++ b/crates/openhuman-core/src/cron/job_builder_tests.rs
@@ -39,6 +39,7 @@ fn channel() -> JobOrigin {
history_key: "telegram_alice_42".into(),
sender: Some("alice".into()),
thread_id: None,
+ session_identity: None,
}
}
diff --git a/crates/openhuman-core/src/cron/origin.rs b/crates/openhuman-core/src/cron/origin.rs
index 22b3759623..d999e8f0bb 100644
--- a/crates/openhuman-core/src/cron/origin.rs
+++ b/crates/openhuman-core/src/cron/origin.rs
@@ -41,6 +41,7 @@ pub(crate) fn job_origin_from_turn(origin: &AgentTurnOrigin) -> Option<JobOrigin
history_key: history_key.clone(),
sender: sender.clone(),
thread_id: None,
+ session_identity: None,
})
}
_ => None,
diff --git a/crates/openhuman-core/src/cron/origin_tests.rs b/crates/openhuman-core/src/cron/origin_tests.rs
index 6c5133cef0..6342a7bdc7 100644
--- a/crates/openhuman-core/src/cron/origin_tests.rs
+++ b/crates/openhuman-core/src/cron/origin_tests.rs
@@ -44,6 +44,7 @@ fn channel_turn_maps_to_channel_origin_with_history_key() {
history_key: "telegram_alice_42".into(),
sender: Some("alice".into()),
thread_id: None,
+ session_identity: None,
})
);
}
@@ -116,6 +117,7 @@ fn channel_origin_job_runs_as_external_channel_turn() {
history_key: "k".into(),
sender: Some("alice".into()),
thread_id: None,
+ session_identity: None,
}));
match turn_origin_for_job_run(&job, "run-1") {
AgentTurnOrigin::ExternalChannel {
diff --git a/crates/openhuman-core/src/cron/store_tests.rs b/crates/openhuman-core/src/cron/store_tests.rs
index b5f90c8b1d..2eaf9db8fe 100644
--- a/crates/openhuman-core/src/cron/store_tests.rs
+++ b/crates/openhuman-core/src/cron/store_tests.rs
@@ -118,6 +118,7 @@ fn a_stale_routing_patch_cannot_combine_with_a_newer_unvalidated_route() {
history_key: format!("telegram-target-{target}"),
sender: None,
thread_id: None,
+ session_identity: None,
};
let origin_42 = channel_origin("42");
let origin_999 = channel_origin("999");
diff --git a/crates/openhuman-core/src/cron/tools/collapsed_tests.rs b/crates/openhuman-core/src/cron/tools/collapsed_tests.rs
index 4aef29eeef..d19f67a90b 100644
--- a/crates/openhuman-core/src/cron/tools/collapsed_tests.rs
+++ b/crates/openhuman-core/src/cron/tools/collapsed_tests.rs
@@ -204,6 +204,7 @@ async fn add_uses_the_explicit_channel_origin_without_ambient_turn_state() {
history_key: "telegram-alice-42".into(),
sender: Some("alice".into()),
thread_id: None,
+ session_identity: None,
})
);
assert_eq!(jobs[0].delivery.mode, "origin");
diff --git a/crates/openhuman-core/src/cron/tools/update_tests.rs b/crates/openhuman-core/src/cron/tools/update_tests.rs
index c633f40459..9416c96f5b 100644
--- a/crates/openhuman-core/src/cron/tools/update_tests.rs
+++ b/crates/openhuman-core/src/cron/tools/update_tests.rs
@@ -14,6 +14,7 @@ fn channel_origin(reply_target: &str) -> JobOrigin {
history_key: format!("telegram-user-{reply_target}"),
sender: Some("alice".into()),
thread_id: None,
+ session_identity: None,
}
}
diff --git a/docs/storage-schema.md b/docs/storage-schema.md
index 82480d51b2..745e0dabba 100644
--- a/docs/storage-schema.md
+++ b/docs/storage-schema.md
@@ -1,94 +1,39 @@
# Storage schema
<!-- Generated by `pnpm docs:generate` (scripts/ci/check-storage-schema.mjs) from the
-host-composed owner `CollectionSpec` values (`crates/openhuman-core/src/storage/schema.rs`). Do not edit by hand. -->
+per-crate `CollectionSpec` values (`crates/openhuman-core/src/storage/schema.rs`). Do not edit by hand. -->
-Record owners declare collections with `CollectionSpec`; the host composes and prepares
-those declarations at boot. Each section lists the specs by the owner namespace in the
-collection name, including indexes, expiry fields, and full-text search fields.
+Each crate declares its collections with `CollectionSpec`; the host calls
+`ensure_collection` for every declaration at boot. Sections preserve the declaring
+crate, including when two crates use the same collection name.
Record shapes and migrations stay with their owners.
-## agents
+## openhuman-core
| Collection | Indexes | Expiry field | Search fields |
| --- | --- | --- | --- |
| `agents.registry` | | | |
-
-## approvals
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
| `approvals.flow_trust` | `by_flow` (`flow_id`, `tool_name`) | | |
| `approvals.requests` | `by_decided` (`pending`, `decided_ms`)<br>`by_pending` (`pending`, `created_ms`)<br>`by_session` (`session_id`, `pending`) | | |
-
-## artifacts
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
| `artifacts.args` | | | |
| `artifacts.records` | `by_thread` (`thread_id`, `created_ms`) | | |
| `artifacts.versions` | | | |
-
-## box
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
-| `box.boxes` | | | |
-| `box.jail_index` | | | |
-
-## channels
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
-| `channels.delivery_failed` | | | |
-| `channels.delivery_pending` | | | |
-| `channels.delivery_results` | | | |
-| `channels.migrations` | | | |
-| `channels.remote_bindings` | | | |
-| `channels.remote_busy` | | | |
-| `channels.remote_meta` | | | |
-| `channels.whatsapp_device` | | | |
-| `channels.whatsapp_identity` | | | |
-| `channels.whatsapp_lid_mapping` | | | |
-| `channels.whatsapp_prekey` | | | |
-| `channels.whatsapp_sender_key` | | | |
-| `channels.whatsapp_session` | | | |
-| `channels.whatsapp_signed_prekey` | | | |
-| `channels.whatsapp_sync_key` | | | |
-
-## config
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
| `config.documents` | | | |
-
-## connectors
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
-| `connectors.migrations` | | | |
-| `connectors.user_scopes` | | | |
-
-## conversations
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
-| `conversations.appends` | | | |
-| `conversations.threads` | | | |
-
-## cost
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
| `cost.records` | `by_time` (`ts_ms`) | | |
-
-## devices
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
| `devices.paired` | `by_active` (`revoked`, `created_ms`) | | |
+| `inbound.results` | `by_source` (`source`, `created_ms`)<br>`by_status` (`status`, `created_ms`) | | |
+| `notifications.core` | `by_read` (`workspace`, `read`, `timestamp_ms`) | | |
+| `notifications.dedup` | | | |
+| `notifications.integration` | `by_provider` (`provider`, `received_ms`)<br>`by_status` (`status`) | | |
+| `notifications.settings` | | | |
+| `openhuman.journal_backfill` | | | |
+| `profiles.registry` | | | |
+| `subagents.sessions` | | | |
+| `task_sources.ingested` | `by_source` (`source_id`, `ingested_ms`) | | |
+| `task_sources.sources` | `by_created` (`created_ms`) | | |
+| `threads.transcript_keys` | | | |
-## graph
+## tinyagents-graph
| Collection | Indexes | Expiry field | Search fields |
| --- | --- | --- | --- |
@@ -96,7 +41,7 @@ Record shapes and migrations stay with their owners.
| `graph.threads` | `by_ns` (`ns`) | | |
| `graph.writes` | `by_thread` (`ns`, `thread`) | | |
-## harness
+## tinyagents-harness
| Collection | Indexes | Expiry field | Search fields |
| --- | --- | --- | --- |
@@ -104,31 +49,16 @@ Record shapes and migrations stay with their owners.
| `harness.embedding_cache` | `by_signature` (`sig`) | | |
| `harness.run_status` | `by_active` (`active`)<br>`by_root` (`root_run_id`)<br>`by_thread` (`thread_id`) | | |
-## history
+## tinyagents-session
| Collection | Indexes | Expiry field | Search fields |
| --- | --- | --- | --- |
+| `conversations.appends` | | | |
+| `conversations.threads` | | | |
| `history.messages` | `session_id` (`session_id`, `id`) | | |
| `history.search` | `session` (`session_id`) | | `agent_name`, `content`, `tool_name` |
| `history.sessions` | `agent` (`agent_definition_id`)<br>`channel` (`source_channel`)<br>`parent` (`parent_session_id`, `started_ms`)<br>`started` (`started_ms`)<br>`status_started` (`status`, `started_ms`)<br>`thread` (`thread_id`) | | |
| `history.tool_calls` | `created` (`created_ms`)<br>`session_id` (`session_id`, `id`)<br>`tool` (`tool_name`) | | |
-
-## inbound
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
-| `inbound.results` | `by_source` (`source`, `created_ms`)<br>`by_status` (`status`, `created_ms`) | | |
-
-## juice
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
-| `juice.savings` | | | |
-
-## ledger
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
| `ledger.agent_runs` | `kind` (`kind`)<br>`parent` (`parent_run_id`)<br>`status` (`status`)<br>`thread` (`parent_thread_id`)<br>`updated` (`updated_ms`)<br>`worker` (`worker_thread_id`) | | |
| `ledger.event_heads` | | | |
| `ledger.event_outbox` | `run_sequence` (`run_id`, `sequence`) unique | | |
@@ -138,91 +68,61 @@ Record shapes and migrations stay with their owners.
| `ledger.telemetry` | `updated` (`updated_ms`) | | |
| `ledger.tool_effects` | `run` (`run_id`)<br>`started` (`started_ms`)<br>`status` (`status`) | | |
| `ledger.workflow_runs` | `definition` (`definition_id`)<br>`status` (`status`)<br>`thread` (`parent_thread_id`)<br>`updated` (`updated_ms`) | | |
-
-## legacy (unqualified names)
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
-| `remix_markers` | | | |
-| `tinymemes_documents` | | | |
-
-## mcp
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
-| `mcp.registry_cache` | `cache_key` (`cache_key`) | | |
-| `mcp.registry_index` | `source` (`source`) | | |
-| `mcp.registry_index_state` | | | |
-| `mcp.server_names` | | | |
-| `mcp.servers` | `installed_ms` (`installed_ms`)<br>`qualified_name` (`qualified_name`) | | |
-| `mcp.tool_cache` | | | |
-
-## memes
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
-| `memes.remix_markers` | | | |
-| `memes.state` | | | |
-
-## notifications
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
-| `notifications.core` | `by_read` (`workspace`, `read`, `timestamp_ms`) | | |
-| `notifications.dedup` | | | |
-| `notifications.integration` | `by_provider` (`provider`, `received_ms`)<br>`by_status` (`status`) | | |
-| `notifications.settings` | | | |
-
-## openhuman
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
-| `openhuman.journal_backfill` | | | |
-
-## profiles
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
-| `profiles.registry` | | | |
-
-## session
-
-| Collection | Indexes | Expiry field | Search fields |
-| --- | --- | --- | --- |
| `session.transcript_entries` | `by_stem_written` (`stem`, `written`)<br>`by_stem` (`stem`, `seq`) | | |
| `session.transcripts` | `by_agent_id` (`agent_id`, `created_ms`)<br>`by_agent_name` (`agent_name`, `created_ms`)<br>`by_thread` (`thread_id`, `created_ms`) | | |
| `session.turn_states` | `by_thread` (`thread_id`) | | |
+| `tsd.counters` | | | |
+| `tsd.kv` | `kv_by_key` (`owner`, `ns`, `key`) | | |
+| `tsd.leases` | | | |
+| `tsd.migrations` | | | |
-## skills
+## tinyagents-tasks
| Collection | Indexes | Expiry field | Search fields |
| --- | --- | --- | --- |
-| `skills.bundles` | | | |
-| `skills.catalogs` | | | |
-| `skills.migrations` | | | |
+| `tasks.completions` | `by_parent` (`parent_key`)<br>`by_state` (`state`) | | |
+| `tasks.history` | `task_rev` (`task_id`, `rev`) unique | | |
+| `tasks.records` | `kind` (`kind_label`)<br>`node` (`node_id`)<br>`parent` (`parent_run_id`)<br>`root` (`root_run_id`)<br>`status` (`status`)<br>`thread` (`thread_id`) | | |
-## subagents
+## tinybox-bus
| Collection | Indexes | Expiry field | Search fields |
| --- | --- | --- | --- |
-| `subagents.sessions` | | | |
+| `box.boxes` | | | |
+| `box.cli_imports` | | | |
+| `box.jail_index` | | | |
+| `box.migrations` | | | |
+| `box.templates` | | | |
-## task_sources
+## tinychannels-bus
| Collection | Indexes | Expiry field | Search fields |
| --- | --- | --- | --- |
-| `task_sources.ingested` | `by_source` (`source_id`, `ingested_ms`) | | |
-| `task_sources.sources` | `by_created` (`created_ms`) | | |
+| `channels.delivery_failed` | | | |
+| `channels.delivery_pending` | | | |
+| `channels.delivery_results` | | | |
+| `channels.media_metadata` | | | |
+| `channels.migrations` | | | |
+| `channels.remote_bindings` | | | |
+| `channels.remote_busy` | | | |
+| `channels.remote_meta` | | | |
+| `channels.whatsapp_device` | | | |
+| `channels.whatsapp_identity` | | | |
+| `channels.whatsapp_lid_mapping` | | | |
+| `channels.whatsapp_prekey` | | | |
+| `channels.whatsapp_sender_key` | | | |
+| `channels.whatsapp_session` | | | |
+| `channels.whatsapp_signed_prekey` | | | |
+| `channels.whatsapp_sync_key` | | | |
-## tasks
+## tinyconnectors-bus
| Collection | Indexes | Expiry field | Search fields |
| --- | --- | --- | --- |
-| `tasks.completions` | `by_parent` (`parent_key`)<br>`by_state` (`state`) | | |
-| `tasks.history` | `task_rev` (`task_id`, `rev`) unique | | |
-| `tasks.records` | `kind` (`kind_label`)<br>`node` (`node_id`)<br>`parent` (`parent_run_id`)<br>`root` (`root_run_id`)<br>`status` (`status`)<br>`thread` (`thread_id`) | | |
+| `connectors.migrations` | | | |
+| `connectors.user_scopes` | | | |
-## teq
+## tinyeventqueues-bus
| Collection | Indexes | Expiry field | Search fields |
| --- | --- | --- | --- |
@@ -239,22 +139,44 @@ Record shapes and migrations stay with their owners.
| `teq.threads` | | | |
| `teq.tombstones` | `by_expiry` (`expires_ms`) | | |
-## threads
+## tinyjuice-bus
| Collection | Indexes | Expiry field | Search fields |
| --- | --- | --- | --- |
-| `threads.transcript_keys` | | | |
+| `juice.savings` | | | |
-## tsd
+## tinymcp-bus
| Collection | Indexes | Expiry field | Search fields |
| --- | --- | --- | --- |
-| `tsd.counters` | | | |
-| `tsd.kv` | `kv_by_key` (`owner`, `ns`, `key`) | | |
+| `mcp.registry_cache` | `cache_key` (`cache_key`) | | |
+| `mcp.registry_index` | `source` (`source`) | | |
+| `mcp.registry_index_state` | | | |
+| `mcp.server_names` | | | |
+| `mcp.servers` | `installed_ms` (`installed_ms`)<br>`qualified_name` (`qualified_name`) | | |
+| `mcp.tool_cache` | | | |
+| `tsd.migrations` | | | |
+
+## tinymemes-bus
+
+| Collection | Indexes | Expiry field | Search fields |
+| --- | --- | --- | --- |
+| `memes.remix_markers` | | | |
+| `memes.state` | | | |
+| `remix_markers` | | | |
+| `tinymemes_documents` | | | |
| `tsd.leases` | | | |
| `tsd.migrations` | | | |
-## wallet
+## tinyskills-drivers
+
+| Collection | Indexes | Expiry field | Search fields |
+| --- | --- | --- | --- |
+| `skills.bundles` | | | |
+| `skills.catalogs` | | | |
+| `skills.migrations` | | | |
+
+## tinywallet-bus
| Collection | Indexes | Expiry field | Search fields |
| --- | --- | --- | --- |
diff --git a/vendor/tinyagents b/vendor/tinyagents
index a2cf5a408f..8809f1d080 160000
--- a/vendor/tinyagents
+++ b/vendor/tinyagents
@@ -1 +1 @@
-Subproject commit a2cf5a408fa8acecebbd1faad6617416400da419
+Subproject commit 8809f1d0801260ff1134fc7b962933d20125a1ee