Skip to content

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

fix(agent-memory): drop the RecallOpts field the main merge duplicated\n\n`main` landed the same self-echo exclusion independently (2ccefae96), so\nmerging it left `exclude_session_id` initialised twice in one struct\nliteral — once from this branch's older `session` and once from main's\n`current_thread_id_ref`. That does not compile, and the raw-coverage\nliteral had the same shape.\n\nKeep main's value. `req.thread_id` is what the caller asked to scope to;\nthe thread-context task-local is what the turn is actually running in,\nand it is the one that survives the module boundary. The rationale main\ndropped — that excluding the session does not fight scoping to it,\nbecause the engine filters only document-kind hits by this field — is\nfolded into the comment that stays.\n\n

Shanu767695f59bd3
diff --git a/src/openhuman/agent/tinyagents/host/agent_memory.rs b/src/openhuman/agent/tinyagents/host/agent_memory.rs
index f0b4ac26b0..775d30c2d0 100644
--- a/src/openhuman/agent/tinyagents/host/agent_memory.rs
+++ b/src/openhuman/agent/tinyagents/host/agent_memory.rs
@@ -372,26 +372,16 @@ impl AgentMemory for OpenHumanAgentMemory {
// absent means "exclude nothing" — the agent gets handed back what
// it just said. Resolving it here keeps the behaviour identical on
// both paths.
+ //
+ // It does not fight `session_id` above. The engine filters only
+ // document-kind hits by this field, while `session_id` and
+ // `cross_session` scope the episodic and event tiers — so scoping
+ // to a session and excluding it is not a contradiction, and a
+ // thread hint still narrows *to* that session.
exclude_session_id: current_thread_id_ref.as_deref(),
// Widening past the requested session is a wiring decision, never a
// runtime hint.
cross_session: self.cross_session,
- // The turn's own auto-saved request must not come back as its own
- // best hit. The harness writes the user's message as a
- // `[conversation]` document tagged with this thread id, so a recall
- // issued *during* that turn retrieves it unless this is set.
- //
- // It does not fight `session_id` above: the engine filters only
- // document-kind hits by this field, while `session_id` /
- // `cross_session` scope the episodic and event tiers. Different
- // tiers, so scoping to a session and excluding it is not a
- // contradiction.
- //
- // Explicit rather than left to the engine's ambient task-local: a
- // `cdylib` has its own statics, so that fallback reads `None` on
- // the far side of the module boundary — which is the path this
- // call takes.
- exclude_session_id: session,
};
let entries = crate::openhuman::agent::tinyagents::retriever::recall_through_facade(
diff --git a/tests/raw_coverage/memory_threads_raw_coverage_e2e.rs b/tests/raw_coverage/memory_threads_raw_coverage_e2e.rs
index 1511f00fe5..a3b3e4546f 100644
--- a/tests/raw_coverage/memory_threads_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/memory_threads_raw_coverage_e2e.rs
@@ -2097,9 +2097,6 @@ fn memory_retrieval_embedding_and_rpc_model_helpers_round_trip() {
// field was added.
exclude_session_id: None,
cross_session: true,
- // Shape assertion, not behaviour: this exercises the field surface, so
- // the exclusion is the "exclude nothing" value.
- exclude_session_id: None,
};
assert!(opts.cross_session);
assert_eq!(opts.category.unwrap().to_string(), "conversation");