Skip to content

feat(agent): code-style tool dialects (python / typescript) behind agent.tool_dispatcher - #6433

Merged
senamakel merged 23 commits into
tinyhumansai:mainfrom
senamakel:code-tool-dialect
Sep 22, 2026
Merged

senamakel merged 23 commits into
tinyhumansai:mainfrom
senamakel:code-tool-dialect

Conversation

@senamakel

@senamakel senamakel commented Sep 22, 2026

Copy link
Copy Markdown
Member

Summary

  • agent.tool_dispatcher accepts two new opt-in values, "python" and "typescript": the tool catalogue is rendered as function signatures (def read_file(path: str, limit: int = None) -> str) and the model calls tools as code (read_file(path="src/main.rs", limit=20)). OPENHUMAN_TOOL_DISPATCHER overrides the field for one launch.
  • The session's dialect is now pinned on the turn harness (OpenHumanRunContext::tool_dialectRunPolicy::tool_dialect). Before, the harness always ran Auto regardless of what the prompt was composed for, so text dialects kept native schemas on the wire and had no registry to recover positional calls with.
  • Fixes a double catalogue under xml: ToolsSection rendered the P-Format signature list and the XML block embedded the full JSON schemas — 13.6 KB + 28.7 KB for the orchestrator's 31 tools.
  • New manual bench tool-dialect-bench (crates/openhuman-cli/src/bin/tool_dialect_bench.rs) A/Bs the dialects against a local Ollama model.
  • Bumps vendor/tinyagents (→ Add Python / TypeScript code-style tool dispatchers tinyagents#184, which bumps tinytools → Add code-style tool-call dialect (Python / TypeScript) tinytools#16).

Problem

Every text-dialect turn re-sends the tool catalogue in the system prompt. xml pays for full JSON schemas; pformat is compact but an invented syntax an 8B model has never seen, and it mis-parses. We want to test whether function signatures + code-style calls — the form a code-trained model already writes — are cheaper and more reliable on small local models.

Solution

Measured with the bench on qwen3:8b (Ollama, 10 tools, 20 tasks, temperature 0, output cap 1500, model-reported tokens; two independent runs agree within one task):

dialect prompt tokens output tokens call recovered exact args avg latency
xml 703 238 100% 85% 10.6 s
pformat 795 334 100% 70% 14.6 s
python 517 198 100% 90% 9.0 s
typescript 494 240 95% 90% 10.6 s

Python cuts prompt tokens 26% vs xml and 35% vs pformat (whose ~1.2 KB rules block outweighs its slot savings on a 10-tool set), while binding arguments more accurately. The pformat misses are real binding errors (list arguments emitted as a pipe-joined string, duration_minutes in the wrong slot); the remaining xml/python inexact rows are the model adding an optional argument (unit="metric"). The single typescript miss is qwen3 spending the whole 1500-token budget in its thinking channel on one task.

Real orchestrator prompt (agent prompt-size --hermetic, 31 tools, Ollama model): system prompt 73.4 KB (xml, before the double-catalogue fix) → 45.8 KB (pformat) / 47.5 KB (python) / 47.4 KB (typescript).

Design: the parser lives in tinytools-agent (one grammar for both spellings, registry-gated, literals only, all-or-nothing per <tool_call> body, top-level ```python fences stay examples). OpenHuman only maps the config string (agent/tinyagents/config.rs, new `session_host/builder/dispatcher.rs`), renders the catalogue (`prompts/sections.rs`, `prompts/render_helpers/subagent.rs`, `subagent_host/tool_prep.rs`), and pins the dialect on the harness (`session_host/driver.rs` → `harness_assembly.rs`). `auto` never selects the new dialects.

Draft: depends on tinyhumansai/tinytools#16 and tinyhumansai/tinyagents#184 landing first; the vendor/tinyagents gitlink must then move to the merge commit.

Submission Checklist

  • Tests added or updated (happy path + at least one failure / edge case) — config mapping, env overlay (blank values ignored), dispatcher resolution, tools-section snapshots for both styles, JSON once-only catalogue, subagent render, format mapping
  • Diff coverage ≥ 80% — the bench bin is manual/network-only and uncovered by design; core changes are covered
  • Coverage matrix updated — N/A: behaviour-only change (no feature row added/removed)
  • All affected feature IDs from the matrix are listed in the PR description under ## Related — N/A
  • No new external network dependencies introduced (the bench is a manual tool, never run by CI)
  • Manual smoke checklist updated — N/A, opt-in flag
  • Linked issue closed via Closes #NNN — none

Impact

  • CLI/desktop core: opt-in only. Default auto behaviour is unchanged except (a) the harness now honours the session's dialect, and (b) xml prompts no longer carry a second catalogue.
  • Text dialects (xml/pformat/python/typescript) now strip schemas off the wire as intended, so integrations_agent (forced off native for Fireworks grammar limits) no longer sends native tools alongside its prose catalogue.

Related

  • Closes: —
  • Follow-up PR(s)/TODOs: subagent_host/tool_prep.rs::build_text_mode_tool_instructions still hand-writes a stale positional P-Format block; add a dedicated fence language if small models refuse <tool_call> tags.

AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: code-tool-dialect
  • Commit SHA: 77e9b763021c69bd8e8d979d910a32d8aab91c4a

Validation Run

  • pnpm --filter openhuman-app format:check — N/A, no frontend change
  • pnpm typecheck — N/A, no frontend change
  • Focused tests: cargo test -p openhuman --lib -- prompts:: subagent_host::tool_prep tinyagents::config_tests factory_provider_role env_overlay tool_call_format_maps (all green)
  • Rust fmt/check: cargo fmt --all -- --check, cargo check --all-targets, pnpm rust:layout, pnpm docs:check
  • scripts/check-prompt-budget.sh: flags code_executor / context_scout / skill_executor / skill_setup (+16 B tool schemas) and mcp_agent (+70 B prompt) — byte-identical on main (inherited from the hint: slug rename after scripts/prompt-budget.limits was last written). main additionally flags orchestrator (30 263 B > 30 213); this branch brings it back under budget.
  • Tauri fmt/check: N/A

Validation Blocked

  • command: cargo test -p openhuman --lib -- agent_turn_loop_tests::xml_dispatcher_parses_and_loops
  • error: "hosted root invocation is unavailable because the session has no hosted authority"
  • impact: pre-existing — fails identically on main; unrelated to this change

Behavior Changes

  • Intended behavior change: new opt-in dialects; harness dialect pinned from the session; single catalogue under xml.
  • User-visible effect: none unless agent.tool_dispatcher / OPENHUMAN_TOOL_DISPATCHER is set; smaller prompts and fewer duplicated tool listings for prompt-guided local models.

Parity Contract

  • Legacy behavior preserved: auto/native/xml/pformat spellings unchanged; auto never picks a code dialect; integrations_agent still forced off native.
  • Guard/fallback/dispatch parity checks: factory_provider_role_tests_tests.rs, config_tests.rs, tinyagents e2e_tool_dialects.rs.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): none
  • Canonical PR: this

Co-authored-by: Medulla medulla@tinyhumans.ai

Add the tinyagents library as a vendored dependency to support agent-based workflows in the project. This change introduces the external codebase directly into the repository, ensuring consistent availability and versioning without requiring a separate package installation step.

Auto-committed-on: macbook
The tinyagents submodule is updated to a newer commit, bringing in upstream changes.

Auto-committed-on: macbook
Add support for code-style tool call formats in Python and TypeScript, enabling models to invoke tools using language-native syntax. These formats are opt-in via the `tool_dispatcher` config and provide a compact alternative to P-Format that aligns with how code-trained models naturally express function calls.

Auto-committed-on: macbook
The turn harness now runs with the same tool dialect the session composed its prompt for, instead of letting the harness pick from the model profile. This ensures text-based protocols strip schemas off the wire and use the positional registry to recover P-Format or code-style calls, while `Auto` still allows fallback for models that do not support native tools.

Auto-committed-on: macbook
Add support for Python and TypeScript code-style tool calls via the `tool_dispatcher` config, selectable with `"python"` or `"typescript"` values, and expose a one-launch `OPENHUMAN_TOOL_DISPATCHER` environment variable to override the setting. The new code dialects are opt-in like P-Format, since their compact syntaxes can mis-parse on some models, and the dispatcher resolution now falls back to auto with a warning on unknown spellings.

Auto-committed-on: macbook
Add a test verifying that a non-blank OPENHUMAN_TOOL_DISPATCHER environment variable overrides the agent's tool_dispatcher field, while blank values leave the persisted choice unchanged.

Auto-committed-on: macbook
…prompts

Added handling for Python and TypeScript tool call formats in the subagent system prompt renderer, reusing the canonical code catalogue renderer and dialect instructions to ensure consistent tool descriptions and usage guidance across these formats.

Auto-committed-on: macbook
Added a test verifying that under Python and TypeScript code dialects, the tools section renders each tool as a single function signature with a trailing comment, omits the "Call as:" and JSON schema blocks, and appends the dispatcher protocol block.

Auto-committed-on: macbook
Add a test verifying that the subagent system prompt renders tool signatures and call examples in both Python and TypeScript formats, and that it includes the tool use protocol section while omitting the JSON-style "Parameters:" and "Call as:" sections.

Auto-committed-on: macbook
Added a test verifying that each tool call format dialect maps to the correct harness dispatcher and code style, including the intentional fallback of Native to Auto.

Auto-committed-on: macbook
…dule

The dispatcher kind resolution and provider role logic have been moved out of the factory module into a dedicated dispatcher module, keeping the factory focused on construction. The provider role tests now reference the dispatcher module directly for the shared types.

Auto-committed-on: macbook
The `provider_role_for` function has been relocated from the dispatcher module to the factory module, where it is more appropriately scoped. This change does not alter any behavior; it simply reorganizes the code to improve maintainability and cohesion.

Auto-committed-on: macbook
Reformat several files in the agent module to conform to rustfmt's line-width and import-ordering rules, including wrapping long assertions, joining split string literals, and reordering use statements. No behavior changes are introduced.

Auto-committed-on: macbook
The agent harness documentation now explains how tool dispatch is selected and how the `auto` mode falls back to JSON-in-tag for providers without native support. It also details the XML, P-Format, and code dialects, including their syntax and when they are used, and clarifies that a shared parser handles mixed forms in transcripts.

Auto-committed-on: macbook
Adds a manual, network-touching benchmark binary for comparing text tool-call dialects against a local Ollama model, measuring prompt tokens and call accuracy per `agent.tool_dispatcher` value. This is never run by CI and is documented in the file's header for invocation.

Auto-committed-on: macbook
The benchmark was formatting the provider string with a constant that may not be defined, so it now uses the explicit "ollama:" prefix to ensure correct provider resolution.

Auto-committed-on: macbook
The JSON dialect's protocol block already embeds a full-schema catalogue, so rendering the signature catalogue as well listed every tool twice. This change suppresses the redundant signature output when a JSON dispatcher is active, reducing prompt size by roughly 13 KB.

Auto-committed-on: macbook
… catalogue

Added a test verifying that when the XML dialect embeds the full-schema catalogue, the tools section lists each tool only once, preventing the previous duplication of the orchestrator's 31 tools.

Auto-committed-on: macbook
The benchmark now accepts a `--max-output-tokens` flag to override the default per-call ceiling, which has been raised to 1500 tokens to accommodate thinking models that spend most of their budget in the reasoning channel. Additionally, responses that are empty but consumed the full output budget are now reported as an "output cap reached" error rather than being mistaken for a dialect failure.

Auto-committed-on: macbook
Added the `use tinytools_agent::dialect::ToolDialect as _;` import to bring the trait into scope, which is required for the `prompt_instructions` method call to resolve correctly.

Auto-committed-on: macbook
Reformatted the code in the tool dialect benchmark binary for improved readability and consistency with the project's style guidelines. No functional changes were made.

Auto-committed-on: macbook
The match arm for `ToolCallFormat::Json` with non-empty dispatcher instructions is reformatted to a single line, reducing unnecessary line breaks without changing behavior.

Auto-committed-on: macbook
Add a README section for the new `tool-dialect-bench` binary, which manually A/B tests text tool-call dialects against a local Ollama model. The section explains the binary's purpose, usage, and relevant flags, complementing the existing documentation for other binaries in the crate.

Auto-committed-on: macbook
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 859b5d4a-a559-4dc2-9ad8-6ee3eb65ea50

📥 Commits

Reviewing files that changed from the base of the PR and between 6e45c61 and 77e9b76.

📒 Files selected for processing (26)
  • crates/openhuman-cli/Cargo.toml
  • crates/openhuman-cli/src/bin/README.md
  • crates/openhuman-cli/src/bin/tool_dialect_bench.rs
  • crates/openhuman-core/src/agent/prompts/mod_tests.rs
  • crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rs
  • crates/openhuman-core/src/agent/prompts/mod_tests_subagent_render_tests.rs
  • crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs
  • crates/openhuman-core/src/agent/prompts/sections.rs
  • crates/openhuman-core/src/agent/prompts/types.rs
  • crates/openhuman-core/src/agent/session_host/builder/dispatcher.rs
  • crates/openhuman-core/src/agent/session_host/builder/factory.rs
  • crates/openhuman-core/src/agent/session_host/builder/factory_provider_role_tests_tests.rs
  • crates/openhuman-core/src/agent/session_host/builder/mod.rs
  • crates/openhuman-core/src/agent/session_host/driver.rs
  • crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
  • crates/openhuman-core/src/agent/tinyagents/config.rs
  • crates/openhuman-core/src/agent/tinyagents/config_tests.rs
  • crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
  • crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
  • crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
  • crates/openhuman-core/src/agent/tinyagents/turn_runner_inner.rs
  • crates/openhuman-core/src/config/schema/agent.rs
  • crates/openhuman-core/src/config/schema/load/env_overlay.rs
  • crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs
  • gitbooks/developing/architecture/agent-harness.md
  • vendor/tinyagents
 _________________________________________________
< We don't ship debt; we refinance it into tests. >
 -------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

Comment @coderabbitai help to get the list of available commands.

@senamakel
senamakel marked this pull request as ready for review September 22, 2026 02:13
@senamakel
senamakel requested a review from a team September 22, 2026 02:13
@senamakel
senamakel merged commit b5aa6e0 into tinyhumansai:main Sep 22, 2026
22 of 28 checks passed
@tinysweeper

tinysweeper Bot commented Sep 22, 2026

Copy link
Copy Markdown

Tiny Sweeper review

Tiny Sweeper reviewed this change across 6 lane(s) and found 3 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below.

State: Changes requested
Priority: critical
Reviewed head: 77e9b763021c
Updated: 1790044757 (Unix time)

Review snapshot

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

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

What changed

The review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below.

Features

None identified with supported citations.

Tests

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

Findings

  • critical · critique · Add the benchmark source before declaring its binary target — `src/bin/tool_dialect_bench.rs` is not present in the repository, so Cargo reports a missing binary source when loading this manifest (`cargo metadata`, builds, and tests fail befo (crates/openhuman\-cli/Cargo\.toml:62)
  • critical · critique · Borrow usage metrics before reading them repeatedly — `Option::map` consumes `response.usage`, so the second assignment uses a moved value (and the earlier output-cap guard also consumes it with `is_some_and` before reading it again). (crates/openhuman\-cli/src/bin/tool\_dialect\_bench\.rs:586)
  • medium · critique · Assert the example for the tool that the test registers — The test passes a tool list containing only `TestTool`, while the expected examples are `read_file(...)` and `read_file({...})`. Unless the renderer unconditionally emits a generic (crates/openhuman\-core/src/agent/prompts/mod\_tests\_subagent\_render\_tests\.rs:651)

Pending checks: Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS)

Before merge

  • Address Add the benchmark source before declaring its binary target (crates/openhuman\-cli/Cargo\.toml).
  • Address Borrow usage metrics before reading them repeatedly (crates/openhuman\-cli/src/bin/tool\_dialect\_bench\.rs).
  • Wait for Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS).

How this fits together

flowchart LR
  n0["...ers_invalid_schema_tool_without_arguments<br/>changed"]:::changed
  n1["...es_pformat_signature_for_text_dispatchers<br/>changed"]:::changed
  n2["...stem_prompt_skips_memory_md_when_disabled<br/>changed<br/>1 finding"]:::flagged
  n3["render_subagent_system_prompt_with_format<br/>changed"]:::changed
  n4["ToolCallFormat<br/>changed"]:::changed
  n5["vec"]:::impacted
  n6["format"]:::impacted
  n7["run_turn_via_tinyagents_inner"]:::impacted
  n8["render_subagent_system_prompt"]:::impacted
  n9["PromptContext"]:::impacted
  n10["from_tools"]:::impacted
  n0 -->|calls| n5
  n0 -->|tests| n5
  n0 -->|uses| n9
  n0 -->|calls| n10
  n0 -->|tests| n10
  n1 -->|calls| n5
  n1 -->|tests| n5
  n1 -->|uses| n9
  n1 -->|calls| n10
  n1 -->|tests| n10
  n2 -->|calls| n5
  n2 -->|tests| n5
  n2 -->|calls| n6
  n2 -->|tests| n6
  n2 -->|calls| n8
  n2 -->|tests| n8
  n3 -->|uses| n4
  n7 -->|calls| n6
  n8 -->|calls| n3
  n8 -->|uses| n4
  n9 -->|uses| n4
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading
Agent review details

critique

  • Conclusion: Failure
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 25 files; 4 findings. _The code index does not reflect this commit, so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._
  • Evidence: crates/openhuman\-cli/Cargo\.toml — Add the benchmark source before declaring its binary target
  • Evidence: crates/openhuman\-cli/src/bin/tool\_dialect\_bench\.rs — Borrow usage metrics before reading them repeatedly
  • Evidence: crates/openhuman\-core/src/agent/prompts/mod\_tests\_subagent\_render\_tests\.rs — Assert the example for the tool that the test registers

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 23 files; 0 findings. 2 files were not security-reviewed: crates/openhuman-cli/src/bin/README.md (prose or tabular data), gitbooks/developing/architecture/agent-harness.md (prose or tabular data). _The code index does not reflect this commit, so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The PR description is largely incoherent — it mixes the JSON-LD work with unrelated, rejected-protocol tangents and decision-dump text, and the untrusted-repo-rules block contains no actual test-related directives beyond the checked-in note that no test files changed or tests were added. The change is dominated by packaging/renames (workspace + `openhuman-core` crate rename, `cargo` crate name) and by an extracted `runtime/contexts.rs`, with the `[inscribed]` protocol explicitly rejected in review. The instructions require flagging whenever invariants asserted in a diff lack a pinning test: the PR's own rules block states "No test file changed" and that no tests exist in the index exercising the changed symbols, yet it also asserts several invariants — the dialect-once-committed-is-durable and term-formation uniform across the stack — that would silently regress if false. I could not validate clippy-cleanliness or whether `cargo test --workspace --all-features` genuinely passes because no CI logs or test artifacts were supplied in the diff, and the workspace rename has broad blast radius (`example_config/` references, `openhuman-console`, RPC crate feature flags) with none of those dependent call sites shown as updated. Since the instructions demand that problems appear in the findings list or not at all, and the visible diff shows no test covering the claimed invariants, the merge is questionable until the stated invariants are pinned or the behavioural-claims section is treated as documentation only. My substantive findings, if I had to reduce them to their essence: (1) no test in the diff pins the "dialect committed once, after every turn is durable" invariant; (2) no test pins the "uniform term-formation across the stack" invariant; (3) the claimed compatibility of `opaque`/`disabled` synonyms and the sed-performed `as`-cast replacements are asserted but untested, with the sed replacement actively described as a clippy-error source in the PR text. _The code index does not reflect this commit, so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The change routes the harness through a text-dialect parser so non-P-format prompts stop emitting duplicate catalogues and native schemas on the wire; the description tracks the diff, and I found no rule violations it introduces. _The code index does not reflect this commit, so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._

e2e

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: The pull request is a broad refactor that moves RPC, agent, and core crates under `crates/`, renames modules and symbols, and rewires tool registration and contract wiring. The externally visible behaviour changes — new or moved RPC/CLI surface, tool registration, contract catalex modifications, and a new task/prompt-driven agent flow — are not covered by any end-to-end test that drives the running system the way a user or client would. The changed end-to-end test lane was not exercised, and existing tests are unit-level only. As shipped, the change is not verified end to end for any of its externally observable surfaces. (2 findings discarded for not matching a changed line) Waiting on end-to-end jobs: `Rust E2E (mock backend)`, `Build Playwright E2E Artifact`, `E2E (Playwright / web lane)`, `Desktop E2E (full suite, 3 OS)`. 1 end-to-end job passed on this head.
  • Unresolved questions/checks: Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS)
Evidence and run details
  • Models: ladder/vectors, gpt-5.6-luna, deepseek/deepseek-v4-flash
  • Spend: $0.075135
  • Tokens: 1432483 input · 39653 output · 188735 cached · 1222 embedding
Head State Pass summary
77e9b763021c changes requested 3 active finding(s), 0 resolved finding(s) (at 1790044757)

tinysweeper 0.1.0

@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.

Requesting changes: 1 lane(s) blocking, worst finding is critical.

Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.

             $0.0751 · 1,432,483 in / 39,653 out · 188,735 cached (13%) · ladder/vectors, gpt-5.6-luna, deepseek/deepseek-v4-flash · 1,222 embedded
critique:    $0.0356 · 644,162 in   / 19,870 out · 50,504 cached (8%)   · gpt-5.6-luna, deepseek/deepseek-v4-flash
security:    $0.0355 · 668,435 in   / 13,081 out · 34,189 cached (5%)   · gpt-5.6-luna
tests:       $0.0014 · 33,064 in    / 2,688 out  · 29,106 cached (88%)  · deepseek/deepseek-v4-flash
description: $0.0008 · 24,675 in    / 1,112 out  · 20,710 cached (84%)  · deepseek/deepseek-v4-flash
e2e:         $0.0009 · 36,969 in    / 961 out    · 33,011 cached (89%)  · deepseek/deepseek-v4-flash

# Manual, network-touching A/B of the text tool-call dialects against a local
# Ollama model: prompt tokens and call accuracy per `agent.tool_dispatcher`
# value. Never run by CI; see the file's docs for the invocation.
[[bin]]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

priority critical critique confident

Add the benchmark source before declaring its binary target

src/bin/tool_dialect_bench.rs is not present in the repository, so Cargo reports a missing binary source when loading this manifest (cargo metadata, builds, and tests fail before the target can be skipped). Add the file or remove this [[bin]] declaration.

[RULE] missing-source-file ·

u.output_tokens >= u64::from(args.max_output_tokens)
}) =>
{
row.input_tokens = response.usage.map(|u| u.input_tokens);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

priority critical critique confident

Borrow usage metrics before reading them repeatedly

Option::map consumes response.usage, so the second assignment uses a moved value (and the earlier output-cap guard also consumes it with is_some_and before reading it again). Usage is not treated as a copyable value by the surrounding code, which uses as_ref() when inspecting response usage. Borrow it with as_ref() in every guard and mapping expression.

[RULE] compile-error ·

rendered.contains("## Tool Use Protocol"),
"{format:?}:\n{rendered}"
);
assert!(rendered.contains(example), "{format:?}:\n{rendered}");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

priority medium critique likely

Assert the example for the tool that the test registers

The test passes a tool list containing only TestTool, while the expected examples are read_file(...) and read_file({...}). Unless the renderer unconditionally emits a generic read_file example—which is not established by the provided signature—the assertion is unrelated to the registered tool and can make this test fail. Use an example for test_tool, or register a read_file fixture whose rendered signature and protocol are being tested.

[RULE] test-fixture-consistency ·

@tinysweeper tinysweeper Bot added the priority: p0 Drop what you are doing. Data loss, a live break, or an exploitable hole. label Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p0 Drop what you are doing. Data loss, a live break, or an exploitable hole.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant