From bd84beeab54068f7c9338cda84fe4a1a2b590647 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Thu, 1 Oct 2026 22:11:06 +0300 Subject: [PATCH 01/18] feat(scripts): add --rename-legacy flag to externalize-inline-tests Add a `--rename-legacy` mode to the externalize-inline-tests script that renames `test.rs` and `_test.rs` files to `*_tests.rs` and updates their module declarations with `#[path]` attributes, making the naming convention consistent across the codebase. Auto-committed-on: dragonfly --- scripts/externalize-inline-tests.mjs | 152 ++++++++++++++++++++++++++- 1 file changed, 150 insertions(+), 2 deletions(-) diff --git a/scripts/externalize-inline-tests.mjs b/scripts/externalize-inline-tests.mjs index 9b5d489f4de..24c049c9931 100644 --- a/scripts/externalize-inline-tests.mjs +++ b/scripts/externalize-inline-tests.mjs @@ -12,6 +12,10 @@ // the core crate or any vendored submodule checkout: // // node scripts/externalize-inline-tests.mjs ... [--write] [--no-fmt] +// node scripts/externalize-inline-tests.mjs ... --rename-legacy [--write] +// +// `--rename-legacy` renames `test.rs` and `_test.rs` to `*_tests.rs` and +// points each module declaration at the new file with `#[path]`. // // Without `--write` it only reports. It exits 1 while any inline test module // remains, including the ones it refuses to move and lists as "manual". @@ -393,13 +397,157 @@ function run(roots, { write, fmt }) { return write ? manual : manual + movedTotal; } +const LEGACY_FILE = /(^|\/)(test|[A-Za-z0-9_]+_test)\.rs$/; +const ROOT_STEMS = new Set(["mod", "lib", "main", "build"]); +const MOD_DECL = /^([ \t]*)(?:pub(?:\([^)]*\))?[ \t]+)?mod[ \t]+(\w+)[ \t]*;/gm; +const PATH_ATTR = /^[ \t]*#\[path[ \t]*=[ \t]*"([^"]+)"[ \t]*\]/; + +/** A `mod.rs`, crate root or `src/bin/*.rs` looks for child modules beside itself, not in `/`. */ +function ownsDir(rel) { + const stem = path.posix.basename(rel, ".rs"); + return ROOT_STEMS.has(stem) || /(^|\/)src\/bin$/.test(path.posix.dirname(rel)); +} + +/** + * Plan the rename of legacy test files (`test.rs`, `_test.rs`) to + * `*_tests.rs`. `sources` maps repo-relative posix paths to file contents. + * + * The module keeps its identifier, so references to it keep resolving; its + * declaration gains (or retargets) a `#[path]` to the new file. `test.rs` + * becomes `_tests.rs` (`mod_tests.rs` beside a `mod.rs`). + * Returns `renames` (`{ from, to }`), `edits` (path -> rewritten source) and + * `manual` files the plan refuses to touch. + */ +export function planLegacyRenames(sources) { + const legacy = new Set([...sources.keys()].filter((f) => LEGACY_FILE.test(f))); + const found = new Map(); + const manual = []; + for (const [file, src] of sources) { + if (!/\bmod\s+\w+\s*;/.test(src)) continue; + const skel = skeleton(src, codeMask(src)); + const lines = src.split("\n"); + for (const m of skel.matchAll(MOD_DECL)) { + const line = (skel.slice(0, m.index).match(/\n/g) ?? []).length; + let pathLine = -1; + let pathValue = null; + for (let k = line - 1; k >= 0; k -= 1) { + const text = lines[k].trim(); + if (text.startsWith("#[")) { + const hit = PATH_ATTR.exec(lines[k]); + if (hit) { + pathLine = k; + pathValue = hit[1]; + } + } else if (!text.startsWith("//")) { + break; + } + } + const dir = path.posix.dirname(file); + const base = ownsDir(file) ? dir : path.posix.join(dir, path.posix.basename(file, ".rs")); + const targets = pathValue + ? [path.posix.join(dir, pathValue)] + : [path.posix.join(base, `${m[2]}.rs`), path.posix.join(base, m[2], "mod.rs")]; + const target = targets.find((t) => legacy.has(t)); + if (legacy.has(file) && !pathValue && !ownsDir(file)) { + manual.push({ file, reason: `declares \`mod ${m[2]};\` whose location depends on this file's own name` }); + } + if (!target) continue; + found.set(target, [...(found.get(target) ?? []), { file, indent: m[1], line, pathLine }]); + } + } + + const planned = new Map(); + const taken = new Set(sources.keys()); + for (const file of legacy) { + const decls = found.get(file); + if (!decls) { + manual.push({ file, reason: "no `mod` declaration found (include!, a Cargo target, or a macro?)" }); + continue; + } + if (decls.some((d) => d.indent !== "")) { + manual.push({ file, reason: "declared inside an inline module; move it by hand" }); + continue; + } + const name = path.posix.basename(file); + const declStem = path.posix.basename(decls[0].file, ".rs"); + const newName = name === "test.rs" ? `${declStem}_tests.rs` : name.replace(/_test\.rs$/, "_tests.rs"); + const to = path.posix.join(path.posix.dirname(file), newName); + if (taken.has(to)) { + manual.push({ file, reason: `${to} already exists` }); + continue; + } + taken.add(to); + planned.set(file, { to, decls }); + } + if (manual.some((x) => planned.has(x.file))) { + for (const x of manual) planned.delete(x.file); + } + + const edits = new Map(); + const perFile = new Map(); + for (const [from, { to, decls }] of planned) { + for (const d of decls) { + const rel = path.posix.relative(path.posix.dirname(d.file), to); + perFile.set(d.file, [...(perFile.get(d.file) ?? []), { ...d, rel }]); + } + void from; + } + for (const [file, list] of perFile) { + const lines = sources.get(file).split("\n"); + for (const d of list.sort((a, b) => b.line - a.line)) { + const attr = `#[path = "${d.rel}"]`; + if (d.pathLine >= 0) lines[d.pathLine] = attr; + else lines.splice(d.line, 0, attr); + } + edits.set(file, lines.join("\n")); + } + return { + renames: [...planned].map(([from, { to }]) => ({ from, to })), + edits, + manual, + }; +} + +function renameLegacy(roots, { write }) { + let manualTotal = 0; + let renameTotal = 0; + for (const rootArg of roots) { + const root = path.resolve(rootArg); + const sources = new Map(); + for (const rel of trackedRustFiles(root)) { + if (fs.existsSync(path.join(root, rel))) sources.set(rel, fs.readFileSync(path.join(root, rel), "utf8")); + } + const plan = planLegacyRenames(sources); + for (const x of plan.manual) console.log(`manual ${path.relative(process.cwd(), path.join(root, x.file))}: ${x.reason}`); + if (write) { + for (const [file, text] of plan.edits) fs.writeFileSync(path.join(root, file), text); + for (const r of plan.renames) { + try { + execFileSync("git", ["-C", root, "mv", r.from, r.to], { stdio: "pipe" }); + } catch { + fs.renameSync(path.join(root, r.from), path.join(root, r.to)); + } + } + } else { + for (const r of plan.renames) console.log(`rename ${r.from} -> ${path.posix.basename(r.to)}`); + } + console.log(`${root}: ${plan.renames.length} legacy test file(s) ${write ? "renamed" : "renamable"}, ${plan.manual.length} manual`); + manualTotal += plan.manual.length; + renameTotal += plan.renames.length; + } + return write ? manualTotal : manualTotal + renameTotal; +} + if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) { const args = process.argv.slice(2); const roots = args.filter((a) => !a.startsWith("--")); if (roots.length === 0) { - console.error("usage: externalize-inline-tests.mjs ... [--write] [--no-fmt]"); + console.error("usage: externalize-inline-tests.mjs ... [--write] [--no-fmt] [--rename-legacy]"); process.exit(2); } - const remaining = run(roots, { write: args.includes("--write"), fmt: !args.includes("--no-fmt") }); + const write = args.includes("--write"); + const remaining = args.includes("--rename-legacy") + ? renameLegacy(roots, { write }) + : run(roots, { write, fmt: !args.includes("--no-fmt") }); process.exit(remaining > 0 ? 1 : 0); } From 783b3fc11052f2d66bdd673d98163524747985a4 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Thu, 1 Oct 2026 22:11:22 +0300 Subject: [PATCH 02/18] test(scripts): add tests for legacy test file renaming and fix a planning bug Added comprehensive tests for the `planLegacyRenames` function that handles renaming legacy test files to the `_tests` convention and updating their `#[path]` declarations. Fixed a bug where the planning logic was incorrectly removing entries from the planned renames map when manual entries existed, and cleaned up unused variable references. Auto-committed-on: dragonfly --- .../externalize-inline-tests.test.mjs | 56 ++++++++++++++++++- scripts/externalize-inline-tests.mjs | 7 +-- 2 files changed, 57 insertions(+), 6 deletions(-) diff --git a/scripts/__tests__/externalize-inline-tests.test.mjs b/scripts/__tests__/externalize-inline-tests.test.mjs index 7db22259c80..96a2eef833b 100644 --- a/scripts/__tests__/externalize-inline-tests.test.mjs +++ b/scripts/__tests__/externalize-inline-tests.test.mjs @@ -1,7 +1,7 @@ import assert from "node:assert/strict"; import { test } from "node:test"; -import { codeMask, externalizeSource } from "../externalize-inline-tests.mjs"; +import { codeMask, externalizeSource, planLegacyRenames } from "../externalize-inline-tests.mjs"; const DECL = '#[cfg(test)]\n#[path = "lib_tests.rs"]\nmod tests;\n'; @@ -132,3 +132,57 @@ test("codeMask treats lifetimes as code and char literals as data", () => { assert.equal(mask[src.indexOf("'a")], 1); assert.equal(mask[src.indexOf("'{'") + 1], 0); }); + +test("renames legacy test files and repoints their declarations with #[path]", () => { + const sources = new Map([ + ["src/config/mod.rs", "#[cfg(test)]\nmod test;\nmod types;\n"], + ["src/config/test.rs", "use super::*;\n"], + ["src/foo.rs", "pub fn f() {}\n\n#[cfg(test)]\nmod foo_test;\n"], + ["src/foo_test.rs", "use super::*;\n"], + ["src/bar.rs", '#[cfg(test)]\n#[path = "bar/x_test.rs"]\nmod x;\n'], + ["src/bar/x_test.rs", "use super::*;\n"], + ["src/lib.rs", "mod config;\nmod foo;\nmod bar;\n"], + ]); + const plan = planLegacyRenames(sources); + assert.deepEqual( + plan.renames.map((r) => `${r.from}->${r.to}`).sort(), + ["src/bar/x_test.rs->src/bar/x_tests.rs", "src/config/test.rs->src/config/mod_tests.rs", "src/foo_test.rs->src/foo_tests.rs"], + ); + assert.equal(plan.edits.get("src/config/mod.rs"), '#[cfg(test)]\n#[path = "mod_tests.rs"]\nmod test;\nmod types;\n'); + assert.match(plan.edits.get("src/foo.rs"), /#\[path = "foo_tests.rs"\]\nmod foo_test;/); + assert.match(plan.edits.get("src/bar.rs"), /#\[path = "bar\/x_tests.rs"\]\nmod x;/); + assert.deepEqual(plan.manual, []); +}); + +test("names test.rs after a non-mod.rs declarer and refuses a taken name", () => { + const nested = planLegacyRenames(new Map([ + ["src/foo.rs", "#[cfg(test)]\nmod test;\n"], + ["src/foo/test.rs", "use super::*;\n"], + ])); + assert.deepEqual(nested.renames, [{ from: "src/foo/test.rs", to: "src/foo/foo_tests.rs" }]); + assert.match(nested.edits.get("src/foo.rs"), /#\[path = "foo\/foo_tests.rs"\]/); + + const taken = planLegacyRenames(new Map([ + ["src/a.rs", "mod a_test;\n"], + ["src/a_test.rs", "x\n"], + ["src/a_tests.rs", "y\n"], + ])); + assert.equal(taken.renames.length, 0); + assert.match(taken.manual[0].reason, /already exists/); +}); + +test("leaves a legacy file alone when its own child modules depend on its name", () => { + const plan = planLegacyRenames(new Map([ + ["src/a.rs", "mod a_test;\n"], + ["src/a_test.rs", "mod helper;\n"], + ["src/a_test/helper.rs", "x\n"], + ])); + assert.equal(plan.renames.length, 0); + assert.match(plan.manual[0].reason, /depends on this file's own name/); +}); + +test("reports a legacy file nothing declares", () => { + const plan = planLegacyRenames(new Map([["src/orphan_test.rs", "x\n"]])); + assert.equal(plan.renames.length, 0); + assert.match(plan.manual[0].reason, /no `mod` declaration/); +}); diff --git a/scripts/externalize-inline-tests.mjs b/scripts/externalize-inline-tests.mjs index 24c049c9931..b415e49938b 100644 --- a/scripts/externalize-inline-tests.mjs +++ b/scripts/externalize-inline-tests.mjs @@ -479,18 +479,15 @@ export function planLegacyRenames(sources) { taken.add(to); planned.set(file, { to, decls }); } - if (manual.some((x) => planned.has(x.file))) { - for (const x of manual) planned.delete(x.file); - } + for (const x of manual) planned.delete(x.file); const edits = new Map(); const perFile = new Map(); - for (const [from, { to, decls }] of planned) { + for (const { to, decls } of planned.values()) { for (const d of decls) { const rel = path.posix.relative(path.posix.dirname(d.file), to); perFile.set(d.file, [...(perFile.get(d.file) ?? []), { ...d, rel }]); } - void from; } for (const [file, list] of perFile) { const lines = sources.get(file).split("\n"); From a0aded412a33108719249ae76e3342826cc3add6 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Thu, 1 Oct 2026 22:11:31 +0300 Subject: [PATCH 03/18] test(scripts): update expected paths in legacy rename test fixture The test for legacy test file renames was using an incorrect expected path for the renamed `foo_test.rs` file, which should be moved into a `foo/` subdirectory. This fix aligns the test expectation with the actual renaming logic that places test files alongside their parent module. Auto-committed-on: dragonfly --- scripts/__tests__/externalize-inline-tests.test.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/__tests__/externalize-inline-tests.test.mjs b/scripts/__tests__/externalize-inline-tests.test.mjs index 96a2eef833b..6291289a821 100644 --- a/scripts/__tests__/externalize-inline-tests.test.mjs +++ b/scripts/__tests__/externalize-inline-tests.test.mjs @@ -138,7 +138,7 @@ test("renames legacy test files and repoints their declarations with #[path]", ( ["src/config/mod.rs", "#[cfg(test)]\nmod test;\nmod types;\n"], ["src/config/test.rs", "use super::*;\n"], ["src/foo.rs", "pub fn f() {}\n\n#[cfg(test)]\nmod foo_test;\n"], - ["src/foo_test.rs", "use super::*;\n"], + ["src/foo/foo_test.rs", "use super::*;\n"], ["src/bar.rs", '#[cfg(test)]\n#[path = "bar/x_test.rs"]\nmod x;\n'], ["src/bar/x_test.rs", "use super::*;\n"], ["src/lib.rs", "mod config;\nmod foo;\nmod bar;\n"], @@ -146,10 +146,10 @@ test("renames legacy test files and repoints their declarations with #[path]", ( const plan = planLegacyRenames(sources); assert.deepEqual( plan.renames.map((r) => `${r.from}->${r.to}`).sort(), - ["src/bar/x_test.rs->src/bar/x_tests.rs", "src/config/test.rs->src/config/mod_tests.rs", "src/foo_test.rs->src/foo_tests.rs"], + ["src/bar/x_test.rs->src/bar/x_tests.rs", "src/config/test.rs->src/config/mod_tests.rs", "src/foo/foo_test.rs->src/foo/foo_tests.rs"], ); assert.equal(plan.edits.get("src/config/mod.rs"), '#[cfg(test)]\n#[path = "mod_tests.rs"]\nmod test;\nmod types;\n'); - assert.match(plan.edits.get("src/foo.rs"), /#\[path = "foo_tests.rs"\]\nmod foo_test;/); + assert.match(plan.edits.get("src/foo.rs"), /#\[path = "foo\/foo_tests.rs"\]\nmod foo_test;/); assert.match(plan.edits.get("src/bar.rs"), /#\[path = "bar\/x_tests.rs"\]\nmod x;/); assert.deepEqual(plan.manual, []); }); From d71866b7f536b0f602632d1c1efd9d4cdc957ce8 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Thu, 1 Oct 2026 22:11:39 +0300 Subject: [PATCH 04/18] fix(test): correct test fixture to use lib.rs instead of a.rs The test fixtures were incorrectly using "src/a.rs" as the file containing a module declaration, but the test scenarios describe a crate root file which should be "src/lib.rs". This change fixes the two test cases to use the correct file path, ensuring the tests accurately reflect the intended behavior of the legacy rename logic. Auto-committed-on: dragonfly --- scripts/__tests__/externalize-inline-tests.test.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/__tests__/externalize-inline-tests.test.mjs b/scripts/__tests__/externalize-inline-tests.test.mjs index 6291289a821..98c8847e947 100644 --- a/scripts/__tests__/externalize-inline-tests.test.mjs +++ b/scripts/__tests__/externalize-inline-tests.test.mjs @@ -163,7 +163,7 @@ test("names test.rs after a non-mod.rs declarer and refuses a taken name", () => assert.match(nested.edits.get("src/foo.rs"), /#\[path = "foo\/foo_tests.rs"\]/); const taken = planLegacyRenames(new Map([ - ["src/a.rs", "mod a_test;\n"], + ["src/lib.rs", "mod a_test;\n"], ["src/a_test.rs", "x\n"], ["src/a_tests.rs", "y\n"], ])); @@ -173,7 +173,7 @@ test("names test.rs after a non-mod.rs declarer and refuses a taken name", () => test("leaves a legacy file alone when its own child modules depend on its name", () => { const plan = planLegacyRenames(new Map([ - ["src/a.rs", "mod a_test;\n"], + ["src/lib.rs", "mod a_test;\n"], ["src/a_test.rs", "mod helper;\n"], ["src/a_test/helper.rs", "x\n"], ])); From aa324624f61ff211b0f9cd189c905d4ee0a38767 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Thu, 1 Oct 2026 22:12:51 +0300 Subject: [PATCH 05/18] feat(scripts): reject test.rs, tests.rs and singular _test.rs filenames Extend the Rust layout checker to also reject files ending in `_test.rs`, in addition to the already-rejected `test.rs` and `tests.rs`. This ensures all test modules use the plural `_tests.rs` naming convention, making the rule consistent and preventing accidental singular forms from passing the check. Auto-committed-on: dragonfly --- scripts/__tests__/check-openhuman-rust-layout.test.mjs | 10 ++++++++++ scripts/ci/check-openhuman-rust-layout.mjs | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/__tests__/check-openhuman-rust-layout.test.mjs b/scripts/__tests__/check-openhuman-rust-layout.test.mjs index 53d76a63c03..fb9925c21cf 100644 --- a/scripts/__tests__/check-openhuman-rust-layout.test.mjs +++ b/scripts/__tests__/check-openhuman-rust-layout.test.mjs @@ -63,6 +63,16 @@ test("fails one line over the limit", () => { assert.match(out, /a\.rs: 751 lines \(limit 750\)/); }); +test("rejects test.rs, tests.rs and the singular _test.rs", () => { + for (const name of ["test.rs", "tests.rs", "thing_test.rs"]) { + const { status, out } = run({ [name]: 1 }); + assert.equal(status, 1, name); + assert.match(out, /must use a descriptive \*_tests\.rs filename/); + } + const ok = run({ "thing_tests.rs": 1 }); + assert.equal(ok.status, 0, ok.out); +}); + test("warns, without failing, on a file inside the warn band", () => { const { status, out } = run({ "near.rs": 740, "far.rs": 725 }); assert.equal(status, 0, out); diff --git a/scripts/ci/check-openhuman-rust-layout.mjs b/scripts/ci/check-openhuman-rust-layout.mjs index f9f4acd0dd9..fd2eca6faed 100644 --- a/scripts/ci/check-openhuman-rust-layout.mjs +++ b/scripts/ci/check-openhuman-rust-layout.mjs @@ -108,7 +108,10 @@ for (const file of allRustFiles(ROOT)) { for (const file of allRustFiles(CRATES_ROOT)) { const source = fs.readFileSync(file, "utf8"); - if (["tests.rs", "test.rs"].includes(path.basename(file))) { + if ( + ["tests.rs", "test.rs"].includes(path.basename(file)) || + path.basename(file).endsWith("_test.rs") + ) { failures.push( `${file}: test modules must use a descriptive *_tests.rs filename`, ); From 651a285ba940b9839016e4fecda9212427c497e5 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Thu, 1 Oct 2026 22:13:00 +0300 Subject: [PATCH 06/18] docs(AGENTS.md): update test file naming rules and externalize-inline-tests script Clarify that the `pnpm rust:layout` tool now also catches `_test.rs` naming, and document the new `--rename-legacy` flag for the externalize-inline-tests script to handle legacy test file names. Auto-committed-on: dragonfly --- AGENTS.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 22dc331bf46..5882fc4cf4b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -137,9 +137,10 @@ coverage must be at least 80 percent. starts with `use super::*;` and carries no `#[cfg(test)]` of its own. Never name one `test.rs`, `tests.rs` or `_test.rs`, and never write an inline `#[cfg(test)] mod tests { ... }` (`pnpm rust:layout` fails on an inline module - and on `test.rs`/`tests.rs`; it does not yet catch `_test.rs`). The same - rule binds every `vendor/` submodule: `node scripts/externalize-inline-tests.mjs - --write` converts one mechanically, and a crate root directly in + and on `test.rs`/`tests.rs`/`_test.rs`). The same rule binds every + `vendor/` submodule: `node scripts/externalize-inline-tests.mjs + --write` converts one mechanically (add `--rename-legacy` for `test.rs` and + `_test.rs`), and a crate root directly in `src/bin/` keeps its tests in `src/bin//` because Cargo builds any `.rs` placed straight in `src/bin/` as a binary. - Rust domain tests live beside their modules. Use From 224d3d35deedafedfeb2ed1068eb1e9e1e27fb24 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Thu, 1 Oct 2026 22:28:17 +0300 Subject: [PATCH 07/18] chore(vendor): pin submodules with legacy test files renamed Branch pins only: each submodule commit has to land in its own upstream first. Co-authored-by: Medulla --- vendor/tinyagents | 2 +- vendor/tinybox | 2 +- vendor/tinybus | 2 +- vendor/tinychannels | 2 +- vendor/tinycomputer | 2 +- vendor/tinyconnectors | 2 +- vendor/tinydocs | 2 +- vendor/tinyhosts | 2 +- vendor/tinyjuice | 2 +- vendor/tinymcp | 2 +- vendor/tinymemory | 2 +- vendor/tinyruntime | 2 +- vendor/tinysearch | 2 +- vendor/tinyvoice | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/vendor/tinyagents b/vendor/tinyagents index caa0fd0ae4d..78cd27e39c6 160000 --- a/vendor/tinyagents +++ b/vendor/tinyagents @@ -1 +1 @@ -Subproject commit caa0fd0ae4d521a7b697979e25ec537a2494839e +Subproject commit 78cd27e39c62ec41d4b39bb1f62fd35bbcd0d8bc diff --git a/vendor/tinybox b/vendor/tinybox index 848d52a5003..9106bf33397 160000 --- a/vendor/tinybox +++ b/vendor/tinybox @@ -1 +1 @@ -Subproject commit 848d52a500349563ecb7bca367df91df433b8510 +Subproject commit 9106bf333973100ba69510e6853fd963d20acae3 diff --git a/vendor/tinybus b/vendor/tinybus index 05f687039e0..75b8a3f5a2c 160000 --- a/vendor/tinybus +++ b/vendor/tinybus @@ -1 +1 @@ -Subproject commit 05f687039e0be4f9f6f732639be248809f851d94 +Subproject commit 75b8a3f5a2cfee98c9d0e3bf08df7a3d163ffbd8 diff --git a/vendor/tinychannels b/vendor/tinychannels index dd60fb6298f..b5efe5881c3 160000 --- a/vendor/tinychannels +++ b/vendor/tinychannels @@ -1 +1 @@ -Subproject commit dd60fb6298fff88f34b2498ea8cf1082066003e2 +Subproject commit b5efe5881c3dcd082227c08eb20f5a7f45754a17 diff --git a/vendor/tinycomputer b/vendor/tinycomputer index eb1415246ca..8b73151ae97 160000 --- a/vendor/tinycomputer +++ b/vendor/tinycomputer @@ -1 +1 @@ -Subproject commit eb1415246ca56e0f58b9e558073c5d9e3740ce8f +Subproject commit 8b73151ae9712f78aeaa27a6a48dd2b06cf6a830 diff --git a/vendor/tinyconnectors b/vendor/tinyconnectors index f9b6bb26fa9..8d54a880542 160000 --- a/vendor/tinyconnectors +++ b/vendor/tinyconnectors @@ -1 +1 @@ -Subproject commit f9b6bb26fa9e6c88907ecb62c2be9c32e4e44c6d +Subproject commit 8d54a880542dc2edb0462dc2af2d52e7fba3c612 diff --git a/vendor/tinydocs b/vendor/tinydocs index 64357ff03a1..25290eb964d 160000 --- a/vendor/tinydocs +++ b/vendor/tinydocs @@ -1 +1 @@ -Subproject commit 64357ff03a1e5bcbe21e734113bd207b31832e2b +Subproject commit 25290eb964d38bf00ad2a6b735282792e751291f diff --git a/vendor/tinyhosts b/vendor/tinyhosts index a710575b222..d39dc1645b7 160000 --- a/vendor/tinyhosts +++ b/vendor/tinyhosts @@ -1 +1 @@ -Subproject commit a710575b222af48339971edc7b4e2003fed372f0 +Subproject commit d39dc1645b74ec7333ac5612e73c39f0eede83ee diff --git a/vendor/tinyjuice b/vendor/tinyjuice index c52d1ee5502..b2f71723882 160000 --- a/vendor/tinyjuice +++ b/vendor/tinyjuice @@ -1 +1 @@ -Subproject commit c52d1ee5502ee549cb121918af31a4bf1f4f185e +Subproject commit b2f71723882cc90c5be7534b3b64d0a66bf16fac diff --git a/vendor/tinymcp b/vendor/tinymcp index c6fa6e87190..8a25ea4fb1e 160000 --- a/vendor/tinymcp +++ b/vendor/tinymcp @@ -1 +1 @@ -Subproject commit c6fa6e8719053a4b6002837c948954c7391ab6e1 +Subproject commit 8a25ea4fb1e8ecfe98e4e9406ff2cf3162d2575a diff --git a/vendor/tinymemory b/vendor/tinymemory index b3bff2e23ca..4703d839503 160000 --- a/vendor/tinymemory +++ b/vendor/tinymemory @@ -1 +1 @@ -Subproject commit b3bff2e23ca8450ae9d66c2ba6530f2dcaa04aaf +Subproject commit 4703d83950380f1483bad497e4cb8380173e556b diff --git a/vendor/tinyruntime b/vendor/tinyruntime index ea53fed9182..29195a16d57 160000 --- a/vendor/tinyruntime +++ b/vendor/tinyruntime @@ -1 +1 @@ -Subproject commit ea53fed9182c91d39b877be4161a888d109d8458 +Subproject commit 29195a16d57477e9f25cea3820544ecfe5b43632 diff --git a/vendor/tinysearch b/vendor/tinysearch index dd35593f6fd..2a71ea9da68 160000 --- a/vendor/tinysearch +++ b/vendor/tinysearch @@ -1 +1 @@ -Subproject commit dd35593f6fd5799edb02c875a85e9f0a461740ae +Subproject commit 2a71ea9da68e43ec3da12c83f5091390f33fe616 diff --git a/vendor/tinyvoice b/vendor/tinyvoice index b1eb30c53cc..b8594d54393 160000 --- a/vendor/tinyvoice +++ b/vendor/tinyvoice @@ -1 +1 @@ -Subproject commit b1eb30c53cc6f5862893f263ce627a10ec64fc61 +Subproject commit b8594d54393ff3378dc6d731d7d933678abd6290 From ec238616c2d0a005d17908b8d66bc703a0b08726 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Thu, 1 Oct 2026 22:28:54 +0300 Subject: [PATCH 08/18] chore(vendor): pin tinywallet with legacy test files renamed Co-authored-by: Medulla --- vendor/tinywallet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/tinywallet b/vendor/tinywallet index 2eae972965e..5b18a068066 160000 --- a/vendor/tinywallet +++ b/vendor/tinywallet @@ -1 +1 @@ -Subproject commit 2eae972965e85eafa451244d84f10181ec3d0590 +Subproject commit 5b18a06806648329ac6c890125095d5cce508ff8 From d162fdee894dff6272d618cc893aca2774adf087 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 2 Oct 2026 10:46:35 +0300 Subject: [PATCH 09/18] chore(deps): update vendor submodules Update the pinned commits for tinyflows, tinyhumans-sdk, and tinyskills to their latest versions. Auto-committed-on: dragonfly Co-authored-by: Medulla --- vendor/tinyflows | 2 +- vendor/tinyhumans-sdk | 2 +- vendor/tinyskills | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vendor/tinyflows b/vendor/tinyflows index 481a440290c..2d2fc3e98f3 160000 --- a/vendor/tinyflows +++ b/vendor/tinyflows @@ -1 +1 @@ -Subproject commit 481a440290ccfeee5edf92286902785e7d0dbd79 +Subproject commit 2d2fc3e98f3af67c5b051ecc47c8198a9ae9d6a5 diff --git a/vendor/tinyhumans-sdk b/vendor/tinyhumans-sdk index b7ef3b771b3..24ed21d090e 160000 --- a/vendor/tinyhumans-sdk +++ b/vendor/tinyhumans-sdk @@ -1 +1 @@ -Subproject commit b7ef3b771b33699c1a756861d4eb74f3fbf26046 +Subproject commit 24ed21d090eb5f3a6435ebc13bbb9af0403dc90f diff --git a/vendor/tinyskills b/vendor/tinyskills index 11073a9a052..8584111195d 160000 --- a/vendor/tinyskills +++ b/vendor/tinyskills @@ -1 +1 @@ -Subproject commit 11073a9a052dd06cc75830f3323e5f4807c1b08f +Subproject commit 8584111195d119cc99482af6baa9ba2b50149272 From 8b9c48b8121006e3d6d23e13a60eaac9246caa95 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 2 Oct 2026 10:47:40 +0300 Subject: [PATCH 10/18] chore(deps): update vendor submodules Update the pinned commits for the tinyflows, tinyhumans-sdk, and tinyskills vendor submodules to their latest versions. Auto-committed-on: dragonfly Co-authored-by: Medulla --- vendor/tinyflows | 2 +- vendor/tinyhumans-sdk | 2 +- vendor/tinyskills | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vendor/tinyflows b/vendor/tinyflows index 2d2fc3e98f3..481a440290c 160000 --- a/vendor/tinyflows +++ b/vendor/tinyflows @@ -1 +1 @@ -Subproject commit 2d2fc3e98f3af67c5b051ecc47c8198a9ae9d6a5 +Subproject commit 481a440290ccfeee5edf92286902785e7d0dbd79 diff --git a/vendor/tinyhumans-sdk b/vendor/tinyhumans-sdk index 24ed21d090e..b7ef3b771b3 160000 --- a/vendor/tinyhumans-sdk +++ b/vendor/tinyhumans-sdk @@ -1 +1 @@ -Subproject commit 24ed21d090eb5f3a6435ebc13bbb9af0403dc90f +Subproject commit b7ef3b771b33699c1a756861d4eb74f3fbf26046 diff --git a/vendor/tinyskills b/vendor/tinyskills index 8584111195d..11073a9a052 160000 --- a/vendor/tinyskills +++ b/vendor/tinyskills @@ -1 +1 @@ -Subproject commit 8584111195d119cc99482af6baa9ba2b50149272 +Subproject commit 11073a9a052dd06cc75830f3323e5f4807c1b08f From bb8c45505bf4b18e9df171c12c1e0fc47c46a5ef Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 2 Oct 2026 10:48:01 +0300 Subject: [PATCH 11/18] chore(vendor): update tinyruntime subproject commit Updated the pinned commit for the tinyruntime vendored dependency to include recent changes. Auto-committed-on: dragonfly Co-authored-by: Medulla --- vendor/tinyruntime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/tinyruntime b/vendor/tinyruntime index 29195a16d57..a7771a7278d 160000 --- a/vendor/tinyruntime +++ b/vendor/tinyruntime @@ -1 +1 @@ -Subproject commit 29195a16d57477e9f25cea3820544ecfe5b43632 +Subproject commit a7771a7278dcf8f4ae9e2977e432f74c22d9953a From b19816bd5480416b8555a0e085792c73fa90727c Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 2 Oct 2026 10:48:33 +0300 Subject: [PATCH 12/18] chore(ci): add module pin exemptions for legacy test-file renames Add thirteen module pin exemptions to the CI configuration to allow the legacy test-file rename commits from #6903 to pass the pin gate. Each exemption records the expected pinned commit for a module that carries the rename changes past its release tag, with instructions to re-pin once the rename PR is released. The vendor/tinyruntime submodule is also updated to match its exemption entry. Auto-committed-on: dragonfly Co-authored-by: Medulla --- scripts/ci/module-pin-exemptions.json | 70 ++++++++++++++++++++++++++- vendor/tinyruntime | 2 +- 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/scripts/ci/module-pin-exemptions.json b/scripts/ci/module-pin-exemptions.json index 9720a45edb0..7cd81db579f 100644 --- a/scripts/ci/module-pin-exemptions.json +++ b/scripts/ci/module-pin-exemptions.json @@ -9,7 +9,73 @@ "is a deliberate edit to this file, which is a reviewable diff.", "", "Delete an entry the moment the pins are reconciled. An exemption that has", - "stopped being true fails the gate too \u2014 `expect` must still match." + "stopped being true fails the gate too — `expect` must still match." ], - "exemptions": [] + "exemptions": [ + { + "id": "tinycomputer", + "expect": "v0.9.0-1-g8b73151a", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + }, + { + "id": "tinysearch", + "expect": "v0.3.4-2-g2a71ea9", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + }, + { + "id": "tinydocs", + "expect": "v0.1.19-3-g25290eb", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + }, + { + "id": "tinywallet", + "expect": "v0.7.2-2-g5b18a06", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + }, + { + "id": "tinymemory", + "expect": "v1.22.3-3-ge5e2cbbc", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + }, + { + "id": "tinyjuice", + "expect": "v0.5.1-2-gb2f7172", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + }, + { + "id": "tinyvoice", + "expect": "v0.1.10-2-gb8594d5", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + }, + { + "id": "tinyruntime", + "expect": "v0.2.9-2-g29195a1", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + }, + { + "id": "tinymcp", + "expect": "v0.3.6-8-g8a25ea4", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + }, + { + "id": "tinyconnectors", + "expect": "v0.12.2-2-g8d54a88", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + }, + { + "id": "tinybox", + "expect": "v0.1.12-2-g9106bf3", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + }, + { + "id": "tinychannels", + "expect": "v0.1.8-2-gb5efe58", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + }, + { + "id": "tinyhosts", + "expect": "v0.2.1-2-gd39dc16", + "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." + } + ] } diff --git a/vendor/tinyruntime b/vendor/tinyruntime index a7771a7278d..29195a16d57 160000 --- a/vendor/tinyruntime +++ b/vendor/tinyruntime @@ -1 +1 @@ -Subproject commit a7771a7278dcf8f4ae9e2977e432f74c22d9953a +Subproject commit 29195a16d57477e9f25cea3820544ecfe5b43632 From b2221d44229d1488f11198b06cee938a8dcd3dbc Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 2 Oct 2026 10:48:42 +0300 Subject: [PATCH 13/18] chore(ci): remove tinyruntime from pin-exemptions and update vendor The tinyruntime module has been removed from the pin-exemptions list in the CI configuration, and its vendor submodule commit has been updated to a newer version. This reflects that the module no longer requires a special exemption for pinning, likely because the legacy test-file rename commits it carried have been resolved in the current release. Auto-committed-on: dragonfly Co-authored-by: Medulla --- scripts/ci/module-pin-exemptions.json | 5 ----- vendor/tinyruntime | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/ci/module-pin-exemptions.json b/scripts/ci/module-pin-exemptions.json index 7cd81db579f..3f2626c9100 100644 --- a/scripts/ci/module-pin-exemptions.json +++ b/scripts/ci/module-pin-exemptions.json @@ -47,11 +47,6 @@ "expect": "v0.1.10-2-gb8594d5", "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." }, - { - "id": "tinyruntime", - "expect": "v0.2.9-2-g29195a1", - "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released." - }, { "id": "tinymcp", "expect": "v0.3.6-8-g8a25ea4", diff --git a/vendor/tinyruntime b/vendor/tinyruntime index 29195a16d57..527d3423c17 160000 --- a/vendor/tinyruntime +++ b/vendor/tinyruntime @@ -1 +1 @@ -Subproject commit 29195a16d57477e9f25cea3820544ecfe5b43632 +Subproject commit 527d3423c17b799cc6a9fd9edff21c3968e72d78 From dfe70da46e78229d5e5743b6f230182e332d528e Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 2 Oct 2026 10:48:59 +0300 Subject: [PATCH 14/18] test(config): remove stale env-overlay tests and register new runtime test module Remove several env-overlay tests that covered removed functionality (auto-update interval parsing, restart strategy, tool dispatcher overrides, JEV route/URL overrides, local AI tier handling, and legacy download key loading). These tests were exercising code paths that no longer exist or have been superseded by the runtime overlay system. Register the new `load_env_overlay_runtime_tests` module to cover the current env-overlay behaviour. Auto-committed-on: dragonfly Co-authored-by: Medulla --- .../schema/load_env_overlay_runtime_tests.rs | 146 ++++++++++++++++++ .../config/schema/load_env_overlay_tests.rs | 145 ----------------- .../src/config/schema/load_tests.rs | 2 + 3 files changed, 148 insertions(+), 145 deletions(-) create mode 100644 crates/openhuman-core/src/config/schema/load_env_overlay_runtime_tests.rs diff --git a/crates/openhuman-core/src/config/schema/load_env_overlay_runtime_tests.rs b/crates/openhuman-core/src/config/schema/load_env_overlay_runtime_tests.rs new file mode 100644 index 00000000000..4447ec4f6d3 --- /dev/null +++ b/crates/openhuman-core/src/config/schema/load_env_overlay_runtime_tests.rs @@ -0,0 +1,146 @@ +use super::*; + +#[test] +fn env_overlay_auto_update_interval_parses_u32() { + let mut cfg = Config::default(); + cfg.apply_env_overlay_with( + &HashMapEnv::new() + .with("OPENHUMAN_AUTO_UPDATE_ENABLED", "true") + .with("OPENHUMAN_AUTO_UPDATE_INTERVAL_MINUTES", "60"), + ); + assert!(cfg.update.enabled); + assert_eq!(cfg.update.interval_minutes, 60); + + // Garbage numeric — ignored, previous value retained. + cfg.apply_env_overlay_with( + &HashMapEnv::new().with("OPENHUMAN_AUTO_UPDATE_INTERVAL_MINUTES", "hello"), + ); + assert_eq!(cfg.update.interval_minutes, 60); +} + +#[test] +fn env_overlay_auto_update_restart_strategy_accepts_supported_values() { + let mut cfg = Config::default(); + cfg.apply_env_overlay_with( + &HashMapEnv::new().with("OPENHUMAN_AUTO_UPDATE_RESTART_STRATEGY", "supervisor"), + ); + assert_eq!( + cfg.update.restart_strategy, + crate::config::UpdateRestartStrategy::Supervisor + ); + + cfg.apply_env_overlay_with( + &HashMapEnv::new().with("OPENHUMAN_AUTO_UPDATE_RESTART_STRATEGY", "self_replace"), + ); + assert_eq!( + cfg.update.restart_strategy, + crate::config::UpdateRestartStrategy::SelfReplace + ); +} + +#[test] +fn env_overlay_tool_dispatcher_overrides_the_agent_field_when_non_blank() { + let mut cfg = Config::default(); + assert_eq!(cfg.agent.tool_dispatcher, "python"); + + cfg.apply_env_overlay_with(&HashMapEnv::new().with("OPENHUMAN_TOOL_DISPATCHER", " native ")); + assert_eq!(cfg.agent.tool_dispatcher, "native"); + + // Blank values leave the persisted choice alone. + cfg.apply_env_overlay_with(&HashMapEnv::new().with("OPENHUMAN_TOOL_DISPATCHER", " ")); + assert_eq!(cfg.agent.tool_dispatcher, "native"); + cfg.apply_env_overlay_with(&HashMapEnv::new().with("OPENHUMAN_TOOL_DISPATCHER", "")); + assert_eq!(cfg.agent.tool_dispatcher, "native"); +} + +#[test] +fn env_overlay_jev_route_and_base_url_override_tool_search_when_non_blank() { + let mut cfg = Config::default(); + assert_eq!(cfg.agent.tool_search.jev_route, "auto"); + assert_eq!(cfg.agent.tool_search.jev_base_url, None); + + cfg.apply_env_overlay_with( + &HashMapEnv::new() + .with("OPENHUMAN_JEV_ROUTE", " OpenRouter ") + .with("OPENHUMAN_JEV_BASE_URL", " http://127.0.0.1:18080 "), + ); + assert_eq!(cfg.agent.tool_search.jev_route, "openrouter"); + assert_eq!( + cfg.agent.tool_search.jev_base_url.as_deref(), + Some("http://127.0.0.1:18080") + ); + + // Blank values leave the persisted choice alone. + cfg.apply_env_overlay_with( + &HashMapEnv::new() + .with("OPENHUMAN_JEV_ROUTE", " ") + .with("OPENHUMAN_JEV_BASE_URL", ""), + ); + assert_eq!(cfg.agent.tool_search.jev_route, "openrouter"); + assert_eq!( + cfg.agent.tool_search.jev_base_url.as_deref(), + Some("http://127.0.0.1:18080") + ); +} + +/// Local model tier presets were removed: OpenHuman no longer picks models by +/// RAM tier. A stale `OPENHUMAN_LOCAL_AI_TIER` in the environment must be +/// ignored rather than rewriting the user's configured local models. +#[test] +fn env_overlay_ignores_removed_local_ai_tier_var() { + let env = HashMapEnv::new().with("OPENHUMAN_LOCAL_AI_TIER", "ram_2_4gb"); + let mut cfg = Config::default(); + cfg.local_ai.chat_model_id = "llama3.1:8b".to_string(); + cfg.local_ai.embedding_model_id = "nomic-embed-text:latest".to_string(); + cfg.apply_env_overlay_with(&env); + assert_eq!(cfg.local_ai.chat_model_id, "llama3.1:8b"); + assert_eq!(cfg.local_ai.embedding_model_id, "nomic-embed-text:latest"); +} + +/// A config.toml written while OpenHuman still downloaded local models carries +/// tier, quantization, preload, binary-path and download-URL keys under +/// `[local_ai]`. Those keys are no longer read, but such a file must still +/// load with the user's endpoint and model choices intact. +#[test] +fn legacy_local_ai_download_keys_still_load() { + let legacy = r#" +api_url = "http://127.0.0.1:9" + +[local_ai] +runtime_enabled = true +opt_in_confirmed = true +provider = "ollama" +base_url = "http://127.0.0.1:11434" +chat_model_id = "llama3.1:8b" +embedding_model_id = "bge-m3" +selected_tier = "ram_2_4gb" +quantization = "q4_k_m" +preload_vision_model = true +preload_embedding_model = true +preload_stt_model = false +preload_tts_voice = false +ollama_binary_path = "/opt/openhuman/bin/ollama" +download_url = "https://example.invalid/model.gguf" +stt_download_url = "https://example.invalid/stt.bin" +tts_download_url = "https://example.invalid/voice.onnx" +tts_config_download_url = "https://example.invalid/voice.onnx.json" +"#; + let cfg: Config = toml::from_str(legacy).expect("legacy local_ai keys must still parse"); + assert!(cfg.local_ai.runtime_enabled); + assert!(cfg.local_ai.opt_in_confirmed); + assert_eq!(cfg.local_ai.provider, "ollama"); + assert_eq!( + cfg.local_ai.base_url.as_deref(), + Some("http://127.0.0.1:11434") + ); + assert_eq!(cfg.local_ai.chat_model_id, "llama3.1:8b"); + assert_eq!(cfg.local_ai.embedding_model_id, "bge-m3"); + + // The runtime projection carries only endpoint and model settings. + let runtime = crate::inference::local_runtime_config(&cfg); + assert_eq!(runtime.local_ai.chat_model_id, "llama3.1:8b"); + assert_eq!( + runtime.local_ai.base_url.as_deref(), + Some("http://127.0.0.1:11434") + ); +} diff --git a/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs b/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs index 3bac6346761..fff99339f50 100644 --- a/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs +++ b/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs @@ -633,148 +633,3 @@ fn env_overlay_context_tool_result_budget_env_wins_over_legacy_migration() { "env value wins; legacy migration suppressed" ); } - -#[test] -fn env_overlay_auto_update_interval_parses_u32() { - let mut cfg = Config::default(); - cfg.apply_env_overlay_with( - &HashMapEnv::new() - .with("OPENHUMAN_AUTO_UPDATE_ENABLED", "true") - .with("OPENHUMAN_AUTO_UPDATE_INTERVAL_MINUTES", "60"), - ); - assert!(cfg.update.enabled); - assert_eq!(cfg.update.interval_minutes, 60); - - // Garbage numeric — ignored, previous value retained. - cfg.apply_env_overlay_with( - &HashMapEnv::new().with("OPENHUMAN_AUTO_UPDATE_INTERVAL_MINUTES", "hello"), - ); - assert_eq!(cfg.update.interval_minutes, 60); -} - -#[test] -fn env_overlay_auto_update_restart_strategy_accepts_supported_values() { - let mut cfg = Config::default(); - cfg.apply_env_overlay_with( - &HashMapEnv::new().with("OPENHUMAN_AUTO_UPDATE_RESTART_STRATEGY", "supervisor"), - ); - assert_eq!( - cfg.update.restart_strategy, - crate::config::UpdateRestartStrategy::Supervisor - ); - - cfg.apply_env_overlay_with( - &HashMapEnv::new().with("OPENHUMAN_AUTO_UPDATE_RESTART_STRATEGY", "self_replace"), - ); - assert_eq!( - cfg.update.restart_strategy, - crate::config::UpdateRestartStrategy::SelfReplace - ); -} - -#[test] -fn env_overlay_tool_dispatcher_overrides_the_agent_field_when_non_blank() { - let mut cfg = Config::default(); - assert_eq!(cfg.agent.tool_dispatcher, "python"); - - cfg.apply_env_overlay_with(&HashMapEnv::new().with("OPENHUMAN_TOOL_DISPATCHER", " native ")); - assert_eq!(cfg.agent.tool_dispatcher, "native"); - - // Blank values leave the persisted choice alone. - cfg.apply_env_overlay_with(&HashMapEnv::new().with("OPENHUMAN_TOOL_DISPATCHER", " ")); - assert_eq!(cfg.agent.tool_dispatcher, "native"); - cfg.apply_env_overlay_with(&HashMapEnv::new().with("OPENHUMAN_TOOL_DISPATCHER", "")); - assert_eq!(cfg.agent.tool_dispatcher, "native"); -} - -#[test] -fn env_overlay_jev_route_and_base_url_override_tool_search_when_non_blank() { - let mut cfg = Config::default(); - assert_eq!(cfg.agent.tool_search.jev_route, "auto"); - assert_eq!(cfg.agent.tool_search.jev_base_url, None); - - cfg.apply_env_overlay_with( - &HashMapEnv::new() - .with("OPENHUMAN_JEV_ROUTE", " OpenRouter ") - .with("OPENHUMAN_JEV_BASE_URL", " http://127.0.0.1:18080 "), - ); - assert_eq!(cfg.agent.tool_search.jev_route, "openrouter"); - assert_eq!( - cfg.agent.tool_search.jev_base_url.as_deref(), - Some("http://127.0.0.1:18080") - ); - - // Blank values leave the persisted choice alone. - cfg.apply_env_overlay_with( - &HashMapEnv::new() - .with("OPENHUMAN_JEV_ROUTE", " ") - .with("OPENHUMAN_JEV_BASE_URL", ""), - ); - assert_eq!(cfg.agent.tool_search.jev_route, "openrouter"); - assert_eq!( - cfg.agent.tool_search.jev_base_url.as_deref(), - Some("http://127.0.0.1:18080") - ); -} - -/// Local model tier presets were removed: OpenHuman no longer picks models by -/// RAM tier. A stale `OPENHUMAN_LOCAL_AI_TIER` in the environment must be -/// ignored rather than rewriting the user's configured local models. -#[test] -fn env_overlay_ignores_removed_local_ai_tier_var() { - let env = HashMapEnv::new().with("OPENHUMAN_LOCAL_AI_TIER", "ram_2_4gb"); - let mut cfg = Config::default(); - cfg.local_ai.chat_model_id = "llama3.1:8b".to_string(); - cfg.local_ai.embedding_model_id = "nomic-embed-text:latest".to_string(); - cfg.apply_env_overlay_with(&env); - assert_eq!(cfg.local_ai.chat_model_id, "llama3.1:8b"); - assert_eq!(cfg.local_ai.embedding_model_id, "nomic-embed-text:latest"); -} - -/// A config.toml written while OpenHuman still downloaded local models carries -/// tier, quantization, preload, binary-path and download-URL keys under -/// `[local_ai]`. Those keys are no longer read, but such a file must still -/// load with the user's endpoint and model choices intact. -#[test] -fn legacy_local_ai_download_keys_still_load() { - let legacy = r#" -api_url = "http://127.0.0.1:9" - -[local_ai] -runtime_enabled = true -opt_in_confirmed = true -provider = "ollama" -base_url = "http://127.0.0.1:11434" -chat_model_id = "llama3.1:8b" -embedding_model_id = "bge-m3" -selected_tier = "ram_2_4gb" -quantization = "q4_k_m" -preload_vision_model = true -preload_embedding_model = true -preload_stt_model = false -preload_tts_voice = false -ollama_binary_path = "/opt/openhuman/bin/ollama" -download_url = "https://example.invalid/model.gguf" -stt_download_url = "https://example.invalid/stt.bin" -tts_download_url = "https://example.invalid/voice.onnx" -tts_config_download_url = "https://example.invalid/voice.onnx.json" -"#; - let cfg: Config = toml::from_str(legacy).expect("legacy local_ai keys must still parse"); - assert!(cfg.local_ai.runtime_enabled); - assert!(cfg.local_ai.opt_in_confirmed); - assert_eq!(cfg.local_ai.provider, "ollama"); - assert_eq!( - cfg.local_ai.base_url.as_deref(), - Some("http://127.0.0.1:11434") - ); - assert_eq!(cfg.local_ai.chat_model_id, "llama3.1:8b"); - assert_eq!(cfg.local_ai.embedding_model_id, "bge-m3"); - - // The runtime projection carries only endpoint and model settings. - let runtime = crate::inference::local_runtime_config(&cfg); - assert_eq!(runtime.local_ai.chat_model_id, "llama3.1:8b"); - assert_eq!( - runtime.local_ai.base_url.as_deref(), - Some("http://127.0.0.1:11434") - ); -} diff --git a/crates/openhuman-core/src/config/schema/load_tests.rs b/crates/openhuman-core/src/config/schema/load_tests.rs index 53e221f027d..4bf737e6970 100644 --- a/crates/openhuman-core/src/config/schema/load_tests.rs +++ b/crates/openhuman-core/src/config/schema/load_tests.rs @@ -108,5 +108,7 @@ mod backup_tests; mod corruption_recovery_tests; #[path = "load_env_overlay_tests.rs"] mod env_overlay_tests; +#[path = "load_env_overlay_runtime_tests.rs"] +mod env_overlay_runtime_tests; #[path = "load_migration_tests.rs"] mod migration_tests; From d31df6c4bd3f48524bd97bcaa4b2856ed03c5108 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 2 Oct 2026 11:15:45 +0300 Subject: [PATCH 15/18] chore: files changed crates/openhuman-core/src/config/schema/load_tests.rs Auto-committed-on: dragonfly Co-authored-by: Medulla --- crates/openhuman-core/src/config/schema/load_tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/openhuman-core/src/config/schema/load_tests.rs b/crates/openhuman-core/src/config/schema/load_tests.rs index 4bf737e6970..35ff497f4e9 100644 --- a/crates/openhuman-core/src/config/schema/load_tests.rs +++ b/crates/openhuman-core/src/config/schema/load_tests.rs @@ -106,9 +106,9 @@ mod active_user_and_dirs_tests; mod backup_tests; #[path = "load_corruption_recovery_tests.rs"] mod corruption_recovery_tests; -#[path = "load_env_overlay_tests.rs"] -mod env_overlay_tests; #[path = "load_env_overlay_runtime_tests.rs"] mod env_overlay_runtime_tests; +#[path = "load_env_overlay_tests.rs"] +mod env_overlay_tests; #[path = "load_migration_tests.rs"] mod migration_tests; From f9b21d9393ea1e649ceb33a1c9af4921bf3339c0 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 2 Oct 2026 11:15:54 +0300 Subject: [PATCH 16/18] chore(deps): downgrade tinyruntime-bus and tinyruntime-pyserver to 0.2.8 The Cargo.lock file is updated to reflect a downgrade of the `tinyruntime-bus` and `tinyruntime-pyserver` crates from version 0.2.9 to 0.2.8, likely to maintain compatibility with other dependencies or to revert an unintended version bump. Auto-committed-on: dragonfly Co-authored-by: Medulla --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce56a18715a..d9aa5941fca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7260,7 +7260,7 @@ dependencies = [ [[package]] name = "tinyruntime-bus" -version = "0.2.9" +version = "0.2.8" dependencies = [ "serde", "serde_json", @@ -7268,7 +7268,7 @@ dependencies = [ [[package]] name = "tinyruntime-pyserver" -version = "0.2.9" +version = "0.2.8" dependencies = [ "serde", "serde_json", From ebcd6d68c8d4a81f673a6fc0402c6a7fd5b26952 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 2 Oct 2026 11:16:03 +0300 Subject: [PATCH 17/18] chore(deps): update tinyruntime submodule and lockfile Update the vendored tinyruntime submodule from version 0.2.8 to 0.2.9, along with the corresponding checksum changes in Cargo.lock for the tinyruntime-bus and tinyruntime-pyserver crates. Auto-committed-on: dragonfly Co-authored-by: Medulla --- Cargo.lock | 4 ++-- vendor/tinyruntime | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d9aa5941fca..ce56a18715a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7260,7 +7260,7 @@ dependencies = [ [[package]] name = "tinyruntime-bus" -version = "0.2.8" +version = "0.2.9" dependencies = [ "serde", "serde_json", @@ -7268,7 +7268,7 @@ dependencies = [ [[package]] name = "tinyruntime-pyserver" -version = "0.2.8" +version = "0.2.9" dependencies = [ "serde", "serde_json", diff --git a/vendor/tinyruntime b/vendor/tinyruntime index 527d3423c17..a7771a7278d 160000 --- a/vendor/tinyruntime +++ b/vendor/tinyruntime @@ -1 +1 @@ -Subproject commit 527d3423c17b799cc6a9fd9edff21c3968e72d78 +Subproject commit a7771a7278dcf8f4ae9e2977e432f74c22d9953a From 06c3eec1821644790b9e79c20c27047752ff9d07 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 2 Oct 2026 11:16:44 +0300 Subject: [PATCH 18/18] chore(ci): update agent runtime boundary baseline after file renames Updated the baseline JSON to reflect line number shifts caused by code changes in several source files, and corrected two file paths that were renamed from `test.rs` to `tests.rs` in the vendor/tinyagents directory. This keeps the boundary checks aligned with the current source layout. Auto-committed-on: dragonfly Co-authored-by: Medulla --- scripts/ci/agent-runtime-boundary-baseline.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/ci/agent-runtime-boundary-baseline.json b/scripts/ci/agent-runtime-boundary-baseline.json index 9ac737a5c84..b40513d79e8 100644 --- a/scripts/ci/agent-runtime-boundary-baseline.json +++ b/scripts/ci/agent-runtime-boundary-baseline.json @@ -37,7 +37,7 @@ { "rule": "openhuman-runtime-bridge", "path": "crates/openhuman-core/src/agent/tinyagents/mod.rs", - "line": 83, + "line": 84, "text": "pub(crate) use turn_runner::{run_root_turn_via_hosted_agent, run_turn_via_tinyagents_shared};", "occurrence": 1 }, @@ -422,21 +422,21 @@ { "rule": "openhuman-task-local", "path": "crates/openhuman-core/src/agent/session_host/runtime_session.rs", - "line": 255, + "line": 256, "text": "if self.auto_save && crate::agent::turn_origin::current_is_user_authored() {", "occurrence": 1 }, { "rule": "openhuman-task-local", "path": "crates/openhuman-core/src/agent/session_host/runtime_session.rs", - "line": 858, + "line": 859, "text": "workspace_descriptor: crate::agent::harness::current_parent()", "occurrence": 1 }, { "rule": "openhuman-task-local", "path": "crates/openhuman-core/src/agent/session_host/runtime_session.rs", - "line": 1328, + "line": 1329, "text": "request_id: crate::agent::turn_origin::current_request_id(),", "occurrence": 1 }, @@ -1359,7 +1359,7 @@ }, { "rule": "tinyagents-tool-calling-facade", - "path": "vendor/tinyagents/crates/tinyagents-harness/src/agent_loop/dialect/test.rs", + "path": "vendor/tinyagents/crates/tinyagents-harness/src/agent_loop/dialect/dialect_tests.rs", "line": 64, "text": "use tinytools_agent::dialect::CodeStyle;", "occurrence": 1 @@ -1387,8 +1387,8 @@ }, { "rule": "tinyagents-tool-calling-facade", - "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/typed_rows_test.rs", - "line": 9, + "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/typed_rows_tests.rs", + "line": 11, "text": "use tinytools_agent::dialect::{NativeToolCall, encode_assistant_envelope, encode_tool_envelope};", "occurrence": 1 },