Skip to content

Test that a promoted tool's schema gets the provider preparation - #606

Merged
M3gA-Mind merged 2 commits into
tinyhumansai:mainfrom
M3gA-Mind:test/322f-promoted-prepared
Nov 11, 2026
Merged

M3gA-Mind merged 2 commits into
tinyhumansai:mainfrom
M3gA-Mind:test/322f-promoted-prepared

Conversation

@M3gA-Mind

Copy link
Copy Markdown
Collaborator

Summary

A tool found through tool_search is promoted with the deferred catalogue's schema, and the catalogue applies RunPolicy::tool_schemas like the direct set does. Nothing pinned that, so this adds a test that a promoted tool reaches the wire with the same preparation as a direct one.

Deferred tools come only from the registry, so a toolset's per-step PreparedToolSet transform has no promoted tools to apply to.

Part of #322 (item f). Part of #322 (item (f))

API Or Behavior Changes

None (test only).

Tests

Run on our Linux CI runner (2026-11-11) on c5648d2, parent main 813a2e1:

  • cargo fmt --all -- --check
  • cargo clippy -p tinyagents-harness --all-targets -- -D warnings (0 items)
  • cargo test -p tinyagents-harness --lib: 3309 passed, 0 failed
  • Red control (catalogue preparation disabled): the test fails on the promoted-vs-direct comparison. The promoted schema arrives raw ({"properties":…,"type":"object"}), while the direct one is prepared (additionalProperties: false, required: ["q"]).
  • N/A: --all-features builds and the full workspace cargo test were not run here; this is a test-only change.

Documentation

Not needed.

A tool found through tool_search is promoted with the deferred
catalogue's schema, and the catalogue applies RunPolicy::tool_schemas
like the direct set does. Nothing pinned that, so a promoted tool
could regress to reaching the wire raw. This adds a test.

Part of tinyhumansai#322 (item f). Deferred tools come only from the registry, so a
toolset's per-step PreparedToolSet transform has no promoted tools to
apply to.
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

Or wait 9 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 12b4e95b-7257-4068-af71-c8cddaf6ed9c
Commits

Reviewing files that changed from the base of the PR and between a030aa0 and 30f6090.

Files selected for processing: 1

  • crates/tinyagents-harness/src/agent_loop/tool_rules_tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@tinysweeper

tinysweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: 30f6090ac87036b6b4b9c7479180a0c8ec1771c4

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 1 of 1 files.
Pull request purpose (title): Test that a promoted…

Diagnostics and supporting details

Full summary

Pull request purpose (title): Test that a promoted tool's schema gets the provider preparation. Tiny Sweeper completed its review; deterministic results follow.

Review snapshot

Change surface Files Review signal Count
Production 0 Active findings 0
Tests 1 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

One file changes: `crates/tinyagents-harness/src/agent_loop/tool_rules_tests.rs`, +67/-0. It adds a `PropTool` helper implementing one optional string property so the strict sanitizer has something to rewrite, plus a `#[tokio::test]` that enables strict `SchemaPreparation`, registers one direct and one deferred tool, drives a `tool_search` call through a ScriptedModel, and compares the promoted tool's parameters to the direct tool's prepared parameters. No production source, public API, or existing caller is touched. This round reviews head 30f6090, one push past the previously reviewed head c5648d2; the delta between them could not be established. Review evidence notes the code index is behind this pull request (indexed at `7a41be9a4fb1`), so retrieved context may be out of date.

Features

None identified with supported citations.

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The change is assessed as logically sound and consistent with the pattern used by similar tests in the same module; no defects were found.
  • Lane summary: The change adds a test for strict schema sanitization promotion of deferred tools. It is logically sound and matches the pattern used by similar tests in the same module. No defects were found. _The code index is behind this pull request (indexed at `7a41be9a4fb1`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The test is self-contained, touches no production code, and involves no network or subprocess calls, secrets, or untrusted-input sink; no security-relevant issue was reported.
  • Lane summary: The change adds a self-contained test with a small fake tool and asserts that a tool revealed by the intrinsic `tool_search` bridge goes through the same strict `SchemaPreparation` projection as a directly registered tool. It touches no production code, no network or subprocess calls, no secrets, and no untrusted-input sink, so there is nothing security-relevant to report. _The code index is behind this pull request (indexed at `7a41be9a4fb1`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The only change is a new test in the sibling test module `agent_loop/tool_rules_tests.rs`; no production code is touched, so there is no new behaviour needing coverage. The test is non-vacuous: it pins that the run's `SchemaPreparation { strict: true }` actually reaches the wire for a direct tool (the source schema has neither `additionalProperties` nor `required`, so the assertions on those two keys can only hold after sanitization) and that a deferred tool promoted by `tool_search` carries exactly the same prepared parameters on the second request, so a promotion path that served the raw catalogue schema would fail it. I found nothing to report. _The code index is behind this pull request (indexed at `7a41be9a4fb1`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: No sensitive content was found in the committed files.
  • Lane summary: No sensitive content in committed files. _The code index is behind this pull request (indexed at `7a41be9a4fb1`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The description matches the diff: one test asserting a deferred tool promoted through `tool_search` reaches the second model request with the same strict `SchemaPreparation` as the directly advertised tool, with the test-only scope stated as in the body.
  • Lane summary: The description matches the diff: the pull request adds exactly one thing — a `tool_rules_tests.rs` test that a deferred tool promoted through `tool_search` reaches the second model request with the same strict `SchemaPreparation` applied to it as the directly advertised tool — and the body says so, including the red-control reasoning and the test-only scope. No findings. _The code index is behind this pull request (indexed at `7a41be9a4fb1`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4-flash, deepseek-v4.1-flash
  • Spend: $0.012682
  • Completion usage: incomplete; some provider completion costs are unavailable.
  • Tokens: 328018 input · 44439 output · 118016 cached · 172 embedding
  • Updated: 2026-11-11T12:06:03Z
Head State Pass summary
c5648d21af0f ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-11-11T11:30:56Z)
30f6090ac870 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-11-11T12:06:03Z)

tinysweeper 0.1.2

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

Diagnostics

Total spend: $0.0093

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Nov 11, 2026
# Conflicts:
#	crates/tinyagents-harness/src/agent_loop/tool_rules_tests.rs
@M3gA-Mind
M3gA-Mind merged commit b99428c into tinyhumansai:main Nov 11, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant