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
- 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.
Description
PR #6328 (issues #6273/#6262) wired
LifecycleState::turn_tool_callsintoTurnSummary::tool_calls, replacing a hardcoded0. The counter logic was independently traced correct by four rounds of review (developer, critic, tester, reviewer) via static analysis (single reset site inbegin_turn, single increment site incheck_and_update_quota), but no test exercises a real turn that dispatches tool calls and then assertsTurnSummary.tool_callsreflects the actual nonzero count.This gap is not new to this PR — the pre-existing, already-shipped
turn_llm_requestsfield (whichturn_tool_callswas 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
crates/zeph-coretests for any assertion onTurnSummary.tool_callsorTurnSummary.llm_requestsafter 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
TurnSummaryreflects those counts.Actual Behavior
Both fields are only verified correct via manual code trace / review, not by an automated test.
Environment
crates/zeph-core/src/agent/state/mod.rs,crates/zeph-core/src/agent/tool_execution/tier_loop.rs,crates/zeph-core/src/notifications.rsLogs / 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.