Skip to content

no end-to-end test asserts TurnSummary.tool_calls / turn_llm_requests reflect real per-turn counts #6330

Description

@bug-ops

Description

PR #6328 (issues #6273/#6262) wired LifecycleState::turn_tool_calls into TurnSummary::tool_calls, replacing a hardcoded 0. The counter logic was independently traced correct by four rounds of review (developer, critic, tester, reviewer) via static analysis (single reset site in begin_turn, single increment site in check_and_update_quota), but no test exercises a real turn that dispatches tool calls and then asserts TurnSummary.tool_calls reflects the actual nonzero count.

This gap is not new to this PR — the pre-existing, already-shipped turn_llm_requests field (which turn_tool_calls was modeled after) has the same gap: no end-to-end test asserts it reflects real per-turn LLM request counts either.

Filed as a fast-follow per PR #6328's review discussion rather than blocking that PR, since constructing the test harness needed to drive a real turn through check_and_update_quota/LLM dispatch (currently zero direct unit tests of that function) is nontrivial and out of scope for a tech-debt cleanup PR.

Reproduction Steps

  1. Search crates/zeph-core tests for any assertion on TurnSummary.tool_calls or TurnSummary.llm_requests after a real/simulated turn — none currently exist beyond construction-site unit tests that don't exercise the increment path.

Expected Behavior

At least one integration-style test drives a turn that dispatches N tool calls and/or M LLM requests, then asserts the resulting TurnSummary reflects those counts.

Actual Behavior

Both fields are only verified correct via manual code trace / review, not by an automated test.

Environment

Logs / Evidence

See PR #6328 review thread (2026-07-16) for the coverage-gap discussion and the reviewer's judgment call to defer rather than block.

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexityllmzeph-llm crate (Ollama, Claude)testsTest-related changes

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions