Skip to content

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

Merge remote-tracking branch 'origin/main' into epic-8088-final-rollup

Steven Enamakel6910bf8ced8a
diff --cc crates/openhuman-core/src/agent/session_host/mod.rs
index 1f0a0cf701,86d8422bee..a6a0b552ee
--- a/crates/openhuman-core/src/agent/session_host/mod.rs
+++ b/crates/openhuman-core/src/agent/session_host/mod.rs
@@@ -46,7 -46,15 +47,8 @@@ mod live_tools
mod resume_bound_session_tests;
mod runtime;
mod runtime_session;
+ mod session_key;
-pub(crate) mod stop_summary;
-mod turn;
-// `pub(crate)` since issue #6014: the tool-call-cap instruction is now appended
-// inside the loop by `tinyagents::middleware::FinalCallWrapUpMiddleware`, so the
-// harness-assembly site has to name it. It stays the one definition — the whole
-// point is that the in-loop conclusion and the out-of-band fallback ask for the
-// same thing.
-pub(crate) mod turn_checkpoint;
+pub(crate) mod stop_policy;
mod types;
#[cfg(test)]
diff --cc crates/openhuman-core/src/agent/session_host/types.rs
index fe2e8025d8,4cc15213be..c378cd7367
--- a/crates/openhuman-core/src/agent/session_host/types.rs
+++ b/crates/openhuman-core/src/agent/session_host/types.rs
@@@ -327,13 -324,37 +327,31 @@@ pub struct OpenHumanSessionHost
/// Injected transcript locator, or `None` to resolve the session store for
/// this agent key.
///
- /// The single injection point for the whole transcript seam: it resolves
- /// both resume reads (`latest_for_agent`, `root_for_thread`) and binds this
- /// session's write handle (`open_stem`). `None` is the production default
- /// and is resolved *lazily* by
- /// [`OpenHumanSessionHost::session_locator`][Self::session_locator] into the
- /// session store's transcripts for the **current** `workspace_dir` — never
- /// captured at build time, because callers (tests especially) reassign
- /// `workspace_dir` after `build()` and a frozen locator would silently keep
- /// reading the old directory.
+ /// Optional transcript locator used by focused session-host tests and
+ /// embedders that supply their own durable transcript store. Production
+ /// thread-bound sessions use `SessionIdentityResolver` admission instead.
pub(super) session_history_locator:
Option<std::sync::Arc<dyn tinyagents_session::transcript::TranscriptLocator>>,
- /// Unique transcript key for this session, formatted as
- /// `"{unix_ts}_{agent_id}"`. Generated once at agent-build time so
+ /// First-call memo for [`OpenHumanSessionHost::session_locator`][Self::session_locator]'s
+ /// lazily-resolved store locator (the `session_history_locator` `None` branch).
+ ///
+ /// tinyagents' `SessionBuilder` only accepts a later transcript-target
+ /// change when it is the *same* locator object (`Arc::ptr_eq`), not merely
+ /// an equivalent one — see `tinyagents_session::transcript`'s
+ /// `TranscriptTarget::same_binding`. `session_locator` is called from more
+ /// than one place while building a session's runtime turn machinery (the
+ /// `before_resume` resume target and the eager construction-time bind), and
+ /// without this memo each call minted a fresh `Arc` over the same
+ /// destination, so the second bind was rejected with "cannot change a
+ /// transcript target after it is bound or committed" even though both
+ /// calls agreed on the file. `OnceLock` keeps the resolution lazy — still
+ /// read from `workspace_dir` at first use, not frozen at struct-build time
+ /// — while guaranteeing every later caller in this host's lifetime gets
+ /// back the identical `Arc`.
+ pub(super) session_history_locator_memo:
+ std::sync::OnceLock<std::sync::Arc<dyn tinyagents_session::transcript::TranscriptLocator>>,
+ /// Transcript key for this session, `{unix_ts}_{token}_{agent}`, unique
+ /// per session host. Generated once at agent-build time so
/// every transcript write in this session uses the same filename
/// stem. Sub-agents chain their parent's key into the transcript
/// directory to produce a hierarchical layout —