Skip to content

Test parity matrix: port behavior clusters that lost all coverage in the tinyagents migration (spec Phase 11) #4468

Description

@senamakel

Part of the v0.58.7 → HEAD TinyAgents-migration audit (see parent issue). Executes the unchecked Phase 11 boxes in docs/tinyagents-migration-spec.md (lines 764, 791, 799, 806).

Context

Net test delta v0.58.7 → HEAD in the agent domain: −6,689 lines but only −67 test functions (1,029 → 962, +79 adapter-seam tests); the bulk of coverage was rewritten or moved with the loop into the tinyagents crate (~711 test attrs + ~50 e2e files). What follows is what actually lost all coverage.

Behaviors with zero coverage at HEAD

  1. Repeat-call/repeat-output/polling-exemption guards (~10 tests) — behavior also removed; tests return with the loop-guards issue.
  2. Terminal delegated-inference failure classifier (~10 tests) — ditto.
  3. Recoverable-failure nuance (timeout/transient recognition, extended headroom, varied-failure no-progress) (~4 tests) — ditto.
  4. Legacy run_skill/run_workflow → builtin cron-tool rewrite: code survives (normalize_tool_call, session/turn/mod.rs:33) but zero test references (deletion acknowledged at session/turn_tests.rs:573-583).
  5. Channel-permission tool denial at execution time: enforcement exists (ToolPolicyMiddleware::channel_permission_block, src/openhuman/tinyagents/middleware.rs:1234) but untested.
  6. Crypto wallet send flow through the agent loop (tool sequencing + confirmation gate) — only tool-level test remains.
  7. Loop-level vision rejection (non-vision provider + image markers / oversized image at loop boundary) — only prepare_messages_* unit level remains.
  8. resolve_time real-execution epoch threading through the loop.
  9. Turn-level "history actually compacts mid-run" (autocompaction + opt-out) — policy/middleware unit tests only.
  10. Stop-hook returns Stop aborts the loop — unit tests only, no loop-level abort test.
  11. Batch-break trims assistant tool_calls to executed ids — only generic orphan-hygiene tests remain.

Fix plan

  1. Build the parity test matrix (spec line 764): one table row per behavior above → target test file.
  2. Port clusters 4–11 as e2e/loop-level tests against the tinyagents route (extend tests/agent_harness_e2e.rs / tests/agent_tool_loop_raw_coverage_e2e.rs with scripted providers). Clusters 1–3 are restored together with their behaviors (see loop-guards issue) — coordinate.
  3. Add the cross-module composition e2e (spec line 799) covering graph + subagent + model + tool in one scenario.
  4. Optional stretch: fuzz-style graph composition tests (spec line 806).

Acceptance criteria

  • Every behavior listed above has at least one loop-level test exercising the live tinyagents route.
  • Spec Phase 11 boxes 764/791/799 checked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentBuilt-in agents, prompts, orchestration, and agent runtime in src/openhuman/agent/.priority: mediumEdge case or race conditionsubtaskSubtask of a larger tracked effort.taskWork item that is not primarily a bug or a feature.testTest additions, fixes, or harness work.

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions