Skip to content

feat(tool-search): bump tinyagents and expose per-session discovery options - #710

Merged
senamakel merged 2 commits into
epic/712-tool-tokensfrom
epic-712-oh705-bump-tinyagents
Nov 7, 2026
Merged

senamakel merged 2 commits into
epic/712-tool-tokensfrom
epic-712-oh705-bump-tinyagents

Conversation

@senamakel

Copy link
Copy Markdown
Owner

Closes #705

Part of tinyhumansai/chottu-core#712

What changed

  • Bumps vendor/tinyagents to senamakel/tinyagents epic/712-tool-tokens tip 3611644ff ([tinyagents-slim] delete: agent teams (runtime, agent_team.* RPC, e2e spec) #197 tool sizes, [tinyagents-slim] delete: graph workflow runs (workflow_run.*, planner/critic, topology endpoint) — tinyflows untouched #198-[tinyagents-slim] delete: sync and graph delegation (delegate_graph, delegate, agent_work.*, fleet tools) #200 discovery options). The tinyagents Cargo.toml files are unchanged across the bump, so the [patch] tables need no re-copy. The ToolCompleted test literals gain input_bytes: None.
  • [agent.tool_search] gains max_limit (20), promote_found_tools (true), compact_search_results (false), collapse_search_results (false), repair_tool_call_wrapper (true), with OPENHUMAN_TOOL_SEARCH_* env overrides. discovery_policy() maps them onto ToolDiscoveryPolicy; defaults are today's behaviour.
  • Per session, pinned on the thread: the turn that prepares a thread's first prompt takes the four prompt-shaping options from the config, sets them on RunConfig::discovery (all four fields, so the process-wide policy never leaks in) and, when they differ from today's, records them on the thread's first fresh transcript row (extra_metadata.tool_discovery). Every other turn reads them back from the transcript; a thread with no record keeps today's behaviour. Code: agent/tinyagents/discovery/pin.rs, session_host/runtime_session/ensure.rs, session_host/codec.rs.
  • Embed: ToolDiscoveryOptions (re-export of core DiscoveryOptions; TODAY = defaults), AgentSpec::tool_discovery(..) (agent default for new threads) and Turn::tool_discovery(..) (for the thread this turn creates; ignored on an existing thread).
  • Tool sizes: TurnObservation::Tool.input_bytes/output_bytes reach hosts through the existing observe re-export (embed test + OBSERVERS.md); the tool-completion projection logs both.
  • Docs: docs/gitbooks/en/developing/jev.md, tinyagents/README.md.

TinyJuice / tool_search (report only, not changed here)

ToolOutputMiddleware does not exempt tool_search: is_compaction_exempt / is_truncation_exempt cover proposal tools, sampling tools, mcp_list_* and the REPL tools only. A tool_search result is therefore subject to tokenjuice tabulation, the payload summariser and the char / byte-budget cap before it is stored, so the harness's collapse_search_results (which only rewrites results still in the bridge's own format) can miss it. Adding TOOL_SEARCH_NAME to DISCOVERY_TOOLS is the fix; I wrote and verified that change (red test, then green) and then reverted it on instruction. It is a one-line follow-up.

Gates (in vendor/openhuman)

  • cargo fmt --all -- --check: pass.
  • cargo test -p openhuman --lib -- the_codec_records_discovery discovery::pin discovery::tests env_overlay_sets_the_tool_search tool_completed_projects: 25 passed.
  • cargo clippy -p openhuman -p openhuman-embed --all-targets: no diagnostic in a changed file (the existing unrelated lints remain).
  • cargo check -p openhuman-embed --test observed_turns: pass.
  • check-test-ownership.mjs: pass. check-openhuman-rust-layout.mjs: fails on artifacts/tiny_store_tests.rs (784 lines), which this PR does not touch (pre-existing). generate-architecture-docs.mjs --check crashes on a missing node dependency locally.

Not verified locally

Every test that builds a runtime or runs a session turn fails or hangs in this sandbox with "could not admit the secrets directory: Not a directory", including the existing config_fn_final_autonomy_is_captured_on_the_built_agent_context and the transcript_compat_tests. These new tests are written beside them and have not run locally: session_host/discovery_pin_tests.rs, the two build_tests.rs agent tests, and the extended tests/observed_turns.rs. The codec stamping, the pin resolution and the config mapping are covered by tests that do run.

Follow-ups

  • A compacted or reset generation does not copy the record forward; it resolves to today's behaviour. Carrying it over needs the compaction successor to copy the row.
  • No override that forces new options onto an existing thread (a rollout scope of all).
  • Exempt tool_search from the TinyJuice middleware (above).

senamakel and others added 2 commits November 7, 2026 22:09
Takes tool sizes on ToolCompleted/TurnObservation::Tool and the discovery
policy options (promote, compact, collapse, tool_call repair). The tool
completion test literals gain input_bytes: None.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds promote_found_tools, compact_search_results, collapse_search_results,
repair_tool_call_wrapper and max_limit to [agent].tool_search (with env
overrides), mapped onto the harness ToolDiscoveryPolicy. A session takes the
four prompt-shaping options from the config when it creates a thread, records
them on the thread's first transcript row when they differ from today's, and
reads them back on resume, so a thread keeps the behaviour it started with.
openhuman-embed gains AgentSpec::tool_discovery and Turn::tool_discovery
(ToolDiscoveryOptions) and documents the tool sizes on observations.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant