Repository navigation
Closed
Labels
rust-coreCore Rust runtime in src/: CLI, core_server, shared infrastructure.source: teamIssue opened by a repository membertriage: needs-opinionValid issue awaiting a maintainer product or priority decision
Description
Summary
The TinyAgents port audit (§5 of docs/tinyagents-port-plan.md) surfaced three code-quality items that are genuine design decisions, not mechanical fixes. The behavior-preserving parts were landed in #4542, but each carries a real "implement vs defer" choice that was intentionally left open. This issue tracks resolving them.
Problem / Context
Each item currently reads as dead/misleading code but changing it alters behavior, a public type, or a trust boundary — so it needs an explicit decision rather than a drive-by change. #4542 added clarifying comments/annotations in place; this issue is where the actual decisions land (some are gated on later port phases).
Scope
Three independent decisions:
recommend_tierRAM scaling (src/openhuman/inference/presets.rs) — reads device RAM but always returnsMVP_MAX_TIER; its test pins the non-scaling contract. Decide: implement RAM→tier scaling (and updaterecommend_tier_scales_with_ram), or formally keep the intentional MVP cap and drop the unused RAM read. fix(tinyagents-audit): execute §5 fix-in-place items — provider diagnostic, anchor coupling, dead-read clarifications #4542 documented it as an intentional cap.SteerError::NotOwnedRPC-path ownership (src/openhuman/agent_orchestration/subagent_control.rs) — the arm is unreachable on the trusted RPCsteer_controlpath (no ownership check there); the agent-toolrunning_subagents::steerpath does enforce ownership. Enforcing it on the RPC path would change the JSON-RPC payload shape (forbidden during the port) → deferred to Phase 4 (graph::orchestration::SteeringRegistryownership consolidation).ToolScope::AgentOnlyvsAll+is_concurrency_safe(src/openhuman/tools/traits.rs) —AgentOnlyhas three real constructors but no execution path gates on it (behaves likeAll);is_concurrency_safemaps to tinyagentsToolRuntime.idempotent, which the harness never reads for dispatch (serial tool loop). Reconcile with the crate tool model in Phase 2; adopting concurrency needs upstream parallel dispatch.
Acceptance criteria
-
recommend_tier— decision made and implemented (scale or formally cap + strip param) -
NotOwned— RPC-path ownership resolved as part of Phase 4SteeringRegistry, or explicitly documented as permanently trusted-RPC -
ToolScope::AgentOnly/is_concurrency_safe— reconciled with the tinyagents tool model in Phase 2 (gateAgentOnlyor collapse toAll; wire concurrency only behind upstream parallel dispatch) - Diff coverage ≥ 80% — implementing PR(s) meet the changed-lines coverage gate
Related
- Port plan:
docs/tinyagents-port-plan.md§5, §2 - Landed context: fix(tinyagents-audit): execute §5 fix-in-place items — provider diagnostic, anchor coupling, dead-read clarifications #4542 (behavior-preserving parts), feat(tinyagents): Phase 0/1 port cutover — pin v1.7.1, crate-back SchemaCleanr / model-context / observed stream #4539 (Phase 0/1 port)
- Tracker: TinyAgents migration (v0.58.7 → main) parity & bug-fix tracker — harness audit findings #4470 (TinyAgents migration parity)
Implementation Plan
Triage Assessment
- Three independent, well-scoped design decisions deferred from the TinyAgents port audit (§5).
- Each is grounded in concrete file paths and symbols verified in the codebase:
recommend_tieratsrc/openhuman/inference/presets.rs:200-209— always returnsMVP_MAX_TIER, readsram_gbonly for diagnostic logging.SteerError::NotOwnedatsrc/openhuman/agent_orchestration/subagent_control.rs:187-193— unreachable arm on the RPC path, kept for Phase 4 SteeringRegistry.ToolScope::AgentOnlyatsrc/openhuman/tools/traits.rs:14-21— unused gate;is_concurrency_safenever read for dispatch.
- The PRs that introduced the deferred state (fix(tinyagents-audit): execute §5 fix-in-place items — provider diagnostic, anchor coupling, dead-read clarifications #4542, feat(tinyagents): Phase 0/1 port cutover — pin v1.7.1, crate-back SchemaCleanr / model-context / observed stream #4539) are merged. No new work has been done on these items.
- User impact is developer/maintainer-facing (code clarity, correctness of dead-code warnings, and future portability).
Proposed Scope
- In-scope:
recommend_tier— either implement RAM-to-tier scaling or formally cap and remove the unused RAM read + diagnostic.SteerError::NotOwned— either wire ownership checks into the RPCsteer_controlpath (changing JSON-RPC payload shape) or document the path as permanently trusted and add a compile-time unreachable guard.ToolScope::AgentOnly— either gate it behind execution-path filtering (collapsing toAgentOnlytools being invisible to non-agent contexts) or remove the variant and collapse all callers toAll.
- Explicit non-goals:
- Not changing the TinyAgents crate model (that's Phase 2/4 upstream).
- Not implementing parallel dispatch (prerequisite for
is_concurrency_safeusage). - Not removing
CliRpcOnly(separate concern).
Implementation Steps
recommend_tierdecision — Two sub-options, pick one:- Option A (scale): Replace line
let tier = MVP_MAX_TIERwith a match onram_gbthat returns ascendingModelTiervalues. Updaterecommend_tier_scales_with_ramtest to assert different tiers for different RAM values. This requires the higher-tiers' models to be productised. - Option B (cap): Remove
let ram_gb = device.total_ram_gb()read, remove thetracing::debug!line, and add a doc comment onrecommend_tierstating the intentional cap. Update the test name fromrecommend_tier_scales_with_ramtorecommend_tier_caps_at_mvpand pin all inputs toMVP_MAX_TIER.
- Option A (scale): Replace line
SteerError::NotOwneddecision — Two sub-options:- Option A (Phase 4): Keep the unreachable arm. Add
#[allow(unreachable_patterns)]with a doc comment referencing the Phase 4 issue. Optionally replace the string match withunreachable!("Phase 4 SteeringRegistry will handle ownership — see #4565"). - Option B (trusted): Document
steer_controlas a permanently trusted-RPC path that bypasses ownership checks (like the core RPC's own internal dispatch). Remove theNotOwnedmatch arm and let the compiler enforce no new variants are missed.
- Option A (Phase 4): Keep the unreachable arm. Add
ToolScope::AgentOnly/is_concurrency_safedecision — Two sub-options:- Option A (gate): In
src/openhuman/agent/harness/tool_filter.rs, add a filter that excludesToolScope::AgentOnlytools from non-agent contexts (e.g., CLI/RPC tool listing). This makes the variant meaningful. UpdateAgentOnly-scoped tools (e.g.,agent_memory/tools.rs:90-91) to verify they are excluded from CLI/RPC. - Option B (collapse): Remove
AgentOnlyfrom the enum, rename all references toAll. Add a doc comment noting that the distinction was not used and is deferred to a future tool-scoping model.
- Option A (gate): In
is_concurrency_safe— Add a#[expect(dead_code)]or gate behind aconcurrent-toolsCargo feature. Wire into the harness dispatch only when upstream parallel dispatch exists. Alternatively, remove the method from theTooltrait and re-add it when parallel dispatch lands.
Verification
cargo test --lib openhuman::inference::presets::tests— updatedrecommend_tiertests.cargo test --lib openhuman::agent_orchestration::subagent_control::tests— control path tests.cargo test --lib openhuman::tools::traits::tests—ToolScopeequality and filter tests.cargo check --no-default-features --features tokenjuice-treesitter— verify no feature-forwarding drift.- Full suite:
pnpm test:rust.
Risks and Open Questions
- Option A for
recommend_tier(RAM scaling) needs the higher tiers to have productised models. If they aren't ready, Option B is the only viable path. - Phase 4
SteeringRegistryis not yet scheduled. If deferred indefinitely, Option B (trusted-RPC) forNotOwnedis cleaner. - Collapsing
AgentOnlytoAllis safe because no execution path currently reads it, but it removes forward-looking API surface that future tool-modeling may want.
Acceptance Criteria
- All three decisions resolved with code changes, not just documentation.
- Tests updated to pin the new contracts.
- No unused parameters, dead match arms, or misleading enum variants remain.
- Diff coverage >= 80%.
Metadata
Metadata
Assignees
Labels
rust-coreCore Rust runtime in src/: CLI, core_server, shared infrastructure.source: teamIssue opened by a repository membertriage: needs-opinionValid issue awaiting a maintainer product or priority decision
Type
Projects
- StatusShow more project fieldsDone
Activity
senamakel commentedon Jul 23, 2026
Triage: ESCALATE — well-scoped, overlooked.
Three concrete TinyAgents §5 design decisions, each independently shippable:
recommend_tierRAM scaling — formal cap or implement scalingSteerError::NotOwnedon RPC path — enforce in Phase 4 or document as trusted-RPCToolScope::AgentOnly/is_concurrency_safe— reconcile in Phase 2Each names the exact file, symbol, and relevant test. Zero comments since creation (2026-07-05). Needs labels (
rust-core) and an assignee. Each item is a small, self-contained PR.YellowSnnowmann commentedon Sep 11, 2026
Re-verified on
main(6be58a9) — all three still open. Two have moved file, and item 3 has moved out of this repository entirely.Seconding the escalate triage; adding the current locations, since every path in the issue body has drifted since 2026-07-05.
1.
recommend_tierRAM scaling — unchanged, still exactly as described.src/openhuman/inference/presets.rs:229-239:The #4542 comment is in place and
ram_gbis still log-only. Decision outstanding. This is the one item still entirely within this repo and genuinely a small PR either way.2.
SteerError::NotOwned— still present; file path in the issue is stale. The issue points atsrc/openhuman/agent_orchestration/subagent_control.rs, which no longer exists. It is nowsrc/openhuman/agent/orchestration/running_subagents_part_02.rs:207-214:Note there is also a sibling
WaitError::NotOwned(running_subagents_part_01.rs:294,running_subagents_part_02.rs:124/136/162/188) — worth checking whether the Phase 4 ownership consolidation should cover both, since they are the same trust question on two verbs.3.
ToolScope::AgentOnly/is_concurrency_safe— the decision is no longer this repo's to make alone.ToolScopeis no longer insrc/openhuman/tools/traits.rs. It now lives in the vendored tinytools crate:vendor/tinyagents/vendor/tinytools/crates/tinytools/src/classification/types.rs:7. So "gateAgentOnlyor collapse toAll" is now a tinytools change plus a submodule bump, not a local edit — which materially changes the effort and the sequencing of this acceptance criterion.The good news is the ambiguity the issue flagged has been written down at the definition site, so the state is no longer implicit (
types.rs:11-17):One correction to the issue's numbers: it says
AgentOnlyhas "three real constructors". Onmainthere is one in-tree constructor —src/openhuman/memory/agent/tools.rs:91. The other occurrences are not constructors:src/openhuman/runtime/node/ops.rs:16maps the variant to the label"agent_only", and the remaining two are assertions inruntime/node/ops_tests.rs:77andintegrations/mod_tests.rs:13. That weakens the "losing those annotations would mean re-deriving them" argument considerably — one annotation is not much to re-derive, so collapsing toAllis a more attractive option now than when this was filed.is_concurrency_safeis unchanged: still implemented across the read-only tools (network/web_fetch.rs:109,filesystem/grep.rs:76,filesystem/glob_search.rs:85,filesystem/file_read.rs:49,memory/agent/tools.rs:94) and still never read for dispatch — the tool loop remains serial.Also worth disambiguating for whoever picks this up: there is now a second, unrelated
ToolScopein the tree —src/openhuman/agent/harness/definition_part_01.rs:594(Wildcard/Named(Vec<String>)), which scopes which tools a sub-agent may see. Same name, different concept. A grep forToolScopewill hit both.Suggested sequencing
Items 1 and 2 are independent and local(ish); item 3 now has a vendor dependency. If the aim is to close acceptance criteria incrementally, item 1 first — it is self-contained, the test that pins the current contract is named, and either decision is a small PR. Item 3's scope should probably be restated in the body to reflect the tinytools move before anyone estimates it.
senamakel commentedon Oct 9, 2026
Triage: needs opinion — “Resolve the three deferred TinyAgents §5 design decisions (recommend_tier, NotOwned, ToolScope/is_concurrency_safe)” needs a maintainer decision on product scope/priority or fresh reproduction evidence before its status can be settled. Please advise whether to pursue, narrow, or close it.
M3gA-Mind commentedon Nov 16, 2026
Thanks for keeping this precise. Re-checked on current main, the three items have moved on:
recommend_tierRAM scaling: the function no longer exists in OpenHuman. It moved out in Move reusable inference implementation out of OpenHuman #6326, and the cap was later removed upstream.SteerError::NotOwnedon the RPC path: the steer RPC was removed in [tinyagents-slim] complete OpenHuman host adoption #8319, and ownership is now explicit in TinyAgents (SteerAccess::OwnervsTrusted), so the ambiguity is gone. (crates/openhuman-core/src/agent/README.mdstill listssteerand could be updated.)ToolScope::AgentOnly/is_concurrency_safe: these live in TinyTools/TinyAgents now.is_concurrency_safeis in use for concurrent tool batches, whileAgentOnlyis still not enforced.Since nothing here remains in this repository, we're closing this one. If
AgentOnlyenforcement is still wanted, it belongs in a TinyTools issue.