Skip to content

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

fix(memory): keep the office parsers behind the `documents` feature

Ghost Scripter3023b472bd38
diff --git a/crates/openhuman-core/Cargo.toml b/crates/openhuman-core/Cargo.toml
index 67d1eabf8f..a143d2e034 100644
--- a/crates/openhuman-core/Cargo.toml
+++ b/crates/openhuman-core/Cargo.toml
@@ -207,7 +207,7 @@ tinyruntime-pyserver = { path = "../../vendor/tinyruntime/crates/tinyruntime-pys
# `memory::` is the only module that names the engine side.
tinymemory-api = { path = "../../vendor/tinymemory/crates/tinymemory-api" }
tinymemory-tools = { path = "../../vendor/tinymemory/crates/tinymemory-tools" }
-tinymemory-integrations = { path = "../../vendor/tinymemory/crates/tinymemory-integrations", default-features = false, features = ["cortex", "brain", "documents-office", "sources-network", "safety", "legacy-import"] }
+tinymemory-integrations = { path = "../../vendor/tinymemory/crates/tinymemory-integrations", default-features = false, features = ["cortex", "brain", "sources-network", "safety", "legacy-import"] }
# tinyconnectors-bus — the OAuth connector wire contract
# (https://github.com/tinyhumansai/tinyconnectors). Payload types and member
# names for the connector surface, with no transport and no behaviour: this
@@ -744,7 +744,10 @@ inference = ["tinycomputer-accessibility/microphone-probe"]
# reference instead of extracted text
# (`agent::multimodal::extract_pdf_text`). Slim / headless builds opt out via
# `--no-default-features --features "<explicit list without documents>"`.
-documents = ["modules", "dep:tinydocs-bus"]
+# `tinymemory-integrations/documents-office`: memory's brain and file sources
+# read PDF, DOCX, PPTX and XLSX (memory::convert). Kept behind `documents` so
+# the parsers stay off the always-on path (kernel floor).
+documents = ["modules", "dep:tinydocs-bus", "tinymemory-integrations/documents-office"]
# Hosting: the `hosting_*` agent tools that put a workspace on a real hosting
# provider — a site, a managed database wired into it, its environment, its
# domains, its deployments and the traffic they served. Default-OFF,
diff --git a/crates/openhuman-core/src/memory/convert.rs b/crates/openhuman-core/src/memory/convert.rs
index 164ae11eb1..03aac3cdb0 100644
--- a/crates/openhuman-core/src/memory/convert.rs
+++ b/crates/openhuman-core/src/memory/convert.rs
@@ -1,6 +1,8 @@
//! The document converter memory files with: PDF, DOCX, PPTX and XLSX through
-//! TinyMemory's `OfficeConverter`, then its `NativeConverter` for text,
-//! markdown, HTML and code.
+//! TinyMemory's `OfficeConverter` (with the `documents` feature, which the
+//! shipped product enables), then its `NativeConverter` for text, markdown,
+//! HTML and code. Without `documents` the chain is native only, and an office
+//! file is refused as before; the parsers stay off the always-on path.
//!
//! Brain ingest (`memory_brain_ingest` with a `path`) and file-backed sources
//! (folder, file) both convert through [`converter`], so a PDF filed by hand
@@ -15,15 +17,21 @@
use std::sync::LazyLock;
-use async_trait::async_trait;
-use tinymemory_integrations::documents::{
- ConvertedDocument, ConverterChain, DocumentConverter, DocumentFormat, Error, OfficeConverter,
- RawDocument, Result,
+use tinymemory_integrations::documents::ConverterChain;
+#[cfg(feature = "documents")]
+use {
+ async_trait::async_trait,
+ tinymemory_integrations::documents::{
+ ConvertedDocument, DocumentConverter, DocumentFormat, Error, OfficeConverter, RawDocument,
+ Result,
+ },
};
/// [`OfficeConverter`] on the blocking pool.
+#[cfg(feature = "documents")]
struct BlockingOffice;
+#[cfg(feature = "documents")]
#[async_trait]
impl DocumentConverter for BlockingOffice {
fn name(&self) -> &str {
@@ -45,8 +53,12 @@ impl DocumentConverter for BlockingOffice {
}
}
-static CHAIN: LazyLock<ConverterChain> =
- LazyLock::new(|| ConverterChain::default().prepend(Box::new(BlockingOffice)));
+static CHAIN: LazyLock<ConverterChain> = LazyLock::new(|| {
+ let chain = ConverterChain::default();
+ #[cfg(feature = "documents")]
+ let chain = chain.prepend(Box::new(BlockingOffice));
+ chain
+});
/// The converter every memory write of a file goes through.
pub(crate) fn converter() -> &'static ConverterChain {
diff --git a/crates/openhuman-core/src/memory/convert_tests.rs b/crates/openhuman-core/src/memory/convert_tests.rs
index 234c6be372..6b11ca7db9 100644
--- a/crates/openhuman-core/src/memory/convert_tests.rs
+++ b/crates/openhuman-core/src/memory/convert_tests.rs
@@ -1,9 +1,12 @@
use super::*;
-use tinymemory_api::{ItemKind, MetaFilter};
-
-use crate::memory::brain::{ingest, BrainIngestParams};
-use crate::memory::test_fixtures::{bind_reference, config_in, stored};
+use tinymemory_integrations::documents::{DocumentConverter, Error, RawDocument};
+#[cfg(feature = "documents")]
+use {
+ crate::memory::brain::{ingest, BrainIngestParams},
+ crate::memory::test_fixtures::{bind_reference, config_in, stored},
+ tinymemory_api::{ItemKind, MetaFilter},
+};
/// A one-page PDF whose only text is `text` (Helvetica, no compression).
fn pdf_saying(text: &str) -> Vec<u8> {
@@ -41,6 +44,7 @@ fn pdf_saying(text: &str) -> Vec<u8> {
out.into_bytes()
}
+#[cfg(feature = "documents")]
#[tokio::test]
async fn a_pdf_converts_to_its_text() {
let raw = RawDocument::new(pdf_saying("The vendor code is PV-7023")).with_filename("brief.pdf");
@@ -72,6 +76,7 @@ async fn an_unknown_binary_is_still_refused_with_a_clear_error() {
assert!(matches!(error, Error::UnsupportedFormat(_)), "{error}");
}
+#[cfg(feature = "documents")]
#[tokio::test]
async fn brain_ingest_files_a_pdf_by_path() {
let tmp = tempfile::tempdir().unwrap();
@@ -97,3 +102,13 @@ async fn brain_ingest_files_a_pdf_by_path() {
assert_eq!(docs.len(), 1);
assert!(docs[0].text.contains("PV-7023"), "{}", docs[0].text);
}
+
+/// Without `documents` the office parsers are not linked: a PDF is refused
+/// as unsupported, never mis-read as text.
+#[cfg(not(feature = "documents"))]
+#[tokio::test]
+async fn without_the_documents_feature_a_pdf_is_refused_cleanly() {
+ let raw = RawDocument::new(pdf_saying("The vendor code is PV-7023")).with_filename("brief.pdf");
+ let error = converter().convert(&raw).await.unwrap_err();
+ assert!(matches!(error, Error::UnsupportedFormat(_)), "{error}");
+}
diff --git a/scripts/ci/check-dep-sim-calibration.sh b/scripts/ci/check-dep-sim-calibration.sh
index 556a5b16d3..ba51c9af01 100755
--- a/scripts/ci/check-dep-sim-calibration.sh
+++ b/scripts/ci/check-dep-sim-calibration.sh
@@ -95,6 +95,6 @@ set -euo pipefail
cd "$(dirname "$0")/../.."
-EXPECTED_NAMES=311
+EXPECTED_NAMES=307
exec python3 scripts/dep-sim.py --cut-nothing --expect-names "${EXPECTED_NAMES}"
diff --git a/scripts/kernel-floor.limits b/scripts/kernel-floor.limits
index 1f0f75d53e..96c7071c52 100644
--- a/scripts/kernel-floor.limits
+++ b/scripts/kernel-floor.limits
@@ -13,6 +13,12 @@
# Simulate with: scripts/dep-sim.py --cut <crates>
#
# History
+# 328/307/3 2026-10-07 Ratchet only: origin/main already resolves 328
+# packages / 307 names (measured on main's own manifests
+# and lockfile), below the 332/311 limit, so every Rust PR
+# failed "IMPROVED but was not ratcheted". #7034 adds
+# nothing to this profile: memory's office parsers sit
+# behind the `documents` feature.
# 337/316/3 2026-10-04 Merge upstream/main file-intake and module updates.
# The merged flows profile measures 337 packages / 316
# names / 3 native builds (including libdeflate-sys).
@@ -650,4 +656,4 @@
# into the required host runtime. The migration adds five
# resolved packages and four unique crate names; it does
# not add a native build dependency.
-flows:332:311:3
+flows:328:307:3