Skip to content

fix(tool-search): exempt from TinyJuice, keep the pin across compaction, force options onto existing threads - #715

Merged
senamakel merged 3 commits into
epic/712-tool-tokensfrom
tool-search-followups
Nov 8, 2026
Merged

senamakel merged 3 commits into
epic/712-tool-tokensfrom
tool-search-followups

Conversation

@senamakel

Copy link
Copy Markdown
Owner

Closes #711
Part of tinyhumansai/chottu-core#712

What changed

  • TinyJuice exemption. tool_search joins DISCOVERY_TOOLS, so ToolOutputMiddleware no longer tabulates, summarises or truncates its results; the harness's collapse step sees them whole.
  • Pin survives compaction. OpenHumanTranscriptCodec::reconcile calls the new discovery::carry_forward: when a compacted generation's rows lost the tool_discovery record (refreshed system prompt, summary), it is written on the generation's first row. Both in-turn and out-of-band (compact_bound_history) compaction go through reconcile. resolve also keeps a recorded pin when a prefix is prepared again.
  • Force onto existing threads. New Turn::tool_discovery_force(opts) sets a non-serialized ToolSearchConfig::force_pin. The turn runs with the options and records them on a later row when they differ from what the thread runs with (including a change back to today's behaviour). The latest record wins (recorded_metadata now reads the last record). Default behaviour is unchanged; Turn::tool_discovery still pins new threads only. Chottu-core#65's all scope uses this.

Tests (red first, then green)

  • tool_search_result_is_not_reshaped_by_tool_output_middleware
  • discovery_pin_survives_compaction (codec) and compaction_carries_the_record_onto_the_first_row_of_the_new_generation
  • forced_discovery_options_apply_to_existing_thread plus forcing-today, no-op force, latest-wins, re-prepared prompt (pin.rs)
  • a_forced_discovery_turn_asks_for_the_options_on_existing_threads (embed; written with the helper, no red run)

Gates

  • cargo fmt --all -- --check: pass
  • cargo clippy -p openhuman -p openhuman-embed --lib -- -D warnings: pass
  • cargo test -p openhuman --lib (filters: discovery::pin, replay_pin, tool_output, codec, the three new tests): pass
  • cargo test -p openhuman-embed --lib a_forced_discovery_turn: pass
  • node scripts/generate-embed-docs.mjs: no diff

Pre-existing, not caused by this change

  • Runtime-building tests fail with "could not admit the secrets directory" (4 in the filter set, plus 1 artifact test seeing [REDACTED]).
  • session_host::discovery_pin_tests hangs locally (not run); an unrelated stack overflow in attachments::provider under the broad discovery filter.
  • 23 clippy lints in test files under --all-targets; none in files touched here.

Not covered

senamakel and others added 3 commits November 8, 2026 03:48
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Turn::tool_discovery_force runs the turn with the options and records them on
a later row; the latest record wins. Default behaviour is unchanged.

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