Skip to content

[tinyagents-slim] harness-tools: new tinyagents-harness-tools crate (todos, goals, plan_exit, use_skill, clarification, time, subagent tools) #57

Closed

Description

@senamakel

Parent: tinyhumansai/openhuman#8088

Context

A new crate holds every default tool tinyagents defines, together with the harness-level functionality behind them. Tool infrastructure stays in tinyagents-harness: rules, deferral, discover, select, schema prep and the timeout wrapper. This is the tool implementation side.

Moves in From Lines (non-test)
todos (TodoTool, store, TodoSequenceMiddleware, TodoList) tinyagents-graph/src/todos/ 1,271
goals (GoalTool, GoalToolKind, store, budget, prompt block) tinyagents-graph/src/goals/, minus continuation.rs (deleted, no consumer) 1,058
thread_locks tinyagents-graph/src/thread_locks/ 104
AskClarificationTool, CurrentTimeTool, ResolveTimeTool tinyagents-harness/src/tools/ part of 1,160
PlanExitTool, PLAN_EXIT_MARKER tinyagents-harness/src/tool/plan_exit.rs —
UseSkillTool, PackCatalog tinyagents-harness/src/tool/packs/ —
DriverSubAgentTool, SubAgentJobsTool, SubAgentMessageTool (feature subagents, depends on orchestration) tinyagents-orchestration/src/subagent/invocation/{driver_tool,jobs}.rs tool shells only
PerCallTool<T> (generic per-call rebuild wrapper, made generic over its context) OpenHuman tools/per_call.rs (204) 204

WaitTool and WaitLoopTool are deleted, not moved; OpenHuman drops them. Delete the unused exports on the way: goal_tools, register_goal_tools, todo_tools, register_todo_tools, GoalProgress and TurnOutcome.

Goals gaps to close here, since OpenHuman's host goals adapter is deleted by senamakel/openhuman#209:

  • A GoalObserver (on_updated(&ThreadGoal), on_cleared(thread)) that fires on resume, clear, account and complete, not only on tool calls.
  • A turn-prep helper: load, auto-resume if paused, active_goal_context_block, and GoalBudgetStopHook::for_goal. This is what the host inlines today in session_host/runtime_session/prelude.rs:213-251.
  • A correct budget-meter throttle. The host version compares one turn's delta against 5% of the budget instead of tracking usage since the last publish, so the meter goes stale. Make account_turn atomic: the host reads, then accounts, and races. Take elapsed time as a Duration, not whole seconds; the host truncates sub-second turns to 0.

tinyagents-hooks' goals feature repoints at this crate.

Scope

  • Create crates/tinyagents-harness-tools with features todos, goals, subagents, skills (default: all but subagents).
  • Move the rows above with their tests, and port the e2e_graph_goals/e2e_graph_todos integration tests and the goals_and_todos example.
  • Add GoalObserver, the turn-prep helper and the fixed throttle/atomic account_turn, each test-first.
  • Repoint tinyagents-hooks (stop/goal_budget.rs) at the new crate.
  • Leave no re-export shims in graph or harness; graph is deleted by [tinyagents-slim] graph: delete the tinyagents-graph crate #61.

Acceptance criteria

  • Test: many small turns publish a meter update once cumulative usage since the last publish crosses the threshold.
  • Test: concurrent account_turn calls produce a consistent status transition and exactly one observer event per transition.
  • Test: GoalObserver fires on resume, clear, account and complete.
  • tinyagents-harness-tools depends only on tinyagents-harness, tinytools and (feature subagents) tinyagents-orchestration. dependency_boundary.rs is updated to assert it.

Done when: the rows above are gone from their source directories and the gates below pass.

Agent brief

Depends on: none · Blocks: #61 · #65 · senamakel/openhuman#209

Research first

  • Can the subagent tool shells move without dragging SubAgentJobRegistry along? If not, harness-tools re-exports the registry type behind subagents and the registry stays in orchestration.

Files to consider

  • Read: crates/tinyagents-graph/src/{todos,goals,thread_locks}/, crates/tinyagents-harness/src/{tools,tool/plan_exit.rs,tool/packs}/
  • Read: OpenHuman crates/openhuman-core/src/agent/goals/runtime.rs (the throttle bug at ~170-180, the non-atomic account at 131-148)
  • Change: Cargo.toml (workspace members), crates/tinyagents-hooks/Cargo.toml, crates/tinyagents-integration-tests/

Workflow: implementing-an-epic step; follow openhuman's migrate-to-submodule skill for the release and the OpenHuman gitlink bump

Subagents: plan-writer on Opus for the crate layout, then tdd-implementer on Sonnet, then code-reviewer before the PR.

Gates: cargo check --workspace --all-targets · cargo clippy --workspace --all-targets -- -D warnings · cargo test --workspace (in vendor/tinyagents)

Deep dive (orchestration audit)

Per-file detail of what moves from orchestration: tinyhumansai/openhuman#8088 (comment).

  • Correction to the dependency rule: the moved subagent shells import tinyagents_tasks::{TaskStore, OrchestrationTaskFilter, DetachedTaskRegistryError} and tinyinference_llm::Message (jobs.rs:16,26). harness-tools therefore depends on tinyagents-tasks and tinyinference-llm too, behind subagents.
  • Make these registry methods pub: wait_owned, cancel_owned, get_owned, try_get_owned, try_list_owned, send_message_owned, send_message_with_request_id, register_driver_job, mark_running, mark_driver_result, driver_job_for_key. Also make DriverJobRegistration and SubagentRequest::resume() public.
  • sessions_tests.rs:217,360,414 and jobs_tests.rs move with the shells. A dev-dependency from orchestration back onto harness-tools would be circular.
  • Plan review and plan mode are a separate leaf, [tinyagents-slim] harness-tools: plan review and plan mode (request_plan_review, review store, run-mode store) #70, built on this crate.

Activity

  1. added
    enhancementNew feature or request
    rustPull requests that update rust code
    priority: p1Next. Wrong behaviour a user will hit, or a security weakness behind a condition.
    on Oct 18, 2026
  2. senamakel commented on Oct 18, 2026

    @senamakel
    OwnerAuthor

    Integrated into the fork epic branch in merge commit 1127dd7, preserving the full history from canonical PR tinyhumansai#497 (reviewed head 2025677). All current-head hosted checks pass; local workspace tests passed 5637 tests, and affected graph/tools tests passed 609 after dependency cleanup. Independent review approved the restored behavior coverage. Canonical PR remains a genuine dependency draft until PR tinyhumansai#496 lands externally; no upstream merge was performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: p1Next. Wrong behaviour a user will hit, or a security weakness behind a condition.rustPull requests that update rust code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions